1

I'm having the problem described here. But in my case the drive in question is already mounted, yet the link to something on that drive is broken. I never mounted the drive manually, yet it's mounted. It's not in /etc/fstab either, so I guess it was maybe mounted by udisks. If I follow the advice in this answer to the above question, I'm afraid that both /etc/fstab and udisks will try to mount to the same place, resulting in problems.

Also, since the drive in question is present in /etc/mtab, I'm tempted to simply copy its line into /etc/fstab instead of trying to construct the correct line myself.

Is it safe to simply copy that line from /etc/mtab into /etc/fstab and not worry about other services like udisks attempting to mount into the same dir?

2 Answers2

0

You could copy the line to fstab; the disk should then not be mounted by any automgic system. But especially for (removeable) external disks you should be aware that the drive's device may change (/dev/sdb, /dev/sdc, ...) depending on other storage devices being mounted before. So to be sure you'ld have to change e.g. /dev/sdb (in mtab) to the disk label (/dev/disk/by-label/LABEL) if this is unique, or the UID of the disk (UID=...).

You did not clarify what links are broken, so it is difficult to help. Maybe you could show where the link points to (ls -l) and give the output of df and/or mount.

ridgy
  • 2,356
0

Copying the line from mtab to fstab broke my Linux (I could no longer log in except in a recovery console, until I restored the backup of fstab).

What worked great, however, was the following:

  1. ran gnome-disks
  2. selected the drive in question on the left
  3. selected the partition in question on the right
  4. pressed the "gears" icon
  5. selected "edit mount options"
  6. disabled "Automatic mount options"
  7. pressed OK and rebooted

This did put whatever was necessary into fstab for me so I didn't have to.

Note: between steps 6 and 7 I also added a mounting option I needed, in the unnamed field under "Symbolic icon name" and above "Mount Point". This is irrelevant to this question, except that it may be what caused gnome-disks to put the entry in fstab, so I'm mentioning it just in case.