LinuxQuestions.org

LinuxQuestions.org (http://www.linuxquestions.org/questions/index.php)
-   Linux - Hardware (http://www.linuxquestions.org/questions/forumdisplay.php?f=18)
-   -   Gain access to files on removable ext3 drive (http://www.linuxquestions.org/questions/showthread.php?t=4175436699)

r3g 11-11-2012 05:02 PM

Gain access to files on removable ext3 drive
 
Hi,

I have a Seagate 320Gb external hard drive formatted as ext3 hooked up to my NSLU2 NAS.

Recently the NAS has been reporting low disk space on the drive, but now it's refusing access to the drive. None of the valid user accounts can access any files. They can browse the directories but if you try to even open a file you get permission denied.

I'm thinking that the issue could be to do with the low disk space and the way that the NSLU2 works, so I thought I'd just hook up the drive to another computer and try to delete some files and repair the permissions issue.

I decided to use my Raspberry Pi for this as it's conveniently situated next to the NSLU2, so I plugged the external drive into it and as I expected, I can see the files, but can't access or delete them because they were created on another system.

So I tried "chown" on one of the folders on the drive, but I got permission denied, so then I tried "chattr -i" on it and got the same.

Is there an easy way to take ownership of these files so that I can sort them out, or is the problem likely to be due to some sort of corruption on the drive? if so, is it repairable?

Thanks,

Richard

smallpond 11-11-2012 05:20 PM

"permission denied" most likely means the drive is mounted read-only. What does mount say? Any error messages for the drive?

r3g 11-12-2012 12:55 AM

The drive is auto mounted when plugged in and /etc/mtab says;

/dev/sda1 /media/a44d2b4b-1794-4537-b818-51b681027a59 ext3 rw,nosuid,nodev,rela$

So I'm assuming that rw means read/write?

r3g 11-12-2012 01:00 AM

Sorry, that line from mtab was truncated, this is the full line;

/dev/sda1 /media/a44d2b4b-1794-4537-b818-51b681027a59 ext3 rw,nosuid,nodev,relatime,user_xattr,acl,barrier=1,nodelalloc,data=ordered 0 0

smallpond 11-12-2012 10:09 PM

/etc/mtab has the options that were used when the mount operation was performed. The mount command reads /proc/mounts which will give you the actual states of the filesystems.

r3g 11-13-2012 01:04 AM

Thanks I didn't know that.

Looking in /proc/mounts I see;

/dev/sda1 /media/a44d2b4b-1794-4537-b818-51b681027a59 ext3 rw,nosuid,nodev,relatime,user_xattr,acl,barrier=1,nodelalloc,data=ordered 0 0

It's the same as from /etc/mtab, so if it was mounted as rw but is ignoring that command then is it likely to be disk corruption causing the problem?

catkin 11-13-2012 03:59 AM

Or it could be ACLs. The getfacl command can be used to display ACLs.

r3g 11-13-2012 04:26 PM

Unfortunately getfacl / setfacl commands do not exist in the Raspbian distro that I'm running here.


All times are GMT -5. The time now is 09:43 PM.