Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a dedicated server. I could only install a Debian. It was installed as hidden automated process. I would like now to use LVM and actually partition whole disk with another scheme. Is it possible and a good idea to do it in already installed Debian or is it better to install a new Debian with a debootstrap and then make LVM and partitions?

The problem with debootstrap is - all the tutorials saying that I need to partition the disk with new scheme (so is it possible to do it from already installed Debian on that disk?)

share|improve this question

1 Answer 1

This sounds very similar to what I had to do to recover my server at home after an incorrectly migrated fstab caused rsync to fill my root file system.

First off, understand my experience is with Ubuntu so that's the distro I'm speaking about. Never the less, they should be pretty similar.

The desktop distro of Ubuntu does not come with LVM, so I had to install it.

sudo apt-get install lvm2

Now when you reboot (or insmod lvm) the kernel module will be loaded, but your disks are not LVM enabled yet. To do this, you can use gparted to create a partition out of your free space. It must be big enough to hold a copy of your installation. Then enable LVM on this volume:

sudo pvcreate /dev/sd[new partition letter & number]

Create your volume group,

sudo vgcreate vg1 /dev/sd[same as above]

Now you can begin creating logical volumes in your new partition.

sudo lvcreate -n lvroot -L 20G vg1

This is a very simplified example, but it has the basics. You can indeed install LVM into an existing Linux install, but if you want your system to run from it, you'll have to migrate the install. I did so by using fsarchiver to do a backup, wipe of existing install, setup new LVs to match my partition scheme, then a restore, chroot and update-grub.

There are other ways to do it, and it was lot of work, but that worked well for me.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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