AWS Elastic Block Storage contd…
- File Systems on Linux:
- xfs
- ext4
- Finding the block devices (hard disks)
sudo lsblk
Refer Here
- To create a file system
sudo mkfs -t xfs <path of block device>
- Create a new folder
sudo mkdir /additional
- Mount the disk to folder
sudo mount <block device path> /additonal
- Lets create some files
- Create an ec2 instance with ubuntu os. While creating add a volume of size 1GiB. Find the block device name. Create a filesystem and mount to
/additonal
and executesudo df -h
- After this is done. Attach a new voluem of size 1 GiB and mount it to folder
/tools
and executesudo df -h
- Restart the ec2 instance and execute
sudo df -h
- After restart linux doesn’t remember the mounts
- To make this work we need to add entries in a file
/etc/fstab
- Lets add entries to /etc/fstab
sudo blkid
* Add the following entries to /etc/fstab
UUID=<uuid-from-blk-id> /additional xfs defaults,nofail 1 2
* Figure out how to bring in the expanded disk size into linux mounts