-1

I have AWS EC2 instance and its disk usage always above 90% and just trying to move user folder to "udev" partition to free disk space.

Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda1      7.9G  6.7G  830M  90% /
udev            3.7G  8.0K  3.7G   1% /dev

First question I know what is this partition and used for but if i move user's folder to it, Is there any harm?

Second, I just did following steps. But i can't connect to server with ssh after restart server. Any solution and explanation to it?

sudo mv /home/ubuntu /dev/ubuntu
sudo mkdir /home/ubuntu
sudo chown ubuntu:ubuntu /home/ubuntu
mount --bind --verbose /dev/ubuntu /home/ubuntu

UPDATE 2


OK i think problem is solved. The reason of error is caused by moving user home folder to /dev. It was big mistake because udev partition is placed on memory. When i stop server, computer's memory will cleared out. Which means my user folder will gone forever.

Thanks for quick response time and great content. Really appreciate that.

Bagi
  • 51
  • 8
  • When you say can't connect what exactly is the error message you get. – user9517 Oct 01 '15 at 05:32
  • 4
    If that's what you did and then rebooted the server, you just wiped out your /home/ubuntu. udev is not a standard filesystem, it's a device manager stored entirely in RAM. You reboot, your RAM is cleared. [This answer on SuperUser](http://superuser.com/a/675664/237790) will explain more. –  Oct 01 '15 at 05:33
  • i really want to vote up your comment but my reputation is not enough. But thanks for the link. – Bagi Oct 01 '15 at 06:24

1 Answers1

2

The udev device is a RAM disk and so unfortunately I think you have just lost all your data from /home/ubuntu.

See this Answer on Superuser for more details on udev

Best reach for your backups to get that back.


If you tell us the exact message you get from your ssh connection attempts we ma be ale to help you out there but that may be immaterial.

user9517
  • 115,471
  • 20
  • 215
  • 297