You are not logged in.

#1 2008-08-09 02:49:09

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,231
Website

Migrate Current Installation to LVM

I've found this article: https://help.ubuntu.com/community/Setti … eanInstall
What does everyone think about doing this to an Arch system?

My current layout:

fukawi2 ~  $ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sdb2             146G  6.3G  139G   5% /
/dev/sda1             187G  152G   35G  82% /home
/dev/sdb3             122M   14M  102M  12% /boot

I want to use all that extra space on / to expand my /home. As you can see, I already have my /boot partition separate smile

I'm thinking I need to:
1) Boot GParted Live CD and shrink /dev/sdb2 (my current / partition)
2) Create a new LVM PV on the freed space
3) Not sure how to change /dev/sda1 to a PV and create a LC with sda1 and sdb2 ???
4) Create my /home partition on the LC containing sda1 and sdb2

Offline

#2 2008-08-10 23:46:57

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,231
Website

Re: Migrate Current Installation to LVM

Bump... Anyone? sad

Offline

#3 2008-08-11 03:32:05

Factory
Member
Registered: 2008-02-24
Posts: 108

Re: Migrate Current Installation to LVM

fukawi2 wrote:

Bump... Anyone? sad

Don't bump. People look for threads with 0 replies to help first.


Read the wiki. This article will tell you everything you need to know about LVM:
http://wiki.archlinux.org/index.php/Lvm

If there's something that was left out, check out this:
http://tldp.org/HOWTO/LVM-HOWTO/

Offline

#4 2008-08-11 07:06:04

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,231
Website

Re: Migrate Current Installation to LVM

There's nothing there about migrating from a non-LVM system to LVM without reinstalling...

Offline

#5 2008-08-11 12:19:53

Berticus
Member
Registered: 2008-06-11
Posts: 731

Re: Migrate Current Installation to LVM

well the first two steps you've spelled out quite clearly, so it seems you've got that idea down. The links Factory provide show you how to do the other two steps, which is to create a pv and an lv spanning multiple hard drives. I believe it also says how to create a filesystem on there. So once you have that, you can move everything in /home to the new filesystem. After that, you can wipe /dev/sda clean and partition it as lvm, create a pv, add it to the lv, and then grow the filesystem to add space. Everything I mentioned is mentioned in the links provided by Factory.

The idea behind a logical volume manager is that you can manage your volumes in a logical way, so you don't have to do everything in one shot (id est combine /dev/sda and /dev/sdb in a logical volume), you can do it in steps (exempli gratia what I just said).

Offline

#6 2008-08-12 10:43:58

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,231
Website

Re: Migrate Current Installation to LVM

OK, sorry - didn't explain myself properly smile

Can I migrate /home to be part of the LVM setup, WITHOUT loosing the data that's on it? ie, make it a PV, and add it to the LG and LV without wiping it and creating a new file system?

Thanks for your answers so far guys smile

Offline

#7 2008-08-12 12:38:03

Berticus
Member
Registered: 2008-06-11
Posts: 731

Re: Migrate Current Installation to LVM

no, LVM is a layer that sits undernieth the filesystem.

Offline

#8 2008-08-12 13:47:08

ravster
Member
From: Queen's U, Kingston, Canada
Registered: 2004-05-02
Posts: 285
Website

Re: Migrate Current Installation to LVM

You will have to create a new temporary partition, and your operations will be along the lines of switching the values of variables A and B, using C as a temporary holder of the value of one of the variables.

If I understand you correctly, you want both root '/' and home '/home' on the same logical volume.

So, create a new partition 'C', then move the data of sdb2 and sda1 to that partition (use seperate folders or something), then do the lvm thing on those two partitions, format the logical volume that you have created with your favourite filesystem, and then move your data onto the logical volume.

Then you will have to do a few gymnastics with rc.conf and maybe even mkinitcpio.conf, and /etc/fstab, and then you'll be good to go.

After your system is set up the way you want it, feel free to delete partition 'C'. But don't do it earlier since you don't want to risk losing your data.

Offline

#9 2008-08-14 09:45:31

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,231
Website

Re: Migrate Current Installation to LVM

Hmm, I thought that might be the answer... I think I'll leave it for now. When I run out of space on /home I'll throw in a 500gb under LVM, move /home to that, then wipe my current home and add that to the LVM to make 700gb LVM  smile

Offline

Board footer

Powered by FluxBB