Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm not a computer guru but I do like the ethos of open source so I use Ubuntu for day to day stuff. My interest is photography and I have a large external drive with all my pictures on it.

Recently my wife pulled the usb out of the computer without unmounting it.

I've tried several of the suggestions here and on Google without luck.

chmod 777 -R
chown root:user /meida/Hd-drive

It's fat32 file system.

When I try to delete files on the USB it says it's read only file system.

Reformatting isn't an option as all my pics are stored there (a hard lesson for the future).

share|improve this question
add comment

1 Answer 1

You could treat your photo archive's sudden status as a read-only disk, as an opportunity to buy a backup disk, and make a copy!

fsck is the repair tool you were looking for. First, some info. In a terminal window run mount|grep media. It will print something like

/dev/sdb1 on /media/user/HD-drive type vfat (followed by some noise)

And maybe other disks as well. You're looking for the device ID corresponding to your mounted drive, /dev/sdb1 in my example. Next, unmount the disk and run the repair tool.

sudo umount /media/user/HD-drive
sudo fsck.vfat -a -l /dev/sdb1

where /dev/sdb1 is the device discovered earlier (and probably will be not exactly the same on your system). fsck will attempt to fix anything broken on your drive, and will list names of any files it found remarkable. Make a note of the file names, if any.

With any luck your disk will be fine now. Wait a minute after fsck completes, unplug it, and plug it back in. Though the disk (should) look healthy now, some files may be damaged. You may want to come back and ask for tips detecting damage, just for peace of mind. Be sure to check any files fsck may have mentioned.

Personally I would hie me off to get a backup disk, make a copy, and only then attempt the recovery process above. Any files you find were damaged, you may be able to copy back to the original disk from the pre-fix copy you just made. Unlikely but possible. Keep both disks then, and use the original for your working copy for a while, until you're pretty confident it's in good shape and the pre-fix copy is no longer helpful. Once you've reached that point, copy the original disk back over the copy, and begin using the copy as an active backup.

share|improve this answer
    
Thanks a million for your answer appreciate the input unfortunately it didnt work.:~$ mount | grep media /dev/sdb1 on /media/HD-EU2 type vfat (rw,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,fl‌​ush,uhelper=udisks) ~$ sudo umount /media/HD-EU2 ~$ sudo fsck.vfat -a -l /dev/sdb1 dosfsck 3.0.12, 29 Oct 2011, FAT32, LFN There are differences between boot sector and its backup. Differences: (offset:original/backup) 65:03/00 Not automatically fixing this. Got 21192192 bytes instead of 122065204 at 122081792 I'll keep it as a backup at least I can copy images thanks –  user202350 Oct 14 '13 at 17:29
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.