Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
sanboot:debian_and_ubuntu [2007/10/24 14:29] curs0r Method for creating a bootable image under chroot with Ubuntu 7.10 Gutsy Gibbon. |
sanboot:debian_and_ubuntu [2007/12/12 06:11] (current) bengen typo |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Debian or Ubuntu ====== | ====== Debian or Ubuntu ====== | ||
- | |||
- | |||
- | |||
===== Preparing an existing installation for AoE ===== | ===== Preparing an existing installation for AoE ===== | ||
Line 57: | Line 54: | ||
+ | |||
+ | ===== Preparing a chroot installation for AoE ===== | ||
Generating a bootable system image under chroot is very quick and easy. The following instructions will help you prepare a base image for Ubuntu 7.10 Gutsy Gibbon. After your base image is prepared you will be able to reuse that image for full Ubuntu setups (regular, Xubuntu, Kubuntu). Optionally you can proceed from that base with your own custom configuration while still enjoying the stability and support of Ubuntu. | Generating a bootable system image under chroot is very quick and easy. The following instructions will help you prepare a base image for Ubuntu 7.10 Gutsy Gibbon. After your base image is prepared you will be able to reuse that image for full Ubuntu setups (regular, Xubuntu, Kubuntu). Optionally you can proceed from that base with your own custom configuration while still enjoying the stability and support of Ubuntu. | ||
Line 91: | Line 90: | ||
# sudo fdisk /dev/etherd/eX.X #Where X is equal to the values you specified with vblade. | # sudo fdisk /dev/etherd/eX.X #Where X is equal to the values you specified with vblade. | ||
</code> | </code> | ||
- | Fdisk is a fairly straightforward application for partitioning block devices in a terminal. However, you may create your partitions using gparted or any partition utility you wish. For the purposes of running an AoE system you may not want to create a swap file, as using swap will increase the amount of load your system places on the network during usage, and can slow things down dramatically. For the purposes of this guide we will assume you have just used the whole disk for one partition. Now we will need a filesystem for our image. We will use the Ext3 filesystem here. | + | Fdisk is a fairly straightforward application for partitioning block devices in a terminal. However, you may create your partitions using gparted or any partition utility you wish. While running an AoE system you may not want to create a swap file, as using swap will increase the amount of load your system places on the network during usage, and can slow things down dramatically. For the purposes of this guide we will assume you have just used the whole disk for one partition. Now we will need a filesystem for our image. We will use the Ext3 filesystem here. |
<code> | <code> | ||
# sudo mke2fs -j /dev/etherd/eX.Xp1 | # sudo mke2fs -j /dev/etherd/eX.Xp1 | ||
Line 120: | Line 119: | ||
# apt-get update #In case gnupg has the sniffles | # apt-get update #In case gnupg has the sniffles | ||
# apt-get upgrade #It is always better to be certain that you have the latest versions than guess | # apt-get upgrade #It is always better to be certain that you have the latest versions than guess | ||
- | # apt-get install linux-generic grub | + | # apt-get install linux-generic grub aoetools |
</code> | </code> | ||
To make our image bootable, Grub must be setup within the MBR. In order for this to work, we must first create the AoE special devices in our chroot. Then we must discover AoE targets so that we may mount our image under the chroot using the mount point /aoeroot. | To make our image bootable, Grub must be setup within the MBR. In order for this to work, we must first create the AoE special devices in our chroot. Then we must discover AoE targets so that we may mount our image under the chroot using the mount point /aoeroot. | ||
Line 134: | Line 133: | ||
# cp -r /usr/lib/grub/i386/. /boot/grub | # cp -r /usr/lib/grub/i386/. /boot/grub | ||
</code> | </code> | ||
- | Grub will require a file called devices.map to be present under /boot/grub. The contents of this file are quite simple. | + | Grub will require a file called devices.map to be present under /boot/grub. Using the nano text editor we can create this simple file quickly. |
<code> | <code> | ||
# nano /boot/grub/devices.map | # nano /boot/grub/devices.map | ||
Line 146: | Line 145: | ||
Note that this setup still requires the scripts provided on this page, the creation of /etc/fstab, and the creation of /boot/grub/menu.lst. Some users may have difficulty using Gnome unless they add '' iface lo inet loopback'' and ''auto lo'' to /etc/network/interfaces. Always make certain to run ''update-initramfs -c -k all -v'' after any changes to keep your system booting happily. When you are finished creating/customizing /etc/fstab, /boot/grub/menu.lst and /etc/network/interfaces you will have a basic bootable image suitable for reuse. Setting up a new client is as simple as: copy the image, use vblade to make the new image available, mount the image, edit the specifics (ie: /boot/grub/menu.lst, /etc/hosts, etc) then boot from your new client. Once you have booted this basic image, making it a full system is as simple as apt-get install ubuntu-desktop, ubuntu-server, xubuntu-desktop, kubuntu-desktop, or whichever you choose. | Note that this setup still requires the scripts provided on this page, the creation of /etc/fstab, and the creation of /boot/grub/menu.lst. Some users may have difficulty using Gnome unless they add '' iface lo inet loopback'' and ''auto lo'' to /etc/network/interfaces. Always make certain to run ''update-initramfs -c -k all -v'' after any changes to keep your system booting happily. When you are finished creating/customizing /etc/fstab, /boot/grub/menu.lst and /etc/network/interfaces you will have a basic bootable image suitable for reuse. Setting up a new client is as simple as: copy the image, use vblade to make the new image available, mount the image, edit the specifics (ie: /boot/grub/menu.lst, /etc/hosts, etc) then boot from your new client. Once you have booted this basic image, making it a full system is as simple as apt-get install ubuntu-desktop, ubuntu-server, xubuntu-desktop, kubuntu-desktop, or whichever you choose. | ||
+ | ==== Troubleshooting ==== | ||
- | ==== Hint ==== | + | It is possible to get a shell in Debian's and Ubuntu's initial |
- | * If the system hangs before the root device has been mounted, passing ''break=mount'' on the command line will spawn a shell before ''scripts/local-top/aoetools'' is run. This should allow for further debugging. | + | ramdisks at various stages by passing ''debug=<WHEN>'' to the kernel. |
+ | For debugging issues related to a boot device not being found, | ||
+ | ''debug=mount'' is probably most useful. | ||
+ | |||
+ | See ''initramfs-tools(8)'' for further details. | ||
+ | |||
+ | Things to look out for include: | ||
+ | |||
+ | * Has the driver for the NIC been loaded? | ||
+ | * Is the interface "up"? | ||
+ | * Has the ''aoe'' kernel module ben loaded? | ||
+ | * Does ''/dev/aoe/'' exist, does it contain the necessary entries? | ||
Line 201: | Line 212: | ||
case $ROOT in | case $ROOT in | ||
/dev/etherd/e*) | /dev/etherd/e*) | ||
- | # INTERFACES=`awk -F: '/eth[0-9]*:/ { print $1 }' < /proc/net/dev` | ||
INTERFACES=`sed -ne '/eth.*:/{s/:.*$//;p;}' < /proc/net/dev` | INTERFACES=`sed -ne '/eth.*:/{s/:.*$//;p;}' < /proc/net/dev` | ||
for i in $INTERFACES; do | for i in $INTERFACES; do | ||
Line 207: | Line 217: | ||
ifconfig $i up | ifconfig $i up | ||
done | done | ||
- | sleep 5 | + | # Make sure udev has processed all events from adding the NIC |
+ | # modules before loading aoe | ||
+ | [ -x /sbin/udevsettle ] && /sbin/udevsettle --timeout=30 | ||
modprobe aoe | modprobe aoe | ||
+ | # Wait until aoe device files have been generated. | ||
+ | [ -x /sbin/udevsettle ] && /sbin/udevsettle --timeout=30 | ||
aoe-discover | aoe-discover | ||
;; | ;; | ||
esac | esac | ||
</code> | </code> | ||
- | |||
- | ===== Preparing an existing installation for iSCSI ===== | ||
- | TBD | ||