Skip to content

Instantly share code, notes, and snippets.

@mahmoud-eskandari
Last active July 1, 2020 14:04
Show Gist options
  • Save mahmoud-eskandari/7fb684e64553a536ed3f0ba567a38547 to your computer and use it in GitHub Desktop.
Save mahmoud-eskandari/7fb684e64553a536ed3f0ba567a38547 to your computer and use it in GitHub Desktop.
Mount a new disk to linux
sudo -i
# example sda
lsblk >> get list of partitions
fdisk /dev/sda
>> New Partition
n
>> Partition number (X-28)
Ex: 4
>> First sector ...
ex: just Enter
>> Last sector, ...
+NG(+80G)
OR
enter sector
Default equal remaining size
>>
w
q
(find UID in outpu)
Format: ext4
mkfs.ext4 /dev/sda4
_> UID
blkid /dev/sda4
ex:
/dev/sda4
---- Mount
vi /etc/fstab
/dev/disk/by-uuid/{UID} {FOLDER} ext4 defaults 0 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment