Skip to content

Instantly share code, notes, and snippets.

@TornadoRadon
Created October 7, 2024 05:24
Show Gist options
  • Save TornadoRadon/3847e59578134b7df37b4380788cb76e to your computer and use it in GitHub Desktop.
Save TornadoRadon/3847e59578134b7df37b4380788cb76e to your computer and use it in GitHub Desktop.
Format and Mount disk (block volume)
## view connected disks (block volume).
lsblk
## format disk, change path if needed.
mkfs.xfs /dev/sdb
## prepare mounting folder.
mkdir -p /mnt/vol1
## alter fstab config, it makes mounting consistent across reboots.
## don't forget to change mounting device and path.
## nofail option makes mounting soft, so, OS can run even mounting fails.
echo "/dev/sdb /mnt/vol1 xfs defaults,_netdev,nofail 0 2" >> /etc/fstab
## reload systemctl, it must renew changes from fstab.
systemctl daemon-reload
## mount volume from fstab
mount -a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment