[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#509378: should use labels for all partitions in fstab

Colin Watson wrote:
On Sun, Dec 21, 2008 at 08:15:55PM +0000, Daniel Pocock wrote:
I believe it would be much safer to use labels for partitions rather than using the device nodes.

Automatically assigning labels is a really, really bad idea. Red Hat
tried this and the result was that if you did two Red Hat installations
on the same machine then they would get terribly confused on boot as
there would be two filesystems with LABEL=root. I spoke to the Anaconda
That is why my earlier email proposed that we check for duplicates before creating fstab - however, I'm not saying it's a perfect solution.

Of course you could try to generate universally unique labels, but this
is a bit silly when we already have UUIDs. Labels should be reserved for
assignment by the system administrator.
That is a reasonable argument - in this case, d-i may need to force the user to specify (or agree to) a set of labels.

I absolutely think that we should be using UUIDs by default for devices
where there isn't some other stable naming, as Ubuntu does.
I think this is reasonable too, as long as we deal with the fstab issues.
Note that pretty much every naming system has its downsides:

  * Traditional device names

    Fail when devices are enumerated in a different order at boot, or
    when the kernel changes device naming (e.g. IDE -> libata).

With removable disks becoming more common, this is going to become more of an issue.
  * Labels

    Good when assigned manually by the system administrator, but
    assigning automatically is fraught with problems. Bit-for-bit
    filesystem copies will preserve the label, which is fine for backup
    and restore but can have surprising results. If you have to
    reconstruct a filesystem during disaster recovery you need to
    remember to reset the label too (or adjust /etc/fstab).

Maybe we can create a hidden file in each filesystem to provide a clue about where it was mounted?

IMO the best answer is to use UUIDs by default, but use labels if they
are manually set during installation. This way people who don't care can
have it just work, and people who care can set labels. In Ubuntu we put
a comment above the UUID in /etc/fstab with the original traditional
device name for the device in question, which is often a useful

The only solution I can see is for d-i to enforce the use of labels for /boot and other non-LVM filesystems. Using the labels with LVM filesystems would be nice but not essential.

I think it's best to use the LVM names for LVM filesystems, since they
already form a stable naming scheme.

This is all fine for me, with the additional possibility that we create a hidden file (maybe .debian-mount or something) to provide a clue about where to mount when re-constructing fstab. It would be nice if such information could be kept in filesystem metadata, but the label field is only quite small.

Reply to: