On Mon, Oct 3, 2011 at 11:40 AM, Grant Edwards
<grant.b.edwa...@gmail.com> wrote:
> Just recently I've run in to problems because my hard drives are not
> detected in a predictable order, so my fstab that mount /dev/sdb1 and
> /dev/sdc1 sometimes result in directory trees in the wrong places
> (/dev/sda seems consistent, but I don't know why).
>
> What's the recommended way to fix this?

You can set labels to all the partitions, and set /etc/fstab to use
them: my fstab looks like:

LABEL=Gentoo    /               ext4            noatime                 0 1
LABEL=Swap      none            swap            sw                      0 0
shm             /dev/shm        tmpfs           nodev,nosuid,noexec     0 0
tmpfs           /tmp            tmpfs           defaults,nosuid         0 0

I believe this is the recommended way to use fstab in distros like
Fedora and OpenSUSE, because of your use case exactly.

You can set labels to ext[234] partitions with e2label, and for NTFS
partitions you can use ntfslabel, and to swap partitions with mkswap.
I suppose every filesystem in the world has a similar tool to set its
label.

Regards.
-- 
Canek Peláez Valdés
Posgrado en Ciencia e Ingeniería de la Computación
Universidad Nacional Autónoma de México

Reply via email to