SAMBA: The WIN 10 client cannot delete a non-empty directory

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Goto page Previous  1, 2
Author Message
lexridge
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 1083
Location: WV, USA

PostPosted: Sat Nov 25, 2023 2:50    Post subject: Reply with quote
UncleDaddySwiss wrote:
Ok, got ssh working via powershell, Putty didn't even work. But, I don't even know the basics here, how do ya change directories to the mounted drive?

cd /opt or cd /jffs. No idea what you are mounting the drive as. Just do a df and that will show you all your drive mounts.
Code:

# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root                21248     21248         0 100% /
none                       512         0       512   0% /dev
/dev/sda2             29392780      5728  27868616   0% /jffs
/dev/sda1             29391756    177464  27695908   1% /opt

_________________
Linksys EA8500 (Internet Gateway, AP/VAP) - DD-WRT r53562
Features in use: WDS-AP, Multiple VLANs, Samba, WireGuard, Entware: mqtt, mlocate
Wireless 5ghz only

Netgear R7800 (WDS-AP, WAP, VAP) - DD-WRT r55779
Features in use: multiple VLANs over single trunk port

Linksys EA8500 WDS Station x2 - DD-WRT r55799

Netgear R6400v2 WAP, VAP 2.4ghz only w/VLANs over single trunk port. DD-WRT r55779

OSes: Fedora 38, 9 RPis (2,3,4,5), 20 ESP8266s: Straight from Amiga to Linux in '94, never having owned a Windows PC.

Forum member #248
Sponsor
lexridge
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 1083
Location: WV, USA

PostPosted: Sat Nov 25, 2023 3:04    Post subject: Reply with quote
This is a decent startup guide for those who may not be familiar with the Linux command line:
https://www.geeksforgeeks.org/basic-shell-commands-in-linux/#

You need to remember, DD-WRT will not contain some of these commands, as it uses Busybox. But still a decent tutorial and should be about 90% reliable in your situation.

_________________
Linksys EA8500 (Internet Gateway, AP/VAP) - DD-WRT r53562
Features in use: WDS-AP, Multiple VLANs, Samba, WireGuard, Entware: mqtt, mlocate
Wireless 5ghz only

Netgear R7800 (WDS-AP, WAP, VAP) - DD-WRT r55779
Features in use: multiple VLANs over single trunk port

Linksys EA8500 WDS Station x2 - DD-WRT r55799

Netgear R6400v2 WAP, VAP 2.4ghz only w/VLANs over single trunk port. DD-WRT r55779

OSes: Fedora 38, 9 RPis (2,3,4,5), 20 ESP8266s: Straight from Amiga to Linux in '94, never having owned a Windows PC.

Forum member #248
UncleDaddySwiss
DD-WRT Novice


Joined: 10 Oct 2020
Posts: 12

PostPosted: Sat Nov 25, 2023 3:11    Post subject: Reply with quote
OK, figured it out, all folders show up as:

root@<hostname>:/tmp/mnt/sda1# ls -l
drwxr-xr-x <#> root root <size> <date> <folder name>

There are 4 folders here
What does this mean?
lexridge
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 1083
Location: WV, USA

PostPosted: Sat Nov 25, 2023 3:20    Post subject: Reply with quote
What I would try first is to just remove the folder you could not earlier, using the command I posted earlier. Make sure it works. Just a good test to make sure the FS is not corrupted.

Code:

rm -rf foldertodelete


Not a lot of good information here, but seeing you are mounting your drive at
/tmp/mnt/sda1 you should be able to:
Code:

umount /dev/sda1
fsck /dev/sda1

Let's see if you get any errors doing this.

However, it will probably get more complicated than this. If you have that drive mounted anywhere via network, and it's in use, it will probably not unmount.

_________________
Linksys EA8500 (Internet Gateway, AP/VAP) - DD-WRT r53562
Features in use: WDS-AP, Multiple VLANs, Samba, WireGuard, Entware: mqtt, mlocate
Wireless 5ghz only

Netgear R7800 (WDS-AP, WAP, VAP) - DD-WRT r55779
Features in use: multiple VLANs over single trunk port

Linksys EA8500 WDS Station x2 - DD-WRT r55799

Netgear R6400v2 WAP, VAP 2.4ghz only w/VLANs over single trunk port. DD-WRT r55779

OSes: Fedora 38, 9 RPis (2,3,4,5), 20 ESP8266s: Straight from Amiga to Linux in '94, never having owned a Windows PC.

Forum member #248
UncleDaddySwiss
DD-WRT Novice


Joined: 10 Oct 2020
Posts: 12

PostPosted: Sat Nov 25, 2023 3:29    Post subject: Reply with quote
rm command worked, deleted folder in ssh and windows explorer.
unmount didn't work, 'not found'

EDIT: I put an N in umount, but still didn't work, 'Resource Busy'
lexridge
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 1083
Location: WV, USA

PostPosted: Sat Nov 25, 2023 3:32    Post subject: Reply with quote
UncleDaddySwiss wrote:
EDIT: I put an N in umount, but still didn't work, 'Resource Busy'

In which case you will need to disable the Samba share first. Then try again.

_________________
Linksys EA8500 (Internet Gateway, AP/VAP) - DD-WRT r53562
Features in use: WDS-AP, Multiple VLANs, Samba, WireGuard, Entware: mqtt, mlocate
Wireless 5ghz only

Netgear R7800 (WDS-AP, WAP, VAP) - DD-WRT r55779
Features in use: multiple VLANs over single trunk port

Linksys EA8500 WDS Station x2 - DD-WRT r55799

Netgear R6400v2 WAP, VAP 2.4ghz only w/VLANs over single trunk port. DD-WRT r55779

OSes: Fedora 38, 9 RPis (2,3,4,5), 20 ESP8266s: Straight from Amiga to Linux in '94, never having owned a Windows PC.

Forum member #248
lexridge
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 1083
Location: WV, USA

PostPosted: Sat Nov 25, 2023 3:42    Post subject: Reply with quote
Try this:
Code:

fsck /dev/sda1 -nf

This will check the filesystem without attempting any repairs. Should work even if in use.

_________________
Linksys EA8500 (Internet Gateway, AP/VAP) - DD-WRT r53562
Features in use: WDS-AP, Multiple VLANs, Samba, WireGuard, Entware: mqtt, mlocate
Wireless 5ghz only

Netgear R7800 (WDS-AP, WAP, VAP) - DD-WRT r55779
Features in use: multiple VLANs over single trunk port

Linksys EA8500 WDS Station x2 - DD-WRT r55799

Netgear R6400v2 WAP, VAP 2.4ghz only w/VLANs over single trunk port. DD-WRT r55779

OSes: Fedora 38, 9 RPis (2,3,4,5), 20 ESP8266s: Straight from Amiga to Linux in '94, never having owned a Windows PC.

Forum member #248
UncleDaddySwiss
DD-WRT Novice


Joined: 10 Oct 2020
Posts: 12

PostPosted: Sat Nov 25, 2023 3:49    Post subject: Reply with quote
disabling samba share didnt work, and fsck command resulted in this:

fsck 1.47.0 (5-Feb-2023)
Usage: fsck.exfat
-r | --repair Repair interactively
-y | --repair-yes Repair without ask
-n | --repair-no No repair
-p | --repair-auto Repair automatically
-a Repair automatically
-b | --ignore-bad-fs Try to recover even if exfat is not found
-s | --rescue Assign orphaned clusters to files
-V | --version Show version
-v | --verbose Print debug
-h | --help Show help
lexridge
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 1083
Location: WV, USA

PostPosted: Sat Nov 25, 2023 3:57    Post subject: Reply with quote
You did something wrong.
Code:

# fsck /dev/sda2 -nf
fsck 1.47.0 (5-Feb-2023)
e2fsck 1.47.0 (5-Feb-2023)
Warning!  /dev/sda2 is mounted.
Warning: skipping journal recovery because doing a read-only filesystem check.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Free blocks count wrong (7347219, counted=7346763).
Fix? no

jffs: 12/1880480 files (0.0% non-contiguous), 163053/7510272 blocks

_________________
Linksys EA8500 (Internet Gateway, AP/VAP) - DD-WRT r53562
Features in use: WDS-AP, Multiple VLANs, Samba, WireGuard, Entware: mqtt, mlocate
Wireless 5ghz only

Netgear R7800 (WDS-AP, WAP, VAP) - DD-WRT r55779
Features in use: multiple VLANs over single trunk port

Linksys EA8500 WDS Station x2 - DD-WRT r55799

Netgear R6400v2 WAP, VAP 2.4ghz only w/VLANs over single trunk port. DD-WRT r55779

OSes: Fedora 38, 9 RPis (2,3,4,5), 20 ESP8266s: Straight from Amiga to Linux in '94, never having owned a Windows PC.

Forum member #248
lexridge
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 1083
Location: WV, USA

PostPosted: Sat Nov 25, 2023 4:01    Post subject: Reply with quote
Oh!! My mistake. I thought you mentioned in an earlier post you were using ext4. Exfat is entirely different.
_________________
Linksys EA8500 (Internet Gateway, AP/VAP) - DD-WRT r53562
Features in use: WDS-AP, Multiple VLANs, Samba, WireGuard, Entware: mqtt, mlocate
Wireless 5ghz only

Netgear R7800 (WDS-AP, WAP, VAP) - DD-WRT r55779
Features in use: multiple VLANs over single trunk port

Linksys EA8500 WDS Station x2 - DD-WRT r55799

