External Drive Partitions Don't Stay Mounted

I have an external hard drive, Western Digital 500GB (USB cable) that I recently divided into two equal partitions. When I plug it in, both partitions show up as drives in File Manager. However after a week or ten days I find that the two partitions are no longer mounted. This has happened twice. If I then unplug the drive and reconnect it, the two partitions automatically mount again. What causes them to get unmounted? Can it be that a re-boot does not re-mount them? It used to be OK when that drive was not partitioned, or had one partition (I donā€™t know which it was).

Hi Jim,
You come up with some tough ones.
Mounting of usb drives is controlled by udevā€¦ you dont put them in /etc/fstab
They are supposed to automatically mount when you plug them into a running systemā€¦ but I find that is not always the case. Sometimes I have to cold boot to get mine to mount. Not sure if reboot works, I always cold boot, and that akways works.

Now you are telling us they sometimes unmount.
I am not sure if a reboot would do thatā€¦ Best way to find out is to test it on your system

udev is a daemon. Try ps ax | grep udev and you will see it running. If it stopped , things might unmountā€¦ but why would it stop?
One thing that can mess up mounts is things getting out of order in a boot sequence. I am not sure when udev starts in the boot sequence, but if it starts very early, a warm boot might miss it.

That is about all I can think of. Test the warm boot idea. Make sure the usb cable isnt dodgy. Do a smart test on your diskā€¦

Regards
Neville

1 Like

If the USB attached disks are spinning disks maybe they go into a power save mode after some amount of time and become unmounted?

2 Likes

@nevj @pdecker Thanks for the inputs. I will do some tests and get more detail on this. I want see if it is a problem only with this one drive, and / or whether it is only with USB drives that are partitioned, or only with ā€˜mechanicalā€™ USB drives that are partitioned, or with one of my computers and not others, or restart versus power down, or udev, etc. etc. Lots of variables here! I will post an update.

1 Like

I would go with the answer of the external drives going to sleep over time so not being available unlike usb drives. Switching them off and back on should help.

2 Likes

Thats a good plan Jim.
If you can narrow down the details, we may be able to arrive ar a fix.

I have another machine that runs Ubuntu, and usually external drives get mounted to /media/username/UUID when you plug them in instead of /mnt. So while Iā€™m not sure about other distros, this is what definitely works for me in Ubuntu 23.04 :

1.) In File Explorer, right click on the external drive and select ā€œPropertiesā€.
2.) When that comes up youā€™ll see an option ā€œOpen in Disksā€ - Click on that.
3.) Click the icon that looks like a gear in the middle underneath the partition information and select ā€œEdit Mount Optionsā€
4.) More than likely, ā€œUser Session Defaultsā€ will be switched on. Switch that off, and that will enable you to check the box that says ā€œMount at system startupā€
5.) Youā€™ll likely have to do this for both partitions, but the result will be that when you start up the computer, itā€™ll automatically mount, and I believe itā€™ll actually put an entry in /etc/fstab for you.

1 Like

@Doron_Beit-Halahmi Thank you for this information. Iā€™m giving it a try. However, the problem seems to have gone away after I changed computers (still Ubuntu 23.04) and in the process re-connected both ends of the USB cable to the external drive. Unless the problem comes back, I wonā€™t be able to identify the root cause. The two partitions have been re-mounting automatically after both reboots and power downs.

2 Likes