How to give more storage to /home directory with block storage?
To give the /home directory more space on block storage, you will need to move all of your existing content onto the block storage. You cannot keep some storage on the SSD and supplement that with block storage unless you set up LVM, which some of the Linode platform features do not support.
1) Create your block storage volume and follow the instructions to create a file-system and mount it under
/mnt. (Ignore the final configuration point about adding the volume to fstab - we'll do this later.)
For example: if your block storage is called "home-volume", the instructions provided will mount it under
/mnt/home-volume. Ensure that this is listed when you run
df -h with a mount-point of
2) Copy the contents of your existing home directory to the block storage. Ensure you and/or your users are not modifying their home directories at this point or they risk data not being copied.
cp -r /home/* /mnt/home-volume
3) Once this is finished unmount the block storage from
You may also want to remove all data from
/home to free up this space back to the Linode's SSD. Ensure you have a backup.
4) Remount the block storage volume under
/home using the same command as in point 1) but replace
5) Finally add the relevant configuration line from the block storage configuration steps to
/etc/fstab, but replace
/home to ensure the volume is mounted at
/home on boot.
A couple of things to bear in mind:
If you use the Linode back up service, I'd recommend taking a snapshot before you start.
Block storage volumes ARE NOT included in the back up service, so you will need another solution to backup the data on the block storage volume.
and i have 1 more question is there a way to give more space to home without moving content to block storage?
is there a way to give more space to home without moving content to block storage?
The only way I know is to use an LVM logical volume for
/home, which manages the underlying storage onto one or more physical devices. You add another physical device to the volume group to increase the space.
However, features of the Linode platform that need to be able to mount the ext4 filesystem on your Linode will no longer work.