Installing Ubuntu along with Fedora Linux on an LVM formatted Partition

I have an unused partition and want to install Ubuntu Dapper on it. On reading through the docs it seems possible to install it from an existing linux/unix box.

  1. My current partition looks like below, of which "/dev/hda2" primary partition is unused:
    /dev/hda1               1        1044     8385898+   7  HPFS/NTFS
    /dev/hda2            1045        4699    29358787+  83  Linux LVM
    /dev/hda3            4700        4712      104422+  83  Linux
    /dev/hda4            4713        7296    20755980    5  Extended
    /dev/hda5            4713        7296    20755948+  8e  Linux LVM

    1st partition is Windows, 2nd partition is unused, 3rd is "/boot".
    The 5th logical partition holds the Fedora install.

    Below is the logical volumes on "/dev/hda5":

      --- Logical volume ---
      LV Name                /dev/VolGroup00/LogVol00
      VG Name                VolGroup00
      LV UUID                lW0nA8-FisJ-DJO1-QpGW-LcMS-4832-U5Huaa
      LV Write Access        read/write
      LV Status              available
      # open                 1
      LV Size                17.81 GB
      Current LE             570
      Segments               1
      Allocation             inherit
      Read ahead sectors     0
      Block device           253:0
      --- Logical volume ---
      LV Name                /dev/VolGroup00/LogVol01
      VG Name                VolGroup00
      LV UUID                gXOO57-GnZE-C4Vq-ncHf-yfGx-lZLV-Mb8QWf
      LV Write Access        read/write
      LV Status              available
      # open                 1
      LV Size                1.94 GB
      Current LE             62
      Segments               1
      Allocation             inherit
      Read ahead sectors     0
      Block device           253:1

    "/dev/VolGroup00/LogVol00" is where Fedora Core 5 is installed.
    "/dev/VolGroup00/LogVol01" is used as the swap partition.

  2. I will be creating a 4GB logical volume on "/dev/hda2" to use for the ubuntu install.
    # pvcreate /dev/hda2
    # vgcreate vg00 /dev/hda2
    # lvcreate -L 4G -n lv00 vg00
  3. Create the ext3 file-system:
    # mke2fs -j /dev/vg00/lv00
  4. Lets mount the newly created file-system on "/mnt/ubuntu":
    # mkdir /mnt/ubuntu
    # mount -t ext3 /dev/vg00/lv00 /mnt/ubuntu

    Now I am ready to take on the Ubuntu Dapper Install, which I'll be doing from the DVD install media.

  5. Install "debootstrap":

    # mkdir /tmp/debootstrap
    # cd /tmp/debootstrap
    # ar -x /media/dvdrom/pool/main/d/debootstrap/debootstrap_0.3.3.0ubuntu2_all.deb
    # tar -C / -xvzf data.tar.gz

    Alternately, you could also download the debootstrap.

  6. Run "debootstrap":

    # debootstrap --arch i386 dapper /mnt/ubuntu file:/media/dvdrom/ubuntu

    If you are following this, you may need to replace "i386" with your architecture which could be any of -- amd64, hppa, i386, ia64, powerpc, or sparc.

    The file can be substituted with a URL, "", if doing the install over the internet.

    You should get "Base system installed successfully" at the end of the run.

  7. Install LVM2

    Since I am installing on lvm, install the lvm2 package as well as it does not come with the base system.
    This step can be skipped if installing on a standard partition.

    # apt-get install lvm2
  8. Configure Base System

    Once the base system is ready, lets chroot in and configure it:

    # cp /etc/fstab /mnt/ubuntu/etc/fstab
    # LANG= chroot /mnt/ubuntu /bin/bash
  9. Mount Partitions

    I edited the copied fstab over to reflect my current file-system.

    # /dev/hda2 LVM
    /dev/vg00/lv00          /                       ext3    defaults        1 1
    /dev/hda3               /boot                   ext3    defaults        1 2
    proc                    /proc                   proc    defaults        0 0
    sys                     /sys                    sysfs   defaults        0 0
    # /dev/hda5 LVM
    /dev/mapper/VolGroup00-LogVol01 swap            swap    defaults        0 0
    /dev/hdc              /media/cdrom            iso9660 noauto,ro,user,exec 0 0

    Mount all partitions specified in "/etc/fstab":

    # mount -a
    # mount -t proc proc /proc
    # mount -t sysfs sysfs /sys

    Be sure to mount proc and sysfs before continuing.

    The command `ls /proc` should now show a non-empty directory. Should this fail, you may be able to mount proc from outside the chroot:

    # mount -t proc proc /mnt/ubuntu/proc
  10. Configure Keyboard

    To configure your keyboard:

    # dpkg-reconfigure console-data

    Note that the keyboard cannot be set while in the chroot, but will be configured for the next reboot.

  11. Configure Network

    To configure networking edit -- "/etc/hostname", "/etc/resolv.conf" and "/etc/network/interfaces".

    # echo ubuntuHost > /etc/hostname
    # echo "nameserver" > /etc/resolv.conf
    # cat <<EOF > /etc/network/interfaces
    # We always want the loopback interface.
    auto lo
    iface lo inet loopback
    # To use dhcp:
    auto eth0
    iface eth0 inet dhcp
    # Wireless ipw2200
    auto eth1
    iface eth1 inet dhcp
    wireless_essid LinuxWebLog
    wireless_key ***********
    wireless_mode managed
    wireless_keymode open
  12. Install kernel

    Identify available pre-packaged kernels and install it:

    # apt-cache search linux-image
    # apt-get install linux-image-2.X.X-arch
  13. Set up the Boot Loader

    I use grub, so this is what I have added to the fedora core grub file - "/boot/grub/grub.conf":

    title Ubuntu Dapper
            root (hd0,2)
            kernel /vmlinuz-2.6.15-23-386 ro root=/dev/mapper/vg00-lv00
            initrd /initrd.img-2.6.15-23-686

    Exit out of the chroot and copy over the kernel and initrd image file to the "/boot" mounted boot partition which is on a standard partition (non lvm else grub will not boot).

    # exit
    # cp /mnt/ubuntu/boot/{vmlinuz-2.6.15-23-386,initrd.img-2.6.15-23-386} /boot

    At this point, reboot into your new Ubuntu system to make sure it all works.

  14. Install the Ubuntu Desktop

    # aptitude -y install ubuntu-standard ubuntu-desktop

    This will take a while. Once finished the installation is complete.
    The only thing that needs to be done is change the "/etc/inittab" file for booting into Graphical mode.
    Change the default runlevel from 2 to 5 and and then reboot.

    # The default runlevel.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Add user to audio group for sound device setup

Make sure to add yourself to the audio group else you will not be able to configure and use the audio device. I went through a lot of troubleshooting prior to setting up the right permission!!

To add user to the audio group:

  1. Goto "System > Administration > Users and Groups"
  2. Select the user and click on "Properties".
  3. Click on the "User privileges" tab.
  4. Toggle "Use audio device" to be selected.

Run `gstreamer-properties` to test the plugins.

Reboot after adding the group permissions so the sound server gets started and use the Advanced Linux Sound Architecture (ALSA) instead of the Enlightenment Sound Daemon (ESD).

Firestarter Firewall

If you are as paranoid as me, think about installing the Firestarter Firewall.

# apt-get install firestarter

Need to add the universal apt repository first.

Run firestarter firewall on boot

To get the firestarter firewall to run on boot, generate the firestarter scripts as root once you have it configured via the gui:

# sudo firestarter --generate-scripts

The scripts need to be generated anytime there are changes made to the configuration via the gui.

Apt Software Repository List

My "/etc/apt/sources.list" currently consists of:

deb dapper main restricted
deb-src dapper main restricted

## MAJOR BUG FIX UPDATES produced after the final release
deb dapper-updates main restricted
deb-src dapper-updates main restricted

deb dapper-security main restricted
deb-src dapper-security main restricted

deb dapper universe multiverse
deb dapper-security universe multiverse
deb-src dapper universe multiverse
deb-src dapper-security universe multiverse
deb dapper-backports main restricted
deb dapper-backports universe multiverse
deb-src dapper-backports main restricted
deb-src dapper-backports universe multiverse

deb dapper free non-free
deb-src dapper free non-free

deb dapper main
deb-src dapper main

Thanks to marttis' list.

Synaptics and other tools requiring sudoer rights...

When running synaptics as a normal user, it would prompt for a password... but on typing the root password, it would error out saying:

Failed to run /usr/sbin/synaptic
Wrong password

The solution was to add the user into the sudoer file using `visudo` and adding the below text:

{username} ALL=(ALL) ALL

Usually this is done by the installer, but I must have missed something after the bootstrap.

If you see that synaptics does not run at all, make sure to add the hostname to the "/etc/hosts" file first and then reconfigure postfix:

#cat <<EOF >> /etc/hosts localhost localhost.domain {hostname}
# dpkg-reconfigure postfix