Skip to content

Instantly share code, notes, and snippets.

@naviocean
Last active October 31, 2018 04:08
Show Gist options
  • Save naviocean/7eab252a553d260dd6afad9cbd4aec62 to your computer and use it in GitHub Desktop.
Save naviocean/7eab252a553d260dd6afad9cbd4aec62 to your computer and use it in GitHub Desktop.
Mount HDD on ubuntu

First of all your /dev/sdb isn't partitioned. I am assuming this is the disk you want to mount. Run 

sudo fdisk /dev/sdb
  1. Press O and press Enter (creates a new table)

  2. Press N and press Enter (creates a new partition)

  3. Press P and press Enter (makes a primary partition)

  4. Then press 1 and press Enter (creates it as the 1st partition)

  5. Finally, press W (this will write any changes to disk)

  6. Run 
sudo mkfs.ext4 /dev/sdb1

  1. Now you can add it to fstab
You need to add it to /etc/fstab use your favourite text editor

  2. Get UUID:
sudo vol_id --uuid /dev/sdb

or

sudo blkid
  1. add to /etc/fstab
UUID={YOUR-UID}   /mnt/hdd ext4 defaults     0  2
  1. remount
sudo mount -a
  1. set permsion
sudo chown aitlvn.aitlvn /mnt/hdd
sudo setfacl -d -m g::rwx /mnt/hdd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment