Ubuntu – USB drive partitions change randomly on boot

12.04hard drivemountpartitioning

Having a really strange problem with USB drives. I have 2x5TB USB drives and during each reboot the partitions change randomly. Below is the output from lsblk

enter image description here

the two drives USB drives are (sdb and sdc). Sometimes when the computer boots sdb has sdb1 (128MB) and sdb2 (4.6TB), other times sdb will only have sdb1 (4.6TB) and sdc will have the 2 partitions. Below is the output from parted

enter image description here

I'm not sure why the drives are switching back and forth on that second 128MB partition. It's causing problems with using fstab to mount the drives.

Best Answer

One way I found to solve this problem is to use the UUIDs, create a mount point for my USB drive and add a listing to the /etc/fstab file so the USB drive is mounted the same every time on boot up.

I have a Seagate 3TB External USB, so this is what I did:

First, created a mount point for the Seagate drive:

Create one mount point for each partition you want to mount.

sudo mkdir -p /media/Seagate_p1

Then I obtained the UUID for the Seagate partition(s):

NOTE: UUIDs do not change unless the partition gets re-created and / or reformatted.

sudo blkid


terrance@terrance-ubuntu:~$ sudo blkid
/dev/sda1: LABEL="Seagate Backup Plus Drive" UUID="6AAA4323AA42EB61" TYPE="ntfs"

Added UUID entry to /etc/fstab:

UUID=6AAA4323AA42EB61 /media/Seagate_p1 ntfs default,nofail 0 0 

Now, every time my system boots the Seagate drive is always mounted at the same mount point. However, the drive designations are not always the same, i.e. /dev/sda1 now but next reboot is /dev/sdc1. So using the UUIDs makes it so the mount points are always the same regardless.

Hope this helps!

Related Question