Created
October 7, 2024 05:24
-
-
Save TornadoRadon/3847e59578134b7df37b4380788cb76e to your computer and use it in GitHub Desktop.
Format and Mount disk (block volume)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 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