Netgear R6400v2 WAP, VAP 2.4ghz only w/VLANs over single trunk port. DD-WRT r55779

OSes: Fedora 38, 9 RPis (2,3,4,5), 20 ESP8266s: Straight from Amiga to Linux in '94, never having owned a Windows PC.

Forum member #248
UncleDaddySwiss
DD-WRT Novice


Joined: 10 Oct 2020
Posts: 12

PostPosted: Sat Nov 25, 2023 4:05    Post subject: Reply with quote
Ok, so I exited out of cmd prompt entirely, restarted and ran those commands again. this time I got:

umount /dev/sda1 ...[seemed to work, no text response]
fsck /dev/sda1 ...
fsck 1.47.0 (5-Feb-2023)
exfatprogs version : 1.2.0
/dev/sda1: clean. directories 11474, files 189225
(after several seconds)

I think I might have been in a wrong directory before...??

...

Now I just reenabled the samba share in the GUI, but in Shares/Path it says /mnt/sda1 [not available], and in explorer it says 0 bytes free of 0 bytes, and it says 'Empty Folder.'
Not sure whats happening.
lexridge
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 1083
Location: WV, USA

PostPosted: Sat Nov 25, 2023 4:21    Post subject: Reply with quote
UncleDaddySwiss wrote:
Ok, so I exited out of cmd prompt entirely, restarted and ran those commands again. this time I got:

umount /dev/sda1 ...[seemed to work, no text response]
fsck /dev/sda1 ...
fsck 1.47.0 (5-Feb-2023)
exfatprogs version : 1.2.0
/dev/sda1: clean. directories 11474, files 189225
(after several seconds)

I think I might have been in a wrong directory before...??


The directory has nothing to do with it. We are on the device level here, not the directory structure. You could try this, but I don' think it will make any difference.
Code:

chmod 775 /tmp/mnt/sda1 -R

This changes the permissions of the drive/folder. You can easily change it back later with
Code:

chmod 700 /tmp/mnt/sda1 -R

Bedtime. do yourself a favor and read up on basic linux syntax/commands. I think you will find that Linux is so much better you will dump Windows. Wink

_________________
Linksys EA8500 (Internet Gateway, AP/VAP) - DD-WRT r53562
Features in use: WDS-AP, Multiple VLANs, Samba, WireGuard, Entware: mqtt, mlocate
Wireless 5ghz only

Netgear R7800 (WDS-AP, WAP, VAP) - DD-WRT r55779
Features in use: multiple VLANs over single trunk port

Linksys EA8500 WDS Station x2 - DD-WRT r55799

Netgear R6400v2 WAP, VAP 2.4ghz only w/VLANs over single trunk port. DD-WRT r55779

OSes: Fedora 38, 9 RPis (2,3,4,5), 20 ESP8266s: Straight from Amiga to Linux in '94, never having owned a Windows PC.

Forum member #248
lexridge
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 1083
Location: WV, USA

PostPosted: Sat Nov 25, 2023 4:26    Post subject: Reply with quote
UncleDaddySwiss wrote:
Now I just reenabled the samba share in the GUI, but in Shares/Path it says /mnt/sda1 [not available], and in explorer it says 0 bytes free of 0 bytes, and it says 'Empty Folder.'
Not sure whats happening.

Reboot your router and try again

_________________
Linksys EA8500 (Internet Gateway, AP/VAP) - DD-WRT r53562
Features in use: WDS-AP, Multiple VLANs, Samba, WireGuard, Entware: mqtt, mlocate
Wireless 5ghz only

Netgear R7800 (WDS-AP, WAP, VAP) - DD-WRT r55779
Features in use: multiple VLANs over single trunk port

Linksys EA8500 WDS Station x2 - DD-WRT r55799

Netgear R6400v2 WAP, VAP 2.4ghz only w/VLANs over single trunk port. DD-WRT r55779

OSes: Fedora 38, 9 RPis (2,3,4,5), 20 ESP8266s: Straight from Amiga to Linux in '94, never having owned a Windows PC.

Forum member #248
UncleDaddySwiss
DD-WRT Novice


Joined: 10 Oct 2020
Posts: 12

PostPosted: Sat Nov 25, 2023 4:32    Post subject: Reply with quote
Thank you for all the help, its really appreciated. Good night!
PavelVD
DD-WRT User


Joined: 26 Jul 2019
Posts: 109

PostPosted: Sun Dec 17, 2023 16:38    Post subject: Reply with quote
I want to inform you that on r54517, non-empty folders are now deleted without problems. There were probably some updates - I didn't follow them.
Anyway, thanks to the developers for their work!

_________________
Linksys WRT1900ACSv2
Automatically adjustable temperature, always within the range of 59-68°С.
Goto page Previous  1, 2 Display posts from previous:    Page 2 of 2
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum