expand /boot partition?

chris lostpkts at gmail.com
Wed Jun 18 20:44:07 UTC 2008


On Wed, Jun 18, 2008 at 11:04 AM, Leonard Chatagnier
<lenc5570 at sbcglobal.net> wrote:
> I for one would like the write up as I plan to resize
> my primary gutsy partition(has all the unused space on
> my 500 gig drive), sda3, and use the free space to
> make several smaller drives(extended) in order to
> install several new Ubuntu versions from live or
> alternate CD and avoid upgrading to hardy heron.  From
> what I've read on the list, that seems to be the most
> fool proof way to install hardy especially if you want
> to install the x86_64 version.  In my case, I would be
> reducing sda3 primary and using the free space to add
> several 50-100 gigabytes size, ext3, extended
> partitions to add ubuntu versions from a live or
> alternate CD.  Although I've resized before but
> usually lose something so I'm a little afraid to
> proceed with gparted without knowing more.  Any
> recommendations or howtos are much welcomed.
>



This is what I did and what happened to me.

First off the setup.

160G laptop drive

/dev/sda
/dev/sda1 - Windows Vista  (50G)
/dev/sda2 - /boot ext3 (50M)
/dev/sda3 - physical in an encrypted lvm2 setup (rest o' space).  This
has / and swap in it.

The problem:

/boot is too small.. I can barely hold a kernel update.  (2 in there).
 Removing the old one is problematic due to no space after new kernel
install

Solution:

Expand the partition.


I booted the gparted livecd iso from their site.

I used it to drop 100M off the Vista and put on the backend of that
partition.  I then told it to take that 100M and put on /boot.

Whole process was about 50 min of chewing on the hard drive.

I was so happy.  Enter the REBOOT

I use the Windows Vista bootloader.  I also use EasyBCD in Vista to
modify it so that Ubuntu is in the menu, etc.  Anyway... back to the
reboot.

Menu shows up as normal.  Great.  I select Ubutnu like I always do.
Windows suddenly tells me that it can't do that.  WTF!

I figure the menu just need to be told where grub is again.. so I try
and boot vista to edit the menu again.  Nope... windows says it needs
to be repaired as its winload.exe is borked     Oh perfect....

After digging around work... yes... I didn't do much else yesterday...
I found a vista dvd.  I'm running home premium, but any vista dvd
version will do.  I boot it up and selected REPAIR.

It did its thing and rebooted.  And great... Windows loads now but my
menu is toast...

so I go back into EasyBCD and tell i twhere grub is at on /boot.
(grub was installed on sda2 instead of mbr as I was using windows
loader)

Reboot and select ubuntu again... it attempts to load and reboots the
computer and back I go in this loop. So I figure grub is toast... I
boot Ubuntu LIvecd and attempt to reinstall grub but it says nope...
won't do it.  I was doing the grub-install /dev/sda2 command.

Now panic sets in... crap.. I didn't make a backup of some files.
(yeah... I know... )  So googling around I found a doc that told me
how to mount the encrypted partition as at this point, I figured I had
a reinstall coming up.

This is the commands I ran to mount the encrypted part using a the
Ubuntu 8.04 livecd.

As Root:

apt-get install cryptsetup lvm2
modprobe dm_mod
modprobe dm_crypt
modprobe aes (this gave error but this all still worked)

cryptset luksOpen /dev/sda3 external (external is anything you want name)
  enter passwd from hell

Now the tricky part... there isn't a way to find out the VG name in
the LVM2 setup.. you just have to know it.  Luckly I had named my VG
the same as the computer name.

vgchange -ay kessel  (it will see the vg on the now unencrypted
section) (kessel was my VG name)

lvscan (gives you the device names for the mounts)

mount /dev/kessel/root /mnt/kessel

Happily copy all data off that you want.

umount /mnt/kessel

vgchange -an kessel
cryptsetup luksClose external


While it was coping data off I googled around on my grub issue... I
can't be the only person who had this problem/setup.

Then I found an article on restoring it.

 After I unmounted the encrypt drive I did the following as root

grub
grub> root (hd0,1)    (this corresponds to sda2)
grub> setup (hd0,1)
grub> quit

After I did that I rebooted and tried ubuntu from my windows menu...
and viola it booted up and asked me for my crypt passwd... and loaded
fine.  Windows loads fine too.

And best of all /boot is now 150M.  So I have some space now to muck around.

Hope this helps people out.

Let me know if you have questions.

Chris




More information about the ubuntu-users mailing list