To mount a newly added disk in Ubuntu 20.04.6, follow these steps:
1. Identify the Disk
Use the lsblk
or fdisk
command to list available disks and partitions
Step 2: Format the Disk
If the disk is new and empty, format it with the ext4 filesystem:
sudo mkfs -t ext4 /dev/sdb
Step 4: Mount the Disk
Mount the disk to the newly created directory:
sudo mount /dev/sdb /backup
Step 5: Verify that the disk is mounted:
df -h
Step 6: Make the Mount Persistent
Backup the fstab
file:
sudo cp /etc/fstab /etc/fstab.orig
Edit the fstab
file:
sudo nano /etc/fstab
Replace /dev/sdb
with the UUID in /etc/fstab
:
UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx /mnt/disk1 ext4 defaults 0 2
Step 6: Find the UUID for each disk:
sudo blkid
Before Reboot check everything is ok
Test the Configuration
To ensure there are no errors in the configuration, run:
sudo mount -a
Verify the Mount
Check that the disk is mounted:
df -h
Unmount All Disks:
sudo umount /backup
Remount All Disks:.
sudo mount -a
Verify the Mounts Again:
df -h
If all checks pass, you can confidently reboot the system:
reboot