PDA

View Full Version : Enabling LVM after SUSE installed



kevinsun
08-Feb-2013, 10:16
Hi,

I have just finished installing a new box of SUSE 10. However, I find that the LVM is not default enabled. I would like to enable the LVM (with previously formatted disks put back to LVM). Is it possible?

Thanks,

K.

jmozdzen
08-Feb-2013, 14:42
Hi Kevin,

migrating filesystems from partitions to LVM is certainly possible, but almost as painful as migrating those to new partitions. So as always, the answer to your question is "it depends".

To be a bit nit-picky: LVM is already "enabled", it's simply not used ;)

Migration possibilities depend on the amount of free disk space and the "tidiness" you expect from the resulting system.

The basic steps are rather simple:

- identify enough free disk space ("partition") to later carry the files from the file system to be migrated
- mark that partition as a physical volume (via YaST or "pvcreate")
- add that PV to your volume group (if you have no volume group yet, create one)
- create a logical volume big enough to carry the files to be migrated, and create a file system on it
- migrate the existing file system content to the new file system
- shred the old filesystem

and repeat these steps for every file system you'd like to put under LVM management.

If you're under tight space constraints, you'll have to convert each "freed" partition to a PV, and add it to your volume group, as soon as its files are migrated. That will leave you with possibly many PVs, made out of consecutive disk partitions, rather than having one large PV instead.

If you actually have "multiple disks" rather than a single disk with partitions, chances are high you may start by adding a whole disk to your LVM and start with LV sizes barely big enough to carry the migrated data. Once you've migrated the file systems of the existing disks, you could add those disks, each as a single PV, and finally adjust the LV sizes to your requirements. That'll leave you with a more tidy setup.

Of course, there are many ways to skin a cat.

Regards,
Jens