Skip to content

Instantly share code, notes, and snippets.

@morgangiraud
Last active July 21, 2016 08:54
Show Gist options
  • Save morgangiraud/23780b5c5322dcb4e42831b0d29a6907 to your computer and use it in GitHub Desktop.
Save morgangiraud/23780b5c5322dcb4e42831b0d29a6907 to your computer and use it in GitHub Desktop.
Handling disk and filesystem on ubuntu
# List all block device with diverse information
sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL
# Managing partition
sudo fdisk /dev/sdx # MBR mode, the old way. Can't handle more than 2T
sudo gdisk /dev/sdx # the new way
# Format the drive with the filesystem type you want
# This is when a UUID is created
sudo mkfs -t ext4 /dev/sdx
# Grab UUID of all drives
sudo blkid
# Edit fstab to make your system aware of those drives
# fstab is the file used by linux to mount drives at startup
sudo vim /etc/fstab
# Mount all drives defined in /etc/fstab
sudo mount -a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment