Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I have got 1 workstation configured LVM in it we have low disk space in /home partition, and in root we have nearly 800gb space wants to shrink the /root partition and increase the /home partition...
You can't extend /home there, as /home is not LVM already, however you could migrate to a new LVM logvol after first reducing the size of the existing / one.
then create a new LV for home, a new filesystem on it, and then copy the existing /home data to it, edit /etc/fstab to reflect the alternative location and go from there. Actually, you can probably just directly copy the existing partition to the logical volume instead of messing about too much with it - dd if=/dev/sda5 of=/dev/mapper/VolGroup00-LogVolHOME - for example.
btw, you must not confuse the root partition, "/", with "/root". It's certainly confusing, but the difference is very simple.
Thank for your reply, I can shrink the / partition and i can create the new LVM group for /home ...
But what happens for that previously created /home partition , if i mount the new LVM with /home after unmounting the previously created /home partition....
I have create new users or previously created user will work ????
Your best option in my opinion is to mount the new LVM 'home' partition on another mountpoint, for example /tmp/home (create the directory if it doesn't exist) and copy all files, maintaining the permissions (-p or --preserve) from /home to /tmp/home. Next umount both /home and /tmp/home and mount the LVM 'home'partition on /home. Change /etc/fstab to point to the new volume and you should be good to go. Normally you won't have to re-create users or anything like that.
Your best option in my opinion is to mount the new LVM 'home' partition on another mountpoint, for example /tmp/home (create the directory if it doesn't exist) and copy all files, maintaining the permissions (-p or --preserve) from /home to /tmp/home. Next umount both /home and /tmp/home and mount the LVM 'home'partition on /home. Change /etc/fstab to point to the new volume and you should be good to go. Normally you won't have to re-create users or anything like that.
Kind regards,
Eric
I don't think this is the best approach actually. As it's one entire filesystem to another he can dd the entire block device across and then just use resize2fs to make it fill the LV.
Hi i have created the LVM with the free space as you said i have created the directory /tmp/home for my /home partition and moved all the files from /home to /tmp/home directory...
and unmounted the /home and mounted my new LVM partition into /home.. and copied all the files from /tmp/home to /home lvm partition now i am not able to login with previously created user account.....
as above, I would STRONGLY suggest cloning the filesystem using dd, as that way, as long as that one command is run correctly and the filesystem is mounted normally, it's basically impossible for it to not work.
I don't think this is the best approach actually. As it's one entire filesystem to another he can dd the entire block device across and then just use resize2fs to make it fill the LV.
Hi,
Thanks for pointing me back to the basics. Completely overlooked that one, my bad.
Hi i have created the LVM with the free space as you said i have created the directory /tmp/home for my /home partition and moved all the files from /home to /tmp/home directory...
and unmounted the /home and mounted my new LVM partition into /home.. and copied all the files from /tmp/home to /home lvm partition now i am not able to login with previously created user account.....
Hello,
You state you moved the files. What exactly did you do? Use the 'mv' command? I mentioned in a previous post cp with the -p or --preserve argument to keep permissions. If you didn't use that then most likely your permissions are all off and you'll need to review them. To avoid these things you'd best take acid_kewpie's advice and use dd.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.