[breezy install] LVM option?

David Abrahams dave at boost-consulting.com
Mon Dec 5 18:44:31 UTC 2005


David Abrahams <dave at boost-consulting.com> writes:

> Dick Davies <rasputnik at gmail.com> writes:
>
>> On 05/12/05, David Abrahams <dave at boost-consulting.com> wrote:
>>
>>> I'm starting to get the feeling that this part of the installer
>>> doesn't really work and I should expect to have to use pvcreate,
>>> vgcreate, etc., from the command line, in order to really manage the
>>> LVM configuration.  But I have no idea whether this can actually work.
>>
>> No, it can be done. I always setup my ubuntu and debian boxes with lvm
>> (for everything apart from /boot ) through the installer.
>>
>> If you do it yourself, it's reliable on both sarge and breezy - create
>> the PVs, then
>> go on to 'configure LVM' and ok 'write changes to disk', then you
>> create your VG and
>> LVs. Finally you format the LVs and specify mount points, it's pretty
>> straightforward.
>
> Well, that's what I tried to do, FWIW.  The disk had just hours before
> been set up with a clean install of some prior Ubuntu version.  Now
> I've done one install with the LVM options it would let me use; I
> think I may be able to do a new clean install and get the control I
> need.  

Well, here we go.  It's a detailed experience report; eventually
things "work," but they work badly at best.  Who is in charge of
installer software and should see this info?

Erase entire disk and use LVM (that worked)

    IDE1 master (hda) - 30.0 GB
      #1 primary     255.0 MB      Z :-X   ext3   /boot
      #5 logical      28.8 GB        :^)   lvm
    LVM VG Ubuntu, LV root - 28.5 GB Unknown
      #1 28.5 GB      :-X  ext3              /
    LVM VG Ubuntu, LV swap_1 - 1.2 GB Unknown
      #1  1.2 GB      :-X  swap              swap


Attempt to resize the 256 MB /boot partition it created
   (that's too big, right?).  

     "Write the changes to disk and resize the partition?" (Yes)

     "New partition size:" (20 MB)

   The first time I tried this, the message was something like:

     "For some reason, ... was unable to resize the partition"

   Really!  "For some reason!"  I am just walking through these
   steps again (from a clean reboot) and now at this point it
   instead tells me:

     "Too small size"

   Okay:

     "New partition size:" (50 MB)

   That seems to have worked.  What the heck, let's try to make it
   smaller again:

     "New partition size:" (20 MB)

   Heh, it seems to be working!  Now I'm left with 

    IDE1 master (hda) - 30.0 GB
      #1 primary      16.4 MB ext3 Z :-X   /boot
         pri/log     238.5 MB              FREE SPACE
      #5 logical      28.8 GB        :^)   lvm
    LVM VG Ubuntu, LV root - 28.5 GB Unknown
      #1 28.5 GB      :-X  ext3              /
    LVM VG Ubuntu, LV swap_1 - 1.2 GB Unknown
      #1  1.2 GB      :-X  swap              swap

   Why do I have a 16.4 MB /boot now?  I don't know.

   Now attempt to resize #5 to soak up the remaining free space
   
     "New partition size:" (max)

   Hmm, no change.  What is up here?  Is there some rule that a given
   partition can't have more than a certain number of blocks, so the
   smallest blocks allowed on partition #5 are 256MB?

Let's start over: I select the disk and wipe its partition table.
Then I manage to set up something like this, which looks like a start:

    IDE1 master (hda) - 30.0 GB
      #1 primary      16.4 MB :-X ext3  /boot
         pri/log       6.0 GB :-X fat32 /windows
      #5 logical      24.0 GB :-X ext3  /  
    LVM VG Ubuntu, LV root - 28.5 GB Unknown
      #1 28.5 GB      :-X  ext3     /
    LVM VG Ubuntu, LV swap_1 - 1.2 GB Unknown
      #1  1.2 GB      :-X  swap     swap
   
But it tells me that formatting of / failed.

Let's start over: I select "Erase entire disk and use LVM."  I'm back
to

    IDE1 master (hda) - 30.0 GB
      #1 primary     255.0 MB      Z :-X   ext3   /boot
      #5 logical      28.8 GB        :^)   lvm
    LVM VG Ubuntu, LV root - 28.5 GB Unknown
      #1 28.5 GB      :-X  ext3              /
    LVM VG Ubuntu, LV swap_1 - 1.2 GB Unknown
      #1  1.2 GB      :-X  swap              swap


Now I want to dice up the logical / partition, so I "Configure the
Logical Volume Manager."  Do I have a Volume Group yet?  One way to
find out: select "Modify Volume Groups" and see if there's anything to
modify.  I select "Delete Volume Groups" and find there aren't any
(despite the display above which seems to indicate there's one called
"Ubuntu").  So I select "Create volume groups" and a make one in the
27.71 GB available (that's the only option).  I call it "MyVG."

Hmm, after several failures for reasons I don't remember I am now
able to create a logical volume.  I call it lv-var (I'm going to put
/var there).  Works!  OK, now I want to create one for /var/log.  I
call it lv-var/log.  Fails for cryptic reasons.  I switch to the 3rd
console (which it's only just now telling me about!) to find some
diagnostic info.  Nothing useful there at all; it just looks like the
result of some command-line to which wrong options were supplied.  I
figure it's the slash so I try again using lv-var-log.  Success! 

So now I have a bunch of LVs in my own volume group, and then the two
LVs set up by the installer are still hanging out there, apparently
attached to the nonexistent (?) "Ubuntu" VG.  It's hard to imagine
that it /really/ doesn't exist, because my previous install used just
those two LVs and it seemed to work.  What does that mean?
I guess I'm going to have to delete the ones that Ubuntu made for me (?)

Now that I've set up all my other LVs, it looks like the first one
created automatically by the installer is now empty, i.e. the 2nd line
below is now missing:

    LVM VG Ubuntu, LV root - 28.5 GB Unknown
      #1 28.5 GB      :-X  ext3              /
    LVM VG Ubuntu, LV swap_1 - 1.2 GB Unknown
      #1  1.2 GB      :-X  swap              swap

So I wonder if the space for my new LVs somehow came out of that?

Okay, trying to delete the two LVs above... It asks me what VG the LVs
are in, and of course there is no "Ubuntu" VG in the list so I don't
know how to delete them.  Hmm, back at the main list that line I said
was missing is now back!

All I can do is delete those partitions in the usual way.  Now they
are labelled FREE SPACE.  So my disk has apparently doubled in size!
Neat trick ;-)

Well I don't seem to have other options at this point, so I'm going to
"Finish partitioning and write changes to disk," hoping for the best.

Seems to be working.  I'm wondering if this would have gone better had
I called the VG I created "Ubuntu"?

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

















More information about the ubuntu-users mailing list