ubuntu@ip-xxx-31-xx-xx:~$ sudo mkfs -t ext4 /dev/xvdf mke2fs1.42.9 (4-Feb-2014) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 1310720 inodes, 5242880 blocks 262144 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=4294967296 160 block groups 32768 blocks per group, 32768 fragments per group 8192 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000
Allocating group tables: done Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done
Last is to mount it to /storage(it can be any path you like)
Edit the file /etc/fstab(you may use nano if you’re not familiar with vim)
Remember to backup before edit the file
1 2
ubuntu@ip-xxx-31-xx-xx:$ sudocp /etc/fstab /etc/fstab.orig ubuntu@ip-xxx-31-xx-xx:$ sudo vim /etc/fstab
Update the content
1 2
LABEL=cloudimg-rootfs / ext4 defaults,discard00 <------ THIS IS THE DEFAULT LINE /dev/xvdf /storage ext4 defaults 00
Now create a folder for that new disk volume
1
ubuntu@ip-xxx-31-xx-xx:$ sudomkdir /storage
Then mount all
1
ubuntu@ip-xxx-31-xx-xx:$ sudo mount -a
Double check it
1 2 3 4 5 6 7 8 9 10
ubuntu@ip-xxx-31-xx-xx:$ df -h Filesystem Size Used Avail Use% Mounted on udev 492M 12K 492M 1% /dev tmpfs 100M 344K 99M 1% /run /dev/xvda1 7.8G 1.6G 5.8G 22% / none 4.0K 0 4.0K 0% /sys/fs/cgroup none 5.0M 0 5.0M 0% /run/lock none 497M 0 497M 0% /run/shm none 100M 0 100M 0% /run/user /dev/xvdf 20G 44M 19G 1% /storage <------- THIS IS NEW