4

I have external USB HDDs that are used for backing up data and that rotate over months. Only one of the disks is present at the same time.

The disks have different UUIDs (yes, it is possible to clone it, but I would try without).

/etc/fstab looks like

UUID=e4281b1d-44e9-441d-9158-2b6f26beafaf /media/backup ext4 defaults,nofail,x-systemd.device-timeout=1s 0 1
UUID=7e5038f3-e44a-4413-a5ea-ef8e8cdf725c /media/backup ext4 defaults,nofail,x-systemd.device-timeout=1s 0 1

If the only first disk is present it works fine. If only the second disk is present it does not work with sudo mount -a -v or restarting the system.

What really irritates me is that if only the second device is present after a restart, sudo mount -a -v states that the HDD is already mounted, but it does not show up if I use mount.

If I comment the first device in /etc/fstab like

# UUID=e4281b1d-44e9-441d-9158-2b6f26beafaf /media/backup ext4 defaults,nofail,x-systemd.device-timeout=1s 0 1
UUID=7e5038f3-e44a-4413-a5ea-ef8e8cdf725c /media/backup ext4 defaults,nofail,x-systemd.device-timeout=1s 0 1

it works as expected on restart or sudo mount -a -v and mount shows the device as

/dev/sda1 on /media/backup type ext4 (rw,relatime)

I have no clue what the reason could be. Do you have ideas?

I saw this solution that mentions a possible solution with udev, but if possible, I would like to avoid this: Mounting alternate devices (with different mount options) at the same mount point

3
  • Have you consider to use device name /dev/sda1 instead of UUID? Commented Feb 20, 2022 at 6:51
  • You mean in the fstab? I tried sudo mount /dev/sda1 /media/backup/ it on the command line but that did not work. Will try that in the next days.
    – Joe
    Commented Feb 20, 2022 at 7:18
  • Yes, in /etc/fstab. And execute the command when you have attached removable disk Commented Feb 20, 2022 at 7:42

1 Answer 1

2

As a quick workaround for a single backup mount (using any physicall disk) I give them all the same LABEL and use LABEL=xxx in fstab. So there is only ONE entry in fstab.

For tracking pourposes I have an spreadsheet with the UUIDs and the hand written name in the disk to know where and when I mounted the disk and which disk I am really using.

LABEL=my_generic_backup_disk /media/backup ext4 defaults,nofail,x-systemd.device-timeout=1s 0 1

2
  • That's a very good approach, will try that in the next days.
    – Joe
    Commented Feb 21, 2022 at 5:07
  • Works like a charm. Thanks.
    – Joe
    Commented Feb 26, 2022 at 16:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .