1. Create the mount point (if it doesn’t exist)
2. Check if the disk is already partitioned
Look for /dev/sdb
or /dev/sdb1
.
If it's unpartitioned, you can format the entire disk (/dev/sdb
).
If it's already partitioned (e.g., /dev/sdb1
), use that instead.
3. (Optional) Partition the disk (if needed)
If /dev/sdb
is raw, partition it:
-
Press
n
new partition -
Press
p
primary -
Accept defaults
-
Press
w
write and exit
Then run:
4. Format the partition (ext4)
Replace
sdb1
with your actual partition (or usesdb
if not partitioned):
5. Mount it to /data
6. Make the mount permanent (optional)
To mount the disk at boot, add it to /etc/fstab
.
echo "UUID=$(blkid -s UUID -o value /dev/sdb1) /data ext4 defaults 0 2" | sudo tee -a /etc/fstab
Before You Reboot:
Always test the fstab mount manually to make sure it's correct:
If no errors appear, your fstab entry is valid.