LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-02-2008, 05:00 PM   #1
jurjen
LQ Newbie
 
Registered: Dec 2007
Location: amsterdam
Distribution: ubuntu 7.10
Posts: 11

Rep: Reputation: 0
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
 
Old 02-02-2008, 05:19 PM   #2
Uncle_Theodore
Member
 
Registered: Dec 2007
Location: Charleston WV, USA
Distribution: Slackware 12.2, Arch Linux Amd64
Posts: 896

Rep: Reputation: 69
What filesystem is on the drive?
 
Old 02-02-2008, 05:23 PM   #3
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,186

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
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.
 
Old 02-03-2008, 05:36 AM   #4
jurjen
LQ Newbie
 
Registered: Dec 2007
Location: amsterdam
Distribution: ubuntu 7.10
Posts: 11

Original Poster
Rep: Reputation: 0
it's running on an ext3 fs.
gonna try foremost/testdisk. hope it'll work. i'll report back on my findings.
 
Old 02-03-2008, 06:47 AM   #5
jurjen
LQ Newbie
 
Registered: Dec 2007
Location: amsterdam
Distribution: ubuntu 7.10
Posts: 11

Original Poster
Rep: Reputation: 0
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!

Last edited by jurjen; 02-03-2008 at 07:00 AM.
 
Old 02-03-2008, 08:39 AM   #6
jurjen
LQ Newbie
 
Registered: Dec 2007
Location: amsterdam
Distribution: ubuntu 7.10
Posts: 11

Original Poster
Rep: Reputation: 0
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.

Last edited by jurjen; 02-03-2008 at 09:22 AM.
 
Old 02-03-2008, 09:23 AM   #7
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,186

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
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.)
 
Old 02-03-2008, 09:29 AM   #8
Emerson
LQ Guru
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~arch
Posts: 5,961

Rep: Reputation: Disabled
chmod 0644 on directory is the culprit. It removes the executable bit which has to be there, to read a directory you execute it.
 
Old 02-03-2008, 10:19 AM   #9
jurjen
LQ Newbie
 
Registered: Dec 2007
Location: amsterdam
Distribution: ubuntu 7.10
Posts: 11

Original Poster
Rep: Reputation: 0
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!
 
Old 02-03-2008, 10:21 AM   #10
jurjen
LQ Newbie
 
Registered: Dec 2007
Location: amsterdam
Distribution: ubuntu 7.10
Posts: 11

Original Poster
Rep: Reputation: 0
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
file permissions OK, but command permissions? stabu Linux - General 2 10-05-2005 12:00 PM
locking a usage policy file/ftp file permissions gbow Linux - Newbie 0 02-16-2004 05:35 AM
CVS - file permissions and file ownership Osten Linux - Software 3 01-18-2004 04:08 PM
file permissions and file owner won't change Nadim Slackware 5 11-29-2003 06:03 PM
Changing file permissions on a SAMBA file share apenney Linux - Software 0 02-11-2002 04:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration