0

My internal server is running out of space. I want allocate some of the space from lv_home over to lv_root. I have checked the following link: Centos 6.3 disk space allocation. It has few commands which I need to run to allocate disk space.

I have a doubt: will I lose my data after running those commands.?

# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_sutekar-lv_root
                       50G   48G  822M  99% / 
tmpfs                 3.9G  296K  3.9G   1% /dev/shm
/dev/sda1             485M   47M  413M  11% /boot
/dev/mapper/vg_sutekar-lv_home
                      862G  291G  528G  36% /home
  • Do you know why / (lv_root) is full it may be better to fix that. There is always a chance that data an be lost you will be making sure you have good backups won't you ? – user9517 Sep 25 '14 at 07:06
  • It contains users data like user images, files and I can't move it to different directory... – Sanket Utekar Sep 25 '14 at 07:12
  • Yes.. I am going to take backup... But should I take a backup of my root directory or home directory or both..? – Sanket Utekar Sep 25 '14 at 07:17

1 Answers1

0

You won't lose any data if you first resize the filesystem before resizing the logical volume of /home. Then the opposite with /, resize the logical volume then the filesystem. But don't resize the volume of /home before the filesystem or you WILL lose data.

Isaac
  • 159
  • 4
  • Sorry I didn't get you... can you please explain with example..? – Sanket Utekar Sep 25 '14 at 07:23
  • You can check an example here: [link](http://www.howtoforge.com/linux_lvm), there you can see the process of resizing a logical volume, specially on part 4. – Isaac Sep 25 '14 at 09:10
  • Also, you shoud consider creating new file systems/mount-points for directories such as /var, /tmp... – tonioc Sep 25 '14 at 09:39