0

my os is CentOS 6 running as a virtual machine under ESX. I don't know why /home folder is mapped to the biggest partition. I want my own folder /data (which is next to /etc, /root, /home and others) to be 1.2T big.
How can I achieve this?

centos6 ~ # df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_centos6-lv_root
                       50G  4.2G   43G   9% /
tmpfs                 1.9G     0  1.9G   0% /dev/shm
/dev/sda1             485M   52M  408M  12% /boot
/dev/mapper/vg_centos6-lv_home
                      1.2T  199M  1.2T   1% /home
0

You could create another logical volume (lv) and then steal space from lv_home and give it to lv_data (or whatever you call it). But that is going to involve a good amount of work to make sure that nothing in the partition on lv_home is using that space (work I'm not rightly sure how to perform offhand).

It might be easier to simply change your mount points if you really don't care about /home and aren't going to care in the future. This would involve actually creating a /home directory on the / filesystem (on lv_root) then moving all of /home to there. After which you can mount the partition on lv_home to /data (once you've moved all your data to there from the current /data.

If this is a new system you might be better off just reinstalling from scratch and getting the partitioning and layout correct in the installation wizard.

Alternatively you could just move the contents of /data to /home/data and then symlink or bind mount from /home/data to /data.

1

You can recursively copy your contents from /data/x to /home/x by doing

cp -Rp /data/x /home

After that change your login directory to be /home/x by using 'usermod' command.

  • Thanks, but I want to keep /data folder. I just want it to be much more bigger (1.2T) than it is now. I don't use /home folder and it should be as small as possible. – user2274366 Nov 18 '13 at 18:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.