I’m using my Ubuntu install on a mini PC with the main function being hosting a media server. I have an external hard drive that I’m using to store my media that is always plugged in, but I want to option of being able to eject and use elsewhere occasionally.
I have set up the external drive to it auto-mounts to dev/sdb2/MediaDrive via both fstab (with UUID) and the Disks app. However, at random, it will seemingly unmount and remount at dev/sdb2/MediaDrive1. The PC is always on and doesn’t restart or anything when this happens.
This causes problems with my media server as it is pointed at the first address, so I get errors and myself and friends/family are unable to watch my media remotely. Usually a system update and restart fixes this problem temporarily and the drive re-mounts again in the correct spot, but I’d like a permanent solution so my drive stays mounted.
What I’ve Tried
From finding other posts about this issue online, I changed the mount location (was originally in user media folder), added UUID to fstab and updated Disks app to reflect the auto-mount settings I wanted.
Any ideas that can solve this problem once an for all?
If you do an online search for the problem, you will find the most common reason for it is not properly unmounting before trying to remount a partition. Post the actual line entry from fstab as what you posted ‘dev/sdb2/MediaDrive’ could not possible work as a mount point. Is the device/partition you are using /dev/sdb2? Where did you create the mount point ‘MediaDrive’? Ubuntu will generally mount an external drive/partition under /media/username/UUID but the mount point can be set by the user.
Does this happen randomly? It would not be surprising if it happened when you remove the drive without properly unmounting and then attaching it again so what is the situation?
Unmounting and and remounting in a different directory sounds like an intermittent loss of connection to me. Could be a problem with either the cable or the connector, either on your PC or the drive. Try a different cable or an other USB socket on the PC.
Yes, the partition is sdb2. I will share the full fstab line in a few days but am away from this device at the moment.
Yes, the original mount point was /media/username/[name of drive] but I reconfigured to this new mount point as suggested on other posts where users had similar problems.
Do I need to always unmount before performing a restart? Thanks.
If it is a rotary disk drive you might need external power or a Y shaped USB cable (with two USB-a plugs on one side to provide twice the USB port power)
If you are booted into Ubuntu and restart/reboot the computer into Ubuntu you do not need to unmount or mount if you have a proper entry in fstab. You do need to unmount before unplugging the drive while the system is booted. What you posted above would mean you have a mount point of /MediaDrive in the / (root) of the system partition. The entry in fstab would need to be exactly what the mount point is, case matters so /Mediadrive would not work nor would /mediadrive.