Mounting a Drive on a Linux System

sda can be sdb or mmlocm or whatever.

  1. lsblk and fdisk -l to get info
  2. If there isn't a numbered /dev/sda1, it isn't partitioned, do step 3.
  3. Partitioning: fdisk is old (MBR tables), gdisk is newer and better (GPT tables). This wipes contents btw.
  4. Make a filesystem: mkfs.ext4 /dev/sda1
  5. Testing: sudo mount /dev/sda1 /mnt
  6. If you're going to mount somewhere with existing data, right now you want to copy the contents to /mnt, potentially back them up somewhere else, and them delete the original data that you're going to mount over
  7. sudo umount /dev/sda1
  8. sudo mount /dev/sda1 <wherever>
  9. To make this happen automatically at boot, edit fstab
  10. Get UUID with blkid
  11. To make mounting happen on boot, add a line to etc/stab with the following format (spaces or tabs separating):
  12. UUID="<insert>" <mountpoint> <fstype(ext4?)> defaults,nofail 0 (1 if /, 2 if anything else)