Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
12-23-2006, 01:54 PM
|
#1
|
|
LQ Newbie
Registered: Sep 2003
Location: San Diego, CA
Distribution: Mandrake
Posts: 4
Rep:
|
Files disappeared after permission change
I'm in panic mode right now. A week or so ago, I tried to access my USB drive by way of Mandrive 2007. I'm pretty new to this, so bear with me. I had trouble with the permissions. I tried to write to the drive with some new pictures and it wouldn't let me. I tried to change the permissions of all the folders on the drive and it just wouldn't work. I gave up and came back to the problem just now. The folders are all there, but the files are gone! This is multiple GB of all my stuff and it was in transition between locations, in other words, this was my only copy. My fiance's stuff was there too. Windows doesn't see the files either.
One more thing: Windows says that the drive is half full (about what I would expect if the files were there). I feel like I just need to reestablish access to them or something.
AHHH.
Last edited by Nyphur; 12-23-2006 at 01:58 PM.
|
|
|
|
12-23-2006, 02:56 PM
|
#2
|
|
Bash Guru
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,589
|
Sorry to hear about your problems. I hope we can help you. I'm not an expert in data recovery though, so I can only give you some general pointers.
First of all, I don't know exactly what happened to you, but part of the problem is that the FAT format (which nearly all flashdrives are) does not natively support the *nix permissions system. The permissions you see are simulated through a mount option (umask) and aren't changeable with the usual chmod command. Somehow you must have corrupted your filesystem in the attempt, something that's not difficult to do with FAT. A search of the forums or google can give you info on how to handle permissions on fat drives.
Anyway, before you do anything else, do NOT mount the drive with read-write permissions (If you don't know how to manually mount drives, learn that first). In fact, you should instead use the dd command to copy an image of it onto your hard disk and work from that to recover your data. Something like: "dd if=/dev/sda1 of=/backuplocation/usbdiskimage.iso bs=512" should do (not sure if the byte count is good though. Can anyone else help me there?). This image can be generally be treated as if it were a drive device, or mounted via a loopback device.
Your first recovery option should probably be dosfsck. This tool can sometimes recover corrupted partition tables, which is likely your problem. I've managed to salvage a bad usb stick myself using it.
If that fails, you can try to recover the files individually. There are several data recovery tools out there, but the one that worked best for me is photorec, which despite the name can rescue a large number of other file types as well. It comes in a package called testdisk. There's another promising one I've found called magicrescue, but I don't have experience with that yet. Perhaps someone else can point out other good tools you could try.
I'm not going to go into details on how to use these tools; you can read the man pages yourself. Just be sure to run the recovery tool on the disk image instead of the drive itself. The worst thing is you'll probably loose all the file names and have to rename all the files manually. But at least you'll have them.
Good luck.
|
|
|
|
12-23-2006, 03:02 PM
|
#3
|
|
LQ Newbie
Registered: Sep 2003
Location: San Diego, CA
Distribution: Mandrake
Posts: 4
Original Poster
Rep:
|
A mistake:
I should have been more specific: This is an external hard drive formatted to FAT32.
Does this change my options any?
Also, I have written to the drive. I put some more files on there successfully.
|
|
|
|
12-23-2006, 07:53 PM
|
#4
|
|
Senior Member
Registered: Sep 2003
Posts: 3,171
Rep: 
|
Your partition table isn't hosed, your file allocation table (FAT - get it?) is hosed. Writing to the drive has probably caused you to experience some data loss.
Stop writing to the drive, period. The instructions you were given for recovery were good ones; the 512 block size should be fine. Image the drive to someplace on a Linux HD, then mount the image and work on that.
In the worst case, after you have an image that you know is faithful, mount the drive on a windows machine and run scandisk or chkdsk (as appropriate, depending on the version of windows).
|
|
|
|
12-23-2006, 08:01 PM
|
#5
|
|
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,797
|
Ditto the advice already given: If you are going to have any hope of recovery, do not use the drive anymore--particularly for writing.
If you are going to attempt recovery yourself, then making a clone first would be highly recommended.
An--don't attempt recovery unless you are willing to learn a whole bunch of minutiae about partitions and filesystems and are willing to invest the time. Ohterwsie, get it to a professional.
|
|
|
|
12-23-2006, 09:09 PM
|
#6
|
|
Guru
Registered: Jan 2001
Posts: 24,128
Rep: 
|
My advice, always make a backup copy of data you never want to lose. Don't ever think that the hard drive or whatever won't fail on you on that given day, because it could happen at any given day or time.. 
|
|
|
|
12-23-2006, 11:29 PM
|
#7
|
|
LQ Newbie
Registered: Sep 2003
Location: San Diego, CA
Distribution: Mandrake
Posts: 4
Original Poster
Rep:
|
Thank you all. I am going on vacation tomorrow, so I will not be able to start on your suggestions right away (nor will I be able to sleep well at night with this all messed up), however, it will be high priority for me when I get back. I will repost with more questions and results when I have them.
Again, thanks.
|
|
|
|
12-24-2006, 09:07 AM
|
#8
|
|
Senior Member
Registered: Sep 2003
Posts: 3,171
Rep: 
|
FAT is usually easy to recover. You'll get the files back, most likely. You won't get a lot of the file names back and if they are images you'll have to browse all these images with funky names like chk0001 and see what they are, then name them.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 03:56 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|