Last active
December 2, 2019 03:17
-
-
Save madsonic/8bd29ff943caadcbc920e1eda9dcb91e to your computer and use it in GitHub Desktop.
volume modification
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
# see existing filesystem | |
# if no fs, 'data' will be shown | |
sudo file -s /dev/xvdf | |
# make fs | |
mkfs.ext4 /dev/sdb | |
mkdir /mnt/a | |
# mount it onto a directory | |
mount /dev/sdb /mnt/a | |
# get block UUID for fstab | |
blkid | |
# or use fstab for automated mount | |
# that will persist restarts | |
# edit /etc/fstab | |
# then run mount -a | |
#<device> <dir> <type> <option> <dump> <fsck> | |
/dev/sdb /mnt/a ext4 defaults,discard 0 0 |
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
# list block device | |
lsblk | |
# disk usage | |
df -h | |
# when growing, it is important to grow the partition first before resizing the filesystem | |
# grow partition | |
growpart <partition> <partition number> | |
# extend the file system | |
resize2fs <volume> | |
# when shrinking, do the opposite, resize then shrink partition | |
resize2fs <volume> <size> | |
# remap partition | |
parted resizepart <number> <end> |
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
https://wiki.archlinux.org/index.php/Fstab | |
https://wiki.archlinux.org/index.php/Parted | |
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-using-volumes.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment