Re: Backing up FAT Partitions

From: Peter Samuelson (peter@cadcamlab.org)
Date: Sun Apr 09 2000 - 20:27:15 EST


  [me]
> > You're still missing the "System" flag
[Matthias Schniedermeyer]
> UPS. Type-Error not "Hidden & Restore" "Hidden & System" is right. :-)

Well, there are four. I assumed by "restore" you meant the archive
flag. I don't remember if that's exposed by the current FAT
implementation. If not, I guess you want VTXT or something. Oh, and
there's also the bit that states that the file is actually only a
volume label. That only occurs once per filesystem, however. (Well,
I've never tried it -- what happens if you have two volume labels?)

> In my Case the Volume-Label is copied with the boot-sector, that i copy too.

How do you copy the boot sector from a mounted volume? Are you saying
you *already* go behind the filesystem's back and read the raw
partition?

And I'm not sure if the volume label stored in the boot sector is
necessarily the same as the volume label stored in the root directory
(see above). It's been too long since I played with raw disk editors
under DOS.

> In my case i don't have any problems with short-/long names. As it is
> DOS 6.22 without any Winblow

OK.

> But when we are at that point. The "Backup" mount-option could be
> used to change the way long-names are represented. FAT/VFAT don't
> have symlinks. So you could save the file with it's short name and
> let the long-name be a symlink to the short-name. This way you could
> save BOTH names.

You are NOT going to get THAT past the people who matter. It's been
brought up several times before, and the general conclusion is that the
symlinks (or hard links; that's been thought of too) have semantics far
too different from VFAT aliases. On real filesystems you can create,
delete, rename and move symlinks independent of what they point to. On
VFAT you would have to emulate just the small subset of the above which
could sensibly map to long-name aliases, and return errors to any
process trying to do anything else. Which would be VERY tricky to get
right, and fraught with race conditions. And assuming you COULD get it
right, it wouldn't be obvious from userspace exactly what is and isn't
allowed. It would be a horrible tangle.

Another idea that comes up from time to time is to allow a fcntl() or
something by which a userspace backup program could ascertain the
current short filename for a given file. That might actually make some
sense, though it still looks pretty ugly.

> > My advice: just do it in userspace with an unmounted (or read-only)
> > partition.

> The Partition is 1GB in size and about 25MB are used. It would need
> MUCH too long to copy the whole partition instead of "only" "tar"ing
> the "content".

Oh, I didn't mean `dd if=/dev/hda1 of=backup_file'!

I meant start with something like mtools and hack the necessary
functionality into it. Actually read the filesystem from userspace.
It sounds like you are already doing this with the boot sector.

Peter

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Apr 15 2000 - 21:00:13 EST