Install Config Wiki

All about installing, configuring and troubleshooting

User Tools

Site Tools


auto_mount_external_drive_at_startup_ubuntu_server_22_04

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
auto_mount_external_drive_at_startup_ubuntu_server_22_04 [2023/07/19 18:50] wikiadminauto_mount_external_drive_at_startup_ubuntu_server_22_04 [2023/07/19 19:50] (current) wikiadmin
Line 1: Line 1:
 ====== Auto Mount External Drive at Startup in Ubuntu Server 22.04 ====== ====== Auto Mount External Drive at Startup in Ubuntu Server 22.04 ======
 +
 +**I AM NOT TAKING ANY CHANCES OF MOUNTING ANYTHING. THERE IS A 2TB HARDWARE RAID-1 MIRROR THAT IS MOUNTED, AND I DON'T WANT THE 4TB USB SSD DRIVE TO CONFLICT WITH THAT WHEN THE SYSTEM REBOOTS. IT APPEARS THAT UBUNTU IS SWITCHING THE MOUNTS OF THE /SDA AND THE /SDB AFTER A REBOOT.**
 +
 +However, I will keep the documentation below until such time as I figure out how to do this without any conflicts, and amend the entire process accordingly.
  
 See: [[https://developerinsider.co/auto-mount-drive-in-ubuntu-server-22-04-at-startup/]] See: [[https://developerinsider.co/auto-mount-drive-in-ubuntu-server-22-04-at-startup/]]
Line 173: Line 177:
 </code> </code>
  
 +Run the Fdisk again:
 +
 +<code>
 +sudo fdisk -l
 +</code>
 +
 +Disk /dev/loop0: 111.95 MiB, 117387264 bytes, 229272 sectors
 +Units: sectors of 1 * 512 = 512 bytes
 +Sector size (logical/physical): 512 bytes / 512 bytes
 +I/O size (minimum/optimal): 512 bytes / 512 bytes
 +
 +
 +Disk /dev/loop1: 53.26 MiB, 55844864 bytes, 109072 sectors
 +Units: sectors of 1 * 512 = 512 bytes
 +Sector size (logical/physical): 512 bytes / 512 bytes
 +I/O size (minimum/optimal): 512 bytes / 512 bytes
 +
 +
 +Disk /dev/loop2: 53.26 MiB, 55844864 bytes, 109072 sectors
 +Units: sectors of 1 * 512 = 512 bytes
 +Sector size (logical/physical): 512 bytes / 512 bytes
 +I/O size (minimum/optimal): 512 bytes / 512 bytes
 +
 +
 +Disk /dev/loop3: 63.45 MiB, 66527232 bytes, 129936 sectors
 +Units: sectors of 1 * 512 = 512 bytes
 +Sector size (logical/physical): 512 bytes / 512 bytes
 +I/O size (minimum/optimal): 512 bytes / 512 bytes
 +
 +
 +Disk /dev/loop4: 63.45 MiB, 66531328 bytes, 129944 sectors
 +Units: sectors of 1 * 512 = 512 bytes
 +Sector size (logical/physical): 512 bytes / 512 bytes
 +I/O size (minimum/optimal): 512 bytes / 512 bytes
 +The backup GPT table is corrupt, but the primary appears OK, so that will be used.
 +
 +
 +Disk /dev/sda: 3.81 TiB, 4194304000000 bytes, 1024000000 sectors
 +Disk model: UDisk
 +Units: sectors of 1 * 4096 = 4096 bytes
 +Sector size (logical/physical): 4096 bytes / 4096 bytes
 +I/O size (minimum/optimal): 4096 bytes / 4096 bytes
 +Disklabel type: gpt
 +Disk identifier: AB3F7F29-78F9-46D2-90C7-B2FC88C5E922
 +
 +Device     Start        End    Sectors  Size Type
 +/dev/sda1      6       4095       4090   16M Microsoft reserved
 +/dev/sda2   4096 1023999993 1023995898  3.8T Microsoft basic data
 +
 +
 +Disk /dev/sdb: 1.82 TiB, 1999844147200 bytes, 3905945600 sectors
 +Disk model: Virtual Disk
 +Units: sectors of 1 * 512 = 512 bytes
 +Sector size (logical/physical): 512 bytes / 512 bytes
 +I/O size (minimum/optimal): 512 bytes / 512 bytes
 +Disklabel type: gpt
 +Disk identifier: 299F1292-7D64-4846-83BD-CF8BD5034D74
 +
 +Device       Start        End    Sectors  Size Type
 +/dev/sdb1     2048       4095       2048    1M BIOS boot
 +/dev/sdb2     4096    4198399    4194304    2G Linux filesystem
 +/dev/sdb3  4198400 3905943551 3901745152  1.8T Linux filesystem
 +
 +
 +Disk /dev/mapper/ubuntu--vg-ubuntu--lv: 1.82 TiB, 1997692469248 bytes, 3901743104 sectors
 +Units: sectors of 1 * 512 = 512 bytes
 +Sector size (logical/physical): 512 bytes / 512 bytes
 +I/O size (minimum/optimal): 512 bytes / 512 bytes
 +</code>
 +
 +So, this part of the above results looks like the external USB SSD drive we want to mount, and automount:
 +
 +<code>
 +Disk /dev/sda: 3.81 TiB, 4194304000000 bytes, 1024000000 sectors
 +Disk model: UDisk
 +Units: sectors of 1 * 4096 = 4096 bytes
 +Sector size (logical/physical): 4096 bytes / 4096 bytes
 +I/O size (minimum/optimal): 4096 bytes / 4096 bytes
 +Disklabel type: gpt
 +Disk identifier: AB3F7F29-78F9-46D2-90C7-B2FC88C5E922
 +
 +Device     Start        End    Sectors  Size Type
 +/dev/sda1      6       4095       4090   16M Microsoft reserved
 +/dev/sda2   4096 1023999993 1023995898  3.8T Microsoft basic data
 +</code>
 +
 +It does not specify that this USB SSD Drive is exFat, but I know it to exFat by connecting it to a Windows system and looking at its format.  
 +
 +I believe that we need to mount /dev/sda2 which is the 4TB (3.8TB) external USB SSD drive.  And it appears that the Disk Identifier is: 
 +
 +<code>
 +AB3F7F29-78F9-46D2-90C7-B2FC88C5E922
 +</code>
 +
 +**BEWARE THERE ARE MIXED READINGS NOW!
 +
 +LOOK AT THIS BELOW AND COMPARE
 +**
 +<code>
 +lsblk -o NAME,FSTYPE,UUID,MOUNTPOINTS
 +</code>
 +
 +Results:
 +
 +<code>
 +NAME                      FSTYPE      UUID                                   MOUNTPOINTS
 +loop0                     squashfs                                           /snap/lxd/24322
 +loop1                     squashfs                                           /snap/snapd/19457
 +loop2                     squashfs                                           /snap/snapd/19361
 +loop3                     squashfs                                           /snap/core20/1950
 +loop4                     squashfs                                           /snap/core20/1974
 +sda
 +├─sda1
 +└─sda2
 +sdb
 +├─sdb1
 +├─sdb2                    ext4        94e62aba-77a5-45db-a9ba-ca358fa589df   /boot
 +└─sdb3                    LVM2_member hXjBKC-htj8-a0Zn-El2e-C3Jk-Y24f-e3S0bN
 +  └─ubuntu--vg-ubuntu--lv ext4        0d6b481f-ec40-4951-b6d7-76ba4cde2dfb   /
 +sr0
 +
 +</code>
  
 +**I AM NOT TAKING ANY CHANCES OF MOUNTING ANYTHING.  THERE IS A 2TB HARDWARE RAID-1 MIRROR THAT IS MOUNTED, AND I DON'T WANT THE 4TB USB SSD DRIVE TO CONFLICT WITH THAT WHEN THE SYSTEM REBOOTS.  IT APPEARS THAT UBUNTU IS SWITCHING THE MOUNTS OF THE /SDA AND THE /SDB AFTER A REBOOT.
 +**
  
auto_mount_external_drive_at_startup_ubuntu_server_22_04.1689792648.txt.gz · Last modified: 2023/07/19 18:50 by wikiadmin