Last active
August 29, 2015 13:56
-
-
Save johngrimes/8838703 to your computer and use it in GitHub Desktop.
Format and mount a new filesystem in Linux
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
# Get the device identifier of the device, which is the one that currently does not have a valid partition table. | |
fdisk -l | |
# Use fdisk to create a new primary Linux partition, which takes up all of the available space. | |
fdisk /dev/sdb | |
# Make a new ext4 filesystem within the new partition. | |
mkfs -t ext4 /dev/sdb1 | |
# Get the UUID of the new filesystem. | |
blkid /dev/sdb1 | |
# Add a new line to /etc/fstab (see other file). | |
vim /etc/fstab | |
# Mount the new filesystem. | |
mount /data | |
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
UUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX /data ext4 errors=remount-ro 0 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment