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

Re: mounting two disks on the same mount point (not at the same time)



Reid Priedhorsky wrote:
I have a couple of USB disks that I use for backups. I rotate them so only
one is attached at the same time. I have a nightly cron that mirrors the
directories of interest onto whichever one is attached using rsync.

I'd like to mount whichever one is attached at the same mount point,
without having to specify the device. For example, rather than:

  $ mount /dev/disk/by-id/usb-ST316002_1A_DEF107679C83-0:0-part1 /mnt/backup

I'd like to say:

  $ mount /mnt/backup

The latter works for whichever is specified first in /etc/fstab, but not
the other one.

They are both *usually* the only USB disk attached, so they both appear as
/dev/sdc1, but I don't really want to depend on that.

Is this possible?

Give the same label to both the disks. And add the line to mount by label in the fstab, like:

LABEL=NIGHTLY_BACKUP_DRIVE /mnt/backup ...


Thanks,

Reid




--

If you can't explain it simply, you don't understand it well enough.
                                       -- Albert Einstein


Reply to: