Skip to main content

How can I move storage from one file system to another filesystem? [Resolved]

I'm on a Linux EC2 machine and I'm getting an error that my storage space is full.

  Error writing to connection:  No space left on device

I used df and I can see that I have plenty of space in some of my filesystems.

Filesystem     1K-blocks    Used Available Use% Mounted on
devtmpfs         8202604      60   8202544   1% /dev
tmpfs            8213188       0   8213188   0% /dev/shm
/dev/xvda1       8123812 8023744         0 100% /

I'm on a t2.xlarge. Is it possible to make more space available in xvda?

Question Credit: goollan
Question Reference
Asked May 16, 2019
Posted Under: Network
1 Answers

When using GNU coreutils df, get in the habit of filtering by file system type: df -t xfs -h. Or maybe you are using ext4 or other file systems. This ignores in memory types that are not permanent storage, like tmpfs.

Create new disks (EBS volumes in the case of AWS), create LVM volumes and file systems on them. Then migrate onto the new mount points (/srv or somewhere under /var perhaps) by copying data. You can then do neat tricks like booting an image with upgraded software, then swing the existing disk over to the new instance.

Or, you could expand the existing disk and the file system on it. However, that ties your data to your operating system volume.

credit: John Mahowald
Answered May 16, 2019
Your Answer