Skip to content

Instantly share code, notes, and snippets.

@arnabdas
Created March 3, 2022 08:50
Show Gist options
  • Save arnabdas/596d072d8ef4caa51941771277a36564 to your computer and use it in GitHub Desktop.
Save arnabdas/596d072d8ef4caa51941771277a36564 to your computer and use it in GitHub Desktop.
Ubuntu Add Disk
ls /dev/sd*
fdisk /dev/sdb # check the label from above
# p - show current partitions
# d - delete current partitions
# n - create new partition
# p - select for default partition
# 1 - for single partition
# w - write partitions
# format with ext4 file-system
mkfs -t ext4 /dev/sdb1
# create mount point
mkdir /data
blkid # note UUID for the new partition
# add following in /etc/fstab
# UUID="b851..." /data ext4 defaults 0 2
mount -av
# check added disk
df -h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment