maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   General (https://talk.maemo.org/forumdisplay.php?f=7)
-   -   [SOLVED] How do I delete a read-only folder ? (https://talk.maemo.org/showthread.php?t=64746)

RenaldoTT 2010-10-30 21:10

[SOLVED] How do I delete a read-only folder ?
 
I tried extracting a .ipk dile using dpkg - X *source* / *destination* and then my device froze so I did a hard reboot taking the battery out etc. Now there's a folder in /MyDocs that contains a folder which is "read-only", so I can't delete it and when I try well I get the *name of dolder* is read-only and then all other files become read-only so I have to reboot to get them back to normal, my PC can't change the folder so I can delete it so does anyone know how I can? I believe the files inside are damaged also.

Thanks

SOLUTION
root
umount /dev/mmcblk0p1
fsck.vfat -aw /dev/mmcblk0p1
reboot

joelteixeira 2010-10-30 21:14

Re: How do I delete a read-only folder ?
 
if you have rootsh installed, just do:

sudo gainroot
rm -rf /path/to/folder/you/want/to/delete

And say bye bye folder

RenaldoTT 2010-10-30 21:16

Re: How do I delete a read-only folder ?
 
tried that, it says I don't have permission, read-only folder

strange isn't it

joelteixeira 2010-10-30 21:17

Re: How do I delete a read-only folder ?
 
Really weird...

try:

sudo gainroot
chmod 777 /path/to/folder/you/want/to/delete
rm -rf /path/to/folder/you/want/to/delete

RenaldoTT 2010-10-30 21:20

Re: How do I delete a read-only folder ?
 
what will the chmod 777 command do?

joelteixeira 2010-10-30 21:22

Re: How do I delete a read-only folder ?
 
Change foder's permission

kinggo 2010-10-30 21:24

Re: How do I delete a read-only folder ?
 
read this........
http://www.zzee.com/solutions/unix-permissions.shtml

joelteixeira 2010-10-30 21:27

Re: How do I delete a read-only folder ?
 
so...? Do you still dont know what 777 means?

owner: read, write and execute permissions,
group: read, write and execute permissions,
others: read, write and execute permissions,

Full access...

RenaldoTT 2010-10-30 21:30

Re: How do I delete a read-only folder ?
 
trying it now will let u kno
thanks :)

Ali 2010-10-30 21:31

Re: How do I delete a read-only folder ?
 
did u tried to delete it through a file manager for example mc midnight commander?

RenaldoTT 2010-10-30 21:32

Re: How do I delete a read-only folder ?
 
no luck, smh this is ridiculous

RenaldoTT 2010-10-30 21:34

Re: How do I delete a read-only folder ?
 
Quote:

Originally Posted by Ali (Post 857913)
did u tried to delete it through a file manager for example mc midnight commander?

yea but no luck, im goin to change the permissions with chmod of every file in the folder, thanks guys

RenaldoTT 2010-10-30 21:35

Re: How do I delete a read-only folder ?
 
can't change permissions of the individial files but I have full access to the folder just not the files inside, chmod 777 doesn't work on them

joelteixeira 2010-10-30 21:37

Re: How do I delete a read-only folder ?
 
chmod -R 777 /path/to/folder

RenaldoTT 2010-10-30 21:43

Re: How do I delete a read-only folder ?
 
k that works for sure, what did the -R do though?

I got one file deleted can't delete the entire folder so I'm going to have to go file by file it seems, rebooted and trying again :)

retsaw 2010-10-30 21:51

Re: How do I delete a read-only folder ?
 
Most likely the filesystem is corrupted. If you haven't been changing things, MyDocs is FAT32 which doesn't support permissions, the permissions shown are what are assigned by the linux vfat drive based on the options specified when it was mounted, so if something is showing read-only it is most likely due to corruption.

To fix, since this partition is the one shared when you plug into a computer you can just plug it in to a Windows computer right click on the drive, select properties and there should be an option to check the drive for errors (these aren't exact instructions because I use Linux for day-today stuff and I can't be bothered to check).

Or to do it on your N900, open a terminal "sudo gainroot", then as root "umount /dev/mmcblk0p1", then "dosfsck -aw" to run the automatic check and repair, or "dosfsck -rw" for the interactive repair where you are asked what to do when the is more than one choice for how to repair the error, when that is done you can now remount it with "mount /dev/mmcblk0p1", when this is done you should now be able to remove the folder assuming it was left intact by the filesystem repair.

joelteixeira 2010-10-30 22:13

Re: How do I delete a read-only folder ?
 
-R = recursive

All files and folder inside the one you pointed.

RenaldoTT 2010-10-30 22:16

Re: How do I delete a read-only folder ?
 
Well so far I'm checking the volume for errors but it seems I can delete one file at a time after which they go back to read-only then I gota reboot and do the same to anotehr folder, that method will take a while but hopefully after this erros check is done, I'll just be able to delete the entire folder with ease

damion 2010-10-30 22:34

Re: How do I delete a read-only folder ?
 
to see if the filesystem you're sat in is mounted read-only:

mount |grep $(df .|grep -o "/dev/[^ ]*")

use find . -type d to see if you can traverse the hierarchy, if not then a directory might not have the execute bit. If this is the case let us know and we'll direct the right followup cmd.

use: fuser -m .
this may show a load of process ids and one might be locking your ability to delete stuff. one will be your shell you can look up with
ps |grep PID

RenaldoTT 2010-10-30 22:40

Re: How do I delete a read-only folder ?
 
Well I'll have to do that after this thing checks for erros, it's taking forever, I'm trying one method at a time but I'll let you know, btw what is the command "find . -type d" ?

Oh btw I'm a noob with just a touch of experience so if I don't get something just try to bare with me

retsaw 2010-10-30 23:20

Re: How do I delete a read-only folder ?
 
The dot in the find command means to start the search from the current directory, and "-type d" tells find to look for and match directories.

The filesystem wouldn't be mounted read-only without a reason, either filesystem errors or a hardware error, though if it had been mounted read-only you could check "dmesg" to look for any relevant error messages telling why the kernel remounted it read-only.

RenaldoTT 2010-10-30 23:31

Re: How do I delete a read-only folder ?
 
I doubt it's the file system mounted as read-only though because open reboot everything is accessable, I can delete songs, and pictures, but as soon as I got into the folder that was being extracted when my device froze, and try to delete a file in there, one might delete but if I look at another it'll say read only and then my songs become read only and folders and pictures also, if I reboot then it's back to normal again, and if I run chmod 777 on a file then it will become deleteable but I'll have to reboot again and again, each time for each file, or so it seems, I can't check now because it's plugged in and I'm running the scan for erros which still is taking forever.

lunat 2010-10-30 23:58

Re: How do I delete a read-only folder ?
 
didn't the op say it is on MyDocs? MyDocs is vfat and for that has no permissions and subfolders don't have permissions.

could the op please state where the folder in question realy is?

--->redsaw!!
br

RenaldoTT 2010-10-31 00:03

Re: How do I delete a read-only folder ?
 
/home/user/MyDocs/usr/palm/application/com.ea.app.nfsuc/res-nfsuc/

I'm not sure about the res-nfsuc part but yea that's where it is

lunat 2010-10-31 00:06

Re: How do I delete a read-only folder ?
 
if you want help i want the output of

cat /proc/mounts
please(with an s)

RenaldoTT 2010-10-31 00:08

Re: How do I delete a read-only folder ?
 
that will have to be done later as the device is plugged into the pc running an error scan on the internal memory, im not sure if closing off the scan will cause damage and it's taking VERY long to complete

lunat 2010-10-31 00:11

Re: How do I delete a read-only folder ?
 
you dissasembled your phone and pulled out the internal mmc?
you make fun of us, don't you?

RenaldoTT 2010-10-31 00:12

Re: How do I delete a read-only folder ?
 
what? no the device is plugged into the pc via usb

lunat 2010-10-31 00:16

Re: How do I delete a read-only folder ?
 
this is what path looks like. it looks like being mounted via nfs and as quick shot i would think you got a stale handle somewhere around that needs to be deleted, but.... we have to verify that hypothesis.

RenaldoTT 2010-10-31 00:18

Re: How do I delete a read-only folder ?
 
with this command "cat /proc/mounts" ?

lunat 2010-10-31 00:21

Re: How do I delete a read-only folder ?
 
Quote:

Originally Posted by RenaldoTT (Post 858019)
with this command "cat /proc/mounts" ?

it tells the kernels idea of what you have mounted and where it is mounted. its better than mount as it represents more the kernels idea which mount sometimes doesn't.

but like i said: from the path i think nfs blocks the directory.

RenaldoTT 2010-10-31 00:24

Re: How do I delete a read-only folder ?
 
do u know what scan im talking about? I plugged in the device, right clicked while in the internal memory on my pc, selected properties, then tools, and i clicked error checking. do you kno if it can be stopped while running because there is no cancel button just the X and usually these things cause problems when stopped mid progress.

im trying to be as detailed as I can so that you can help

Those files inside the nfs are corrupted/damaged, that might be the issue here

lunat 2010-10-31 00:38

Re: How do I delete a read-only folder ?
 
actually:no i don't know what scan you are running. but i take it, you just do it and don't care until you finished.

what i read is that you have some device you have somehow(presumably via nfs) mounted on you filesystem. and what i do know from what you say, is that you cannot delete anything from it.
everything else we need to find out. and nfs is prominent for locking something up for good. so thats my guess.

RenaldoTT 2010-10-31 00:40

Re: How do I delete a read-only folder ?
 
yea that's exactly the problem head on but this stupid scan won't finish fast enough for me to provide with what you need. I might just have to send it to you tomorrow, I'll keep you posted on the situation though

lunat 2010-10-31 00:49

Re: How do I delete a read-only folder ?
 
oh, the problem sometimes vanishes if you wait long enough. ;)

RenaldoTT 2010-10-31 00:50

Re: How do I delete a read-only folder ?
 
yea because nothing is permanent

retsaw 2010-10-31 01:33

Re: How do I delete a read-only folder ?
 
Quote:

Originally Posted by lunat (Post 858009)
didn't the op say it is on MyDocs? MyDocs is vfat and for that has no permissions and subfolders don't have permissions.

Due to the way linux filesystems work, the files and directories on a FAT partition get assigned permissions by the vfat driver even though FAT itself doesn't support permissions. This does, of course, mean you can't change them in the usual way, you can only change permissions by remounting the filesystem, and you can only go so far as setting a default mask that applies to all files on the filesystem, and a separate one for all directories. But as far as the kernel (aside from the vfat driver) and userspace utilities see the files, they do have permissions.

Quote:

--->redsaw!!
br
Eh? Does this mean something?

lunat 2010-10-31 01:40

Re: How do I delete a read-only folder ?
 
you can have permissions on the mount. but no way to temper in any way with permissions on directories or files for there is nothing to store them on the filesystem. precise enough?
i seconded what you said.

and look what we found out: the op mounted something and has problem with that mount.
lets see when he is finished checking the filesystem.

RenaldoTT 2010-10-31 01:40

Re: How do I delete a read-only folder ?
 
Well seeing as I was getting to delete one file at a time in the folder, what would you say about that? Would you say the entire file system is messed up or just that those files are damaged which they are by the way

lunat 2010-10-31 01:56

Re: How do I delete a read-only folder ?
 
when it calls you a bonehead you know that you are checking a mounted filesystem.
i might been wrong with the nfs just guessed it from the pathname. say, what is that thing you had mounted?

edit: no offense! that "bonehead" thing is really the errormessage you get after a while when you try to check a mounted filesystem. it realy says that,


All times are GMT. The time now is 21:10.

vBulletin® Version 3.8.8