[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)



HI,

On Sat, Jan 17, 2009 at 05:38:02PM -0600, 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

That is device name by ID.  There is also by LABEL entry.
 
> I'd like to say:
> 
>   $ mount /mnt/backup
> 
> The latter works for whichever is specified first in /etc/fstab, but not
> the other one.

You set LABEL to the same one.  Then /dev/disk/by-label/* should be the
same for both.  LABEL can be set for FAT system using mlabel command
from mtools package.  (Or MS-DOS label command)

No need to have custome script executed from shell.  Even Desktop icon
of GNOME are the same!

> 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?

Yes.

Also if you still want to have different label, you can still create
single device name alias for both device using custom udev script.

See files in /etc/udev/rules.d/ specially 60-persistent-storage.rules .

Osamu


Reply to: