LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   file permissions gone? (https://www.linuxquestions.org/questions/linux-newbie-8/file-permissions-gone-618235/)

jurjen 02-02-2008 05:00 PM

file permissions gone?
 
hi y'all

during moving alot of data to another hard drive, something went wrong, and now my permissions are gone, it seems... it looks like this (/dev/sdb1 mounted on /mnt/tmp):

$ ls tmp/ -al
total 0
?--------- ? ? ? ? ? tmp/.
?--------- ? ? ? ? ? tmp/..
?--------- ? ? ? ? ? tmp/apps & games
?--------- ? ? ? ? ? tmp/lost+found
?--------- ? ? ? ? ? tmp/muziek
?--------- ? ? ? ? ? tmp/video

cd gives a no permissions error

does anyone know what to do? chmod, chown etc. doesn't work, did a fsck already, gave no errors.
tx in advance,
jur

Uncle_Theodore 02-02-2008 05:19 PM

What filesystem is on the drive?

PTrenholme 02-02-2008 05:23 PM

How did you "move a lot of data?" (I.e., which command(s) did you use?)

What you're seeing in the ls output is a "clobbered" directory file, which should not have happened regardless of what you did. I had that happen (to a single file) when I closed the wrong terminal window before the copy finished, but was able to recover by going to a "root" terminal window and using chown there, but, in my case, the file sizes were correctly set in the directory file, so only the ownership needed resetting.

You could try a file recovery tool like foremost or testdisk.

jurjen 02-03-2008 05:36 AM

it's running on an ext3 fs.
gonna try foremost/testdisk. hope it'll work. i'll report back on my findings.

jurjen 02-03-2008 06:47 AM

nb. i just used 'mv'. Something like mv dir/ /dir2 (move dir into dir2), where dir was at least 20 gb...

ok, tried testdisk. it reports no errors, when fetching the file list in testdisk, it gives back a list as it should be, even with the right user id (1000). but doing an ls, gives the same result. it seems as if only the 'root' directory file of the hd is bad. assume i've mounted the hd on /mnt, ls /mnt -l gives back the result in my first post, doing a ls /mnt/video -l gives a 'no such file or directory'...
if anyone could give me a kick in the right direction, i would be very grateful!

jurjen 02-03-2008 08:39 AM

well.... i've managed to f*ck up another hd too... one advantage is that i now know what i did wrong...

the hd was mounted on /data/ I wanted to reset all permissions on the hd to 644 (for a start, wanted to do chmod +X later). This is what i did:
chmod -R 644 /data
i got an Perission denied warning, and after that, the same nice ls output:
total 0
?--------- ? ? ? ? ? data/docs
?--------- ? ? ? ? ? data/downloads
?--------- ? ? ? ? ? data/dump
etc...

so it wasn't the moving, but the chmod who damaged the directory file...

btw. note that a directory in the 'root' dir of the mounted disk looks like data/docs instead of docs.

PTrenholme 02-03-2008 09:23 AM

Was that a sudo chmod -R 644 /data or did you neglect the sudo? (Unless you'd logged in as "root," which is, normally, a locked account which you cannot use. It can be unlocked, but doing so is "discouraged" by the Ubuntu developers.)

Emerson 02-03-2008 09:29 AM

chmod 0644 on directory is the culprit. It removes the executable bit which has to be there, to read a directory you execute it.

jurjen 02-03-2008 10:19 AM

first i did the chmod with a normal user account, because of the 'permission denied' error, i ran the command again as su, but the harm was already done.

a chmod 0644 /data didn't do the trick, neither did chmod 0644 -R /data, nor as su
just get the same strange directory listing doing with the ls command...
tx for your time!

jurjen 02-03-2008 10:21 AM

woo!

sorry bout the last post, didn't read your post well
i did a chmod +x /data, and i'm back again!
(pff... was simpler than i thought!)

i love you :)


All times are GMT -5. The time now is 07:06 AM.