Skip to content

Instantly share code, notes, and snippets.

@igavelyuk
Last active October 19, 2021 01:05
Show Gist options
  • Save igavelyuk/39547ed6d759110d94d7b3e73ee06b7b to your computer and use it in GitHub Desktop.
Save igavelyuk/39547ed6d759110d94d7b3e73ee06b7b to your computer and use it in GitHub Desktop.
HDD-LINUX.TUTOR.md

Add new disk to installed Linux server

1.Step

Installing parted for creating partition and align it and connecting HDD

sudo apt-get install parted
sudo fdisk -l

if fdisk -l not show new disk - rebooting system

Starting parted sudo parted select select device print show devices if need use print one more time for extended info rm 1 remove first partition mkpart hd ext4 1024KiB Actial_Size_MB/GB align

After it create partition and align use quit

2.Format it

mkfs.ext4 /dev/sdb1

3.Step - add to fstab to use in next boot

  1. Create partition to mount /var/www/hdd
  2. find UUID sudo blkid
  3. Append UUID to fstab 1. sudo blkid | sudo tee -a /etc/fstab 2. comment all uuids already existing from bottom 3. write proper format /etc/fstab
    • UUID***-- /var/www/hdd ext4 errors=remount-ro 0 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment