PDA

View Full Version : [ubuntu] 12.10 install with LVM on dual boot system



BenWhitey
January 23rd, 2013, 06:05 PM
I posted this in the Security Discussion forum but didn't get any responses so I'm posting here to see if anyone knows a workaround for this.

I'm trying to install Ubuntu 12.10 to my hard drive. I already have windows 7 installed on the drive and I play to encrypt it with TrueCrypt once I get linux working.

I've done this before with the 12.04 version using the alternate CD but I'm having problems setting up LVM on my drive. I create a 250MB ext4 /boot partition and then create a LVM. Then in the LVM I make a / ext4 partition. The problem is that I can't split up the LVM to make a /swap.

I was using the "something else" option in the partitioning step so that I can setup a /boot partition and not have ubuntu overwrite my MBR since I will need TrueCrypt to do that when I install it.

I feel like there is something obvious that I am missing but I can't figure it out.

darkod
January 23rd, 2013, 06:20 PM
How are you creating the logical volume for root? Assuming you give all LVM space to a single volume group, you create the root LV in that VG but with a smaller size than the total VG size. That way you can also create the swap LV in the same VG.

BenWhitey
February 5th, 2013, 06:31 AM
Hey thanks for replying. Sorry about the slow response I've been very busy with work.

I just thought I found a workaround

Once I setup the encrypted logical volume I see it and it has one partion in it but I cannot resize that partition. I can assign it a mount point but if I do not create a swap then the installer complains about there being no swap. I just figured out that if I double click on the encrypted volume I can create a new partition table with swap, /home/ and /, but then the installer crashed while it was setting up my partition tables....

I'm going to reboot and try again. I will edit the thread to say if it works this time. I think I may have also read something about the lack of LVM compatibility in 12.10 so we'll see.

henrx
February 5th, 2013, 06:36 AM
I've done this before and had the same problems. I ended up installing Ununtu as the only OS - it will give you all of the proper partitioning tools then [f-disk] - segment an area for boot/recovery/sda and fresh windows 7. you'll have to back up your data obviously - but linux writes the hard drive in a way that windows can't boot properly unless it's installed second on certain laptops. try just updating your BIOS from the manufacturer first - that worked for me in one install aw well.

BenWhitey
February 5th, 2013, 06:54 AM
Actually, it looks like ubuntu 12.10 does not support custom LVM layouts which is a pretty big thing to be missing.

http://www.tutonics.com/2012/11/ubuntu-lvm-guide-part-1.html

I'm just going to do a regular install and then set it up with LVM once I have it installed. Then I'll encrypt my windows partition with truecrypt.

darkod
February 5th, 2013, 09:53 AM
What do you mean it doesn't support custom LVM? You can do what ever you want. Maybe it doesn't have an automated process that suits your needs, because different people have different needs so there can't be auto process for everyone, but manually you can do what you want with LVM.

Since you also want to encrypt the disk, or only one OS, that could be an issue you have to work to solve.

But LVM as LVM is very flexible and you can set it up how ever you want.

For example, what do you want your custom LVM to look like?

BenWhitey
February 6th, 2013, 03:14 AM
I mean that during the install you cannot setup LVM without formatting your entire drive. The install crashed while partitioning my hard drive and the website I gave says that if you do not want to install LVM on your entire drive you need to apply it afterwards.

On a side note, it looks like something funky happened when truecrypt overwrote my MBR because I can't boot into linux (I didn't try before hand to make sure I could though....whoops). I'll sort it out this weekend. I'm hoping I don't need to install windows after installing linux because that would be a PITA.

ahallubuntu
February 6th, 2013, 04:21 AM
Can we assume you tried creating the LVM and all the partitions you want ahead of time before booting the install CD? Then just choose the partitions you'd previously created as mount points?

darkod
February 6th, 2013, 09:53 AM
I mean that during the install you cannot setup LVM without formatting your entire drive. The install crashed while partitioning my hard drive and the website I gave says that if you do not want to install LVM on your entire drive you need to apply it afterwards.


Of course you can. I didn't have time to go through all of the info on that website, but if they said that they are wrong.

Now, in your case you are trying to encrypt the disk with Truecrypt which might be the issue, not LVM.

And another important moment: the live cd doesn't contain the package lvm2 and for 12.10 there is no alternate cd as far as i know. So, installing 12.10 with LVM would go like:
1. You boot into live mode first. Install the lvm2 package.
2. Create the partition(s) you want to serve as physical device for LVM with Gparted or parted in terminal. It's important to mark the partition(s) as physical device for LVM when creating them. So, you don't need to overwrite the whole disk, just create any partition(s) you want.
3. Create the VG and LVs you want.
4. Only then start the installer with the Install icon on the desktop.
5. Choose Something Else and in the partitions list it should show the LVs. Use them with correct mount points and that should be it.

If you need help setting up the VG and LVs, just ask. There are number of tutorials online too, some very old. :)

For 12.04, the alternate cd makes it little bit easier because it natively supports LVM, so you have to do less things manually. But it's very easily doable in 12.10 too.

Now, all of the above affects LVM only. When trying to use encryption, how it affects the setup I have no idea. You have to investigate that.

BenWhitey
February 18th, 2013, 05:43 AM
Well, can't I make the argument that they are right because you have to install lvm2 separately in order for it to work since there is no alternative cd?

darkod
February 18th, 2013, 10:00 AM
Well, can't I make the argument that they are right because you have to install lvm2 separately in order for it to work since there is no alternative cd?

Not really, in my opinion. As I said, I didn't have time to go through all of it, but I was referring to your statement that LVM can't be installed unless you format the whole disk, the statement I quoted in my post.

Not whether you need to add one package first or not. Besides, I assume that LVM from the live cd doesn't work without the lvm2 package, whole disk or no whole disk. So even if you format the disk you wouldn't be able to set it up without having the package added.

Besides, what is the issue right now exactly? Are you only complaining about needing to add a single package to support lvm2 from the live cd, or actually your system is not letting you set up LVM without formatting the whole disk?

BenWhitey
February 18th, 2013, 05:39 PM
I was merely surprised that you had to have a workaround in order to setup LVM without formatting the whole disk. I never tried installing lvm2 and installing. I just installed without LVM and then I will set it up from a linux install (once I have windows working again)

darkod
February 18th, 2013, 05:55 PM
Yeah, I was surprised they dropped the Alternate CD for 12.10. Maybe they will release one later but I doubt it.

Adding the lvm2 package is also "standard procedure" if you want to manipulate your LVM from live mode, regardless of the ubuntu version installed. For example to save data from a broken system, etc.
Unless they start including lvm2 on the live cd (hence the decision to drop the alternate cd), you always need to add the package and activate the LVM with:

sudo apt-get install lvm2
sudo vgchange -ay

That activates all LVs it can find so you can manipulate them, like removing, shrinking, etc. Sometimes you can't do that live, depending how are you using that LV.

BenWhitey
February 25th, 2013, 04:16 PM
I'm waiting until I figure out how to get truecrypt working with ubuntu before I setup LVM. I might end up switching to 12.04 because it's easier to get that working with truecrypt