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 Debian Squeeze installed on VirtualBox. While installing I've chosen Ext3 filesystem and it takes whole virtual disk space. fdisk says:

Disk /dev/sda: 33.0 GB, 32986103808 bytes
255 heads, 63 sectors/track, 4010 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes  
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000471d5

Device Boot         Start         End      Blocks   Id  System
/dev/sda1   *           1        3842    30855168   83  Linux
/dev/sda2            3842        4011     1354753    5  Extended
/dev/sda5            3842        4011     1354752   82  Linux swap / Solaris

How can I create Linux LVM system on /dev/sda1 to work with?

share|improve this question
add comment

1 Answer

If you've already installed linux onto /dev/sda1, you can't put LVM on top of it.
LVM is created first.
The following example creates an LVM layout, which should be created from a livecd, or rescuecd

pvcreate /dev/sda1 # initializes /dev/sda1 for LVM
vgcreate vgname /dev/sda1 # creates Volume Group with one device 
lvcreate --name boot --size 1G vgname # create logical volume to boot from
lvcreate --name root --size 6G vgname # create logical volume for / fs
lvcreate --name swap --size 1G vgname # create logical volume for swap
lvcreate --name home --size 2G vgname # create logical volume for /home fs

Adjust sizes to suit
Then run the Debian installer, selecting advanced partitioning and select each logical volume, set the filesystem type, indicate that formatting is needed, and install.

If you already have a substantially configured system, you could make a backup of your file systems, follow the above to create the VG,LVs, and then restore the data (both using livecd or rescuecd). After which you'll need to mount the root LV and update the fstab with new UUIDS, follow the chroot procedure to change to new LV layout and update-grub

I think squeeze can boot from a LV, but check the Debian website first, or else you'll need a separate partition for /boot that's not part of the LV.

This would be a good time to switch to GPT disk labeling for finer granularity

share|improve this answer
    
/boot on LVM should work, but there is some risk. @bdowning Thanks, I'll try. –  Jackson Mar 4 '12 at 18:49
add comment

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.