Boot disk
3 Feb 2003

Summary

Failed to create a functional bootdisk. You did succeed in creating a workable Knoppix system, however -- put in the round CD sleeve pouch -- which should give you access to any system.

Software and guides

Configuration history

21 July 2007: cloning a partition

Cloned Prato's / and /home partitions, along with MBR and partition map, from a drive mounted on Chianti, to compressed files on chi:/tvspare/partimage, and then restored them to lucca's second and now unused drive. Very fast and clean -- main obstacle is that you have to have the source drive removed. Once you have a good image, you can just duplicate it. See details in

You could use clonezilla to clone a drive on any computer by booting with a USB stick or CD.

28 November 2006: cloning a partition (successfully)

Installing the OS on a second drive while the first is running
(can be used to duplicate the OS on a current machine)
==============================================================

 1. Attach the new drive -- say, a SATA drive
 2. Boot with a recent Debian install CD
 3. Format the new drive (and write the file system?)
 4. Copy the old partition to the new partition -- a new /etc/fstab gets created
 5. Exit the installer and reboot
 6  Enter the BIOS and set the new hard drive to boot first, then reboot
 7. Pause in grub and find the new drive
    -- the new drive should now be (hd0,0) as defined in the BIOS
 6. Boot into the new partition
 7. Run grub-install /dev/sda to generate a new and correct /boot/grub/device.map
    -- you may actually have to define the values yourself
 8. Edit /boot/grub/menu.lst if necessary, to reflect the new root drive
 9. Run update-grub

You may need to edit /etc/kernel-img.conf -- update-grub moved in Sep. 06:

        do_symlinks = yes
        relative_links = yes
        do_bootloader = no
        do_bootfloppy = no
        do_initrd = no
        link_in_boot = yes
        postinst_hook = /usr/sbin/update-grub
        postrm_hook   = /usr/sbin/update-grub

The last two lines need "/usr/sbin/" and not just "/sbin".
I also set "do_initrd" to no.

19 October 2006: cloning a drive (failed)

On the new Spello (GA KNSC-939), the OS runs on an old 10GB drive, and I cloned it for safety. I first tried using instructions as below:

dd if=/dev/hdb  of=/dev/sda

This simple dd failed because the drives (although the same nominal size) were of slightly different sizes. I had to use fdisk to remove the partitions. I then used dd to copy the MBR:

dd if=/dev/hdb of=/dev/sda  bs=446 count=1

Then I just created new partitions and used this to copy over the files:

tar -cSpf - . | tar -xvSpf - -C /mnt/usb

That sort of worked -- but it copies recursively after a while and I had to interrupt it and then copy each directory manually:

tar -cSpf - home | tar -xvSpf - -C /mnt/usb
That may have done the trick, but this is not satisfactory.

13 June 05: installing grub from a floppy

You could try installing grub from a boot floppy. It'd be something like:

After chrooting, you may need to do this:
mount -o bind /dev /target/dev
Otherwise the chroot may not see the /dev files.
grub> root (hd0,0)
grub> setup (hd0)
Replacing (hd0,0) with the partition that contains grub (e.g. /boot or if you don't have one, /).

Or wipe the MBR:
dd if=/dev/zero of=/dev/sda bs=446 count=1
Write a new MBR:
dd if=/dev/sda of=MBR_new.img
Don't try this at home :-)

26 Feb 03: Recovering a lost MBR

On 26 Feb 03 I installed Libranet Debian on Kris's IBM laptop,  wiping his hard drive rather than shrinking the XP partition. On 3 March 03 we installed XP, which took over the master boot record (MBR). To get it back, use the Debian miniCD  (it may also be possible to use Knoppix or the Libranet CD) and mount the root directory, in this case /target. Then get a console.  Then the crucial step:

    chroot /target

This gives you access to the installed programs. Mount the /boot directory as -t ext2 (ext3 is not available) and issue

    grub-install  /dev/hda

That reclaims the MBR and you can boot into Linux. To boot into XP, just modify /boot/grub/menu.lst.  See more useful details.

9.3 How can I make a custom boot floppy?

This task is greatly aided by the Debian package boot-floppies, normally found in the admin section of the Debian FTP archive. Shell scripts in this package produce boot floppies in the SYSLINUX format. These are MS-DOS formatted floppies whose master boot records have been altered so that they boot Linux directly (or whatever other operating system has been defined in the syslinux.cfg file on the floppy). Other scripts in this package produce emergency root disks and can even reproduce the base disks.

You will find more information about this in the /usr/doc/boot-floppies/README file after installing the boot-floppies package.

"Creating a Boot diskette

Creating a Linux boot diskette is easy. Use "uname -a" to determine your current kernel version number (example: 2.2.17-14). Then run "mkbootdisk kernel-version". Example: " mkbootdisk 2.2.17-14"." Source.

Paud

http://paud.sourceforge.net/

This finally looks like a decent boot disk. Of course you'll soon be able to use Debian.

Rescue disk

http://perens.com/FreeSoftware/

Knoppix -- project site

Knoppix is really a Linux demo CD, but it can be used to rescue a computer, even one that runs a non-Linux operating system. On 4 Aug 2002 I downloaded the ISO image from the gwdg site in Goettingen. See FAQ for instructions.

The following Highlights are available in version 3.1 of this Debian-based (www.debian.org) CD:

  • Linux-Kernel 2.4.x
  • KDE V3.0.2 as the standard desktop with K Office and the Konqueror WWW-browser konqueror
  • X Multimedia System (xmms) an MPEG-video, MP3, Ogg Vorbis Audio player and xine
  • Internet connection software kppp,pppoeconf (DSL) and isdn-config
  • Gnu Image Manipulation Program (GIMP) Version 1.2
  • utilities for data recovery and system repairs, even for other operating systems
  • network and security analysis tools for network administrators
  • OpenOffice(TM), the GPL-developed version of the well-known StarOffice(TM) office suite
  • many programming languages, development tools (including kdevelop) and libraries for developers
  • in total more than 900 installed software packages with over 2000 executable user programs, utilities, and games

I used xcdroast to burn the CD.

Demo-linux

http://www.demolinux.org/

Bootable CD

For instructions, see http://www.tldp.org/HOWTO/Bootdisk-HOWTO/cd-roms.html. The basic idea is that you place a bootable floppy image on the CD, along with all the other programs. So first you need a bootable floppy!

Not tried

"Under Linux, use "dd if=/cdrom/disks/rescue of=/dev/fd0" to create a rescue floppy disk." -- this is likely equivalent to making a rescue disk through Yast2. I've successfully made a boot disk through Yast2. Still, I don't really have a handle on this.

The dd command is essentially equivalent to rawrite on DOS. You can create a bootable floppy disk by issuing

dd if=mounted_cdrom_directory/KNOPPIX/boot.img of=/dev/fd0 bs=18k

The example here is Knoppix, but you could do this with any boot image.

Moving the /boot partition

On 5 July, I wanted to move my main Linux hard drive on gubbio, /dev/hdc/, from the motherboard hard drive controller to the pci board hard drive controller, to run it off an 80-pin cable.

I changed all instances of dev/hdc in /etc/fstab to /dev/hdh and rebooted. For some reason I get this:

Kernel panic: No init found. Try passing init= option to kernel

You can edit grub and tell it to look for the boot partition in another location.

 

 

top
Debate
Evolution
CogSci

Maintained by Francis F. Steen, Communication Studies, University of California Los Angeles


CogWeb