[Q] Need help deleting a directory

Search This thread

Ch3vr0n

Senior Member
May 6, 2009
1,693
668
41
So here's the thing i've been exploring the possibilities of USBHost and decided to try an usb stick so i installed Paragon https://play.google.com/store/apps/details?id=com.paragon.mounter

It took me a while to get the hang of things. At first my usbstick was formatted in fat32. I specified in paragon i would like the default mount point to be USBStorage instead of /paragonNTFS. I made a small typo at first and named the folder usbStorage

now here comes the problem.

for some reason the app created 2 subfolders called sdb1 and sdb2 and i cannot remove them

Things i've tried:

cyanogenmod file manager in root access mode
-- delete directory > "This operation needs elevated permissions. Try switching to root access mode" (translated from dutch so wording may be a bit off
-- modifying permissions of folders > denied > changing permissions failed. for security reasons some filesystems, such as on sdcards do not allow changing permissions

Same problem for Astro file manager
Same problem when attaching the tablet to computer. parent directory (and sub dirs) get "removed" in windows but when checking the file system on the tablet, the opposite is true and the directories is still present

and now it's starting to piss me off. I want that folder "usbStorage" and it's subfolders "sdb1" and "sdb2" removed. so my guess is it'll have to be done by terminal commands but my terminal experience is ZERO.

in preperation of you guys helping me installed https://play.google.com/store/apps/details?id=jackpal.androidterm the same one used in cyanogenmod roms. I tried a bit of tinkering myself but prob doing something wrong

what i've tried (in sequence, --ok behind the command means it was succesfully executed)

su --ok
cd sdcard --ok
*rm -rf /usbStorage >> *rm: not found
rm -rf /usbstorage --ok, but folder was still present
rm -rf usbstorage --rm failed for usbStorage, Directory not empty
cd usbStorage --ok
rm -rf sdb1 --ok, rm failed for sdb1, Permission denied

at that point i gave up. I hope you guys can help me out


I do have paragon configured properly now and my USBstick in NTFS is getting recognised. Upon mounting of the usbstick, it now creates a folder called "USBStorage" where the contents of the usb stick is properly displayed.

so where are those android terminal / linux masters to help me out :)

only thing i can add is that when opening paragon with the stick attached but unmounted i do see a line above it /dev/block/sda1 but that doesn't seem to affect mounting in the specified directory
 

Ch3vr0n

Senior Member
May 6, 2009
1,693
668
41
Bump, anyone? I want and need this folder removed

Verstuurd vanaf mijn Nexus 7 met Tapatalk
 

userdelroot

Senior Member
Aug 7, 2010
331
157
Florida
From my understanding of your post.
You are rooted and using cyanogenmod?

Did you try going into the app information and clear data?

In the app drawer hold the app and then drag it to App Info
Clear data.
Did that solve it? If not continue below.

Make sure you don't have the USB stick mounted and or plugged in.
Then go into terminal and type

su

Then type.

mount

The mount command shows all listed mount points. If you don't see the usbStorage or whatever mounted.
Then type.

busybox rm -rf usbStorage

Or whatever the main directory is...
For example directory is at.
/sdcard/usbStorage

cd /sdcard
rm -rf usbStorage


Let me know how you make out.

Sent from my Galaxy Nexus using xda app-developers app
 

Ch3vr0n

Senior Member
May 6, 2009
1,693
668
41
nope, my phone is running CM 10.2 (not relevant to the question) this is the nexus section and its my nexus 7 2013 running stock rom but rooted yes that needs the folders removed. :)

The folders i need to delete according to the Nexus 7 mount main mount path SD content

main path: /storage/emulated/0 or /storage/emulated/legacy (both are the same according according to ParagonNTFS as a folder the mount path /sdcard/USBStorage = /storage/emulated/0/USBStorage or /storage/emulated/legacy/USBStorage


important lines?

/dev/fuse /storage/emulated/0/ fuse rw,nosuid,nodev,realtime, user_id=1023, default_permissions,allow_other 0 0
/def/fuse /storage/emulated/legacy fuse rw,nosuid,nodev,relatimeuser,user_id=1023, group_id=1023,default_permissions,allow_other 0 0
folders to delete are
/storage/emulated/0/usbStorage
/storage/emulated/0/usbStorage/sdb1 <= can select these just fine
/storage/emulated/0/usbStorage/sdb2
/storage/emulated/0/ParagonNTFS <= simply selecting this folder prompts CM manager "this operation needs elevated priviledges. Try switching to rootmodus, even when the CM filemanager already is in root mode


so i went

Opening terminal
su
cd sdcard (command ok)
cd usbStorage (commando ok)
busybox rm -rf sdb1
rm: can't remove 'sdb1': permission denied

Then i tried

cd /sdcard
rm -rf usbStorage
rm failed for usbStorage, Directory not empty
cd usbStorage
rm -rf sdb1
rm failed for sdb1, Permisison denied
busybox rm -rf sdb1
rm: can't remove 'sdb1': Permision denied

According to Cyanogen mod file manager:

Filesysteminfo:
Status: rw
linkpath?: /storage/emulated/0
Device: /dev/fuse
Type: fuse
Options: rw,nosuid,nodev,relatime,user_id=1023,default_permissions,allow_other
Dump / Pass: 0 / 0

even with the app ParagonNTFS uninstalled it doesnt work
 

userdelroot

Senior Member
Aug 7, 2010
331
157
Florida
hmm
try

close the app ParoganNTFS and uninstall it.
then try to delete those directories.

Also when you type
mount
does it show any of the directories you are trying to delete as mounted?
if it is try
umount /sdcard/usbStorage/sdb1
rm -rf /sdcard/usbStorage/sda1
 

lamoid

Member
May 8, 2013
40
3
were you able to delete the dir?

I had the same problems under very similar circumstances. Stickmount rather than paragon. The only way I could delete the dir was to boot into recovery (team win recovery project v2.7.1.1) and delete it with TWRP's terminal command. Something in the OS apparently locks on to the mount and simply will not let it go ever. It has to be done before android starts. It's very annoying. I am beginning to really be disgusted with many of the decisions google is making with regard to android. Why do they hate sdcard expansion so much? its absurd.

---------- Post added at 04:22 AM ---------- Previous post was at 04:17 AM ----------

Oh and by the way, even though the OS latched on to that folder as if its very existence depended on it, I was never able to even see the files on the USB memory stick with any file explorer. Worked just fine in kit kat and before. In some ways lollipop really sucks.
 
  • Like
Reactions: efto

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    were you able to delete the dir?

    I had the same problems under very similar circumstances. Stickmount rather than paragon. The only way I could delete the dir was to boot into recovery (team win recovery project v2.7.1.1) and delete it with TWRP's terminal command. Something in the OS apparently locks on to the mount and simply will not let it go ever. It has to be done before android starts. It's very annoying. I am beginning to really be disgusted with many of the decisions google is making with regard to android. Why do they hate sdcard expansion so much? its absurd.

    ---------- Post added at 04:22 AM ---------- Previous post was at 04:17 AM ----------

    Oh and by the way, even though the OS latched on to that folder as if its very existence depended on it, I was never able to even see the files on the USB memory stick with any file explorer. Worked just fine in kit kat and before. In some ways lollipop really sucks.