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
nnew partition -
Press
pprimary -
Accept defaults
-
Press
wwrite and exit
Then run:
4. Format the partition (ext4)
Replace
sdb1with your actual partition (or usesdbif 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.
