1

I have an internal backup drive (backup1) with fstab entry to mounts to /mnt/backup. Occasionally, I unplug this drive temporarily, connect another drive (backup2) and do a secondary backup. Once done, I'll remove backup2 drive, plug in backup1 drive, that brings my system to its usual state.

My backup scripts are hard-coded to /mnt/backup, so I can connect any drive I want, mount it to /mnt/backup and backup my data.

Today I unplugged backup1, connected backup2 booted ubuntu.

  • fstab looks for backup1's UUID, not connected, but nofail flag is set, so it just skips mounting /mnt/backup.
  • No fstab entry for backup2. It's connected as /dev/sdc but no partitions mounted. Good.

I tried to mount it by mount --verbose /dev/sdc1 /mnt/backup I get a response saying that sdc1 is successfully mounted to /mnt/backup, but it's not actually. mount and lsblk don't show this mount, /mnt/backup is blank.

However, if I mount sdc1 to some other directory, like /tmp/backup, it indeed mounts. I'm only unable to mount the new drive's partition to /mnt/backup.

My questions:

  1. Is the system preventing me from mounting to /mnt/backup because fstab has entry for some other partition for that mount point?
  2. If so, how do I mount anything at /mnt/backup irrespective of what's defined in fstab?

ubuntu 16.04, linux 4.4.0-97

migrated from serverfault.com Oct 17 '17 at 10:19

This question came from our site for system and network administrators.

  • What happens when you umount /mnt/backup and then mount? – Raman Sailopal Oct 17 '17 at 11:49
  • @RamanSailopal /mnt/backup is not mounted when I'm trying this. If I run umount to make sure, it confirms that nothing is mounted at /mnt/backup. – ananth.p Oct 17 '17 at 12:04
  • If oyu execute mount -a, do you get the same behavior? – Raman Sailopal Oct 17 '17 at 13:44
  • @RamanSailopal The drive I'm trying to mount is not defined in fstab. Some other drive is defined to be mounted at /mnt/backup, but that drive is physically unplugged. I don't know what to expect with mount -a. – ananth.p Oct 17 '17 at 14:18
  • It looks like maybe the nofail flag is causing the system to assume the file system is mounted when it actually isn't. Does dmesg give you any further detail relating to the mount? – Raman Sailopal Oct 17 '17 at 14:40
0

This turned out to be a temporary issue. I was able to mount the drive in question to /mnt/backup after sometime. I couldn't attribute the resolution to any specific action from my side: I didn't alter fstab, didn't restart the computer. It should be a bug, if I'm able to reproduce the same situation, I'll try to collect more diagnostic details and add here.

So,

  1. No, system shouldn't prevent mounting a drive to a mount point just because it is defined in fstab. But this does happen sometimes. Restarting the system might help.
  2. As blocking mountpoints defined in fstab is not the standard behavior, one should be able to mount any block device to any mount point normally.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.