Linux - NewbieThis 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!
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.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I have a flash drive formatted as FAT32 with my data on it. I copied all my photos from it but realized that the permissions are totally garbled: the flags say "????????" and some of them even say "Permission Denied". Because there is no owner specified, I cannot run chmod.
How to fix this?
(and I am really considering to reformat the flash drive to a Linux filesystem now)
It does sound like the filesystem is damaged. By the way, you can't use chmod or chown for fat32, but you can for files you copied to a linux partition.
First eject the flash drive and then reinsert it. Maybe it will mount properly.
You can also attempt a repair.
I'd recommend using dd or ddrescue to create an image file of the flashdrive. Then run "/sbin/fsck.vfat <imagefile>" to try to repair it. You might want to create a copy of the image file and work on the copy. That way, if you cause damage to the file, you can delete it and make another copy.
If this doesn't work, you could use "testdisk" to try to recover files from the image.
FYI. For a vfat filesystem, you can use the fmask options when mounting the drive. This sets the permissions of all of the files on the (mounted) filesystem. You are correct that you loose linux ownership, groups & permissions when copying files to a fat32 filesystem. You can use tar to backup your pictures on a fat32 filesystem. Then when restoring them onto a Linux filesystem, you will restore the permissions as well.
If you still see question marks after formatting the flash drive, your drive is bad and should be replaced.
For a flash drive, you may want to mount it using the "noatime" option to reduce the number of writes.