Jansi
02-02-2005, 07:17 PM
Hi people -- because of problems with LILO on the current release of KNOPPIX (3.7), I was finally inspired to delve in to GRUB... needless to say, I am no expert on GRUB (or anything Linux/KNOPPIX for that matter!). But for the people like me who simply want to be able to boot a "Poor Man's Installation" from an old windows workhorse, I decided to clean-up the (very explicit) outline I wrote for my own use and share it with you. I've tested the general procedure on several computers -- but so far I've only on one true Win2k installation like I describe below (my own home one -- the other 3 computers I tested it on in the past 2 days were trashed old ones with no OS on them - these instructions worked with very minimal simplifying). I am going to try it on another Windows installation this afternoon I hope, with a friend's permission. Eventually, when I clean this up, I'm thinking this should go in the docs right above this:
http://www.knoppix.net/wiki/Hd_Based_HowTo#1.2.1._Knoppix_3.4_version_only
I've been using those for some time, well over a dozen times on computers for public kiosk use among other things (thanks, RD! And Marcus for reformatting it) -- but it is starting to be problematic that those instructions don't really apply past 3.4 anymore for me without a bunch of LILO fussiness. Mine apply to at least 3.7, and I'd guess everything since 3.4.
Incidentally, part of the reason I like the "Poor Man's Installation" (besides its iron-clad public kiosk suitability) is that lately whenever a friend or family member with DSL asks me to "fix their computer" I do, but lately my "price" is that they get a dual-boot Poor Man's Install of KNOPPIX! They could care less -- their computer gets fixed, and as the only new feature is that their computer pauses for 5 seconds at the LILO screen... and when I point out to them that they can do all the browsing, emailing, chatting, printing, word-processing, etc., in KNOPPIX -- but without the incessant spyware and virus problems and subtle "dues to Microsoft" -- their interest is piqued. In one case where the visiting neighborhood kids were trashing the Windows installation on a monthly basis, LILO defaults to KNOPPIX, and the family only boots to windows to run educational software they bought for their own kids! (Hey, I tried getting wine to run 'em).
Anyway, here is what I have so-far, more-or-less formatted. If there are any glaring errors (like in my GRUB invocation) or clearly unneeded steps, feel free to respond to this thread.
============================
Dual Booting Win2k and "KNOPPIX tohd=" installation (aka "Poor Man's Install") using GRUB:
Introduction
For me, GRUB has significant advantages over LILO for a Poor Man’s install, because GRUB allows the user to change boot options merely by editing a text file, without LILO’s requirement to rewrite the MBR each time a change is made. GRUB also allows you to experiment with different options at boot time, and helps debug a configuration that isn’t working.
Below are the steps I took to make a Poor Man’s installation of KNOPPIX dual-bootable with a pre-existing Win2k installation. The instructions assume thatyour computer has one hard drive setup as one big partition formatted in FAT32, with Win2k installed. If that isn't the case with your computer, you'll need to improvise. I know the below works because I did my computer as I typed the draft of this document.
Know that GRUB (like LILO) will be installed on the MBR of your hard drive, so if you are afraid of losing whatever is on there now, you might want to back-up the MBR (google "dd if=/dev/hda of=/dev/fd0 bs=512 count=1"). And I'd also strongly suggest backing up anything else in your Win2k installation you can't live without.
Overview
To do a "Poor Man's Install" of KNOPPIX on a computer with Win2k installed, I chose to divide my hard drive in to 4 partitions, like this:
hda1 -- FAT32, ~8 gig. This will hold the Win2k installation and also the KNOPPIX image. Know that you will need at least an extra gig over your Win2k needs to hold the KNOPPIX image; beyond that, I generally want this to be "the big partition", since ultimately it can be storage for both Win2k and Linux.
hda2 -- ext2, ~1 gig. This will hold the KNOPPIX persistent home directory (a gig or so is fine for me)
hda3 -- ext2, ~32 meg. This will hold the KNOPPIX and GRUB boot files, plus the KNOPPIX config file (if you want one).
hda4 -- Linux swap, ~500 meg. will be my Linux swap file. It should be at least 256 meg, IMO
Since the Win2k installation was on one partition that filled the entire drive, I needed to repartition the drive to make room for the other 3 partitions. [NOTE: if you won't be having a second OS on the drive, then just use cfdisk to delete all partitions, the set them to the above partition and formatting specs, and ignore parts below pertaining to Windows]
Procedure (or "How I Did It"):
- The goal for me was to squeeze the FAT32 partition (hda1) with Windows on it in order to fit three more partitions on my drive. To squeeze hda1, I used the linux tool QTParted. Just boot the KNOPPIX CD and type "sudo qtparted &" at a terminal window. With QTParted open, simply slide the right-edge of the Windows partition to give the one or two gigs needed for hda2, hda3, hda4. Remember to leave enough room on hda1 (about 1 gig) for your KNOPPIX image.
- After you press “Commit”, you must completely shut down the computer - type “sudo shutdown -h now" in the term.
- Boot the computer from KNOPPIX CD, at KNOPPIX splash screen prompt type:
knoppix 2 noswap [and anything else you need to get your particular computer booted, like "nodma", etc.]
- Once booted to the command prompt ("root@tty1[/]#"), type "cfdisk"
- From within cfdisk: create 3 partitions out of the free space in accordance with the guidelines in "Overview." For the last partition (hda4), select type "Linux swap" (type 82). The other two should already be type "Linux" by default. Be sure not to alter the first partition. If you make any mistakes in cfdisk, press "Q" to quit without making changes. When you are sure everything is as-you-want-it, use the arrow keys to select "Write" to finalize the partitions, then quit cfdisk and completely shut down the computer ("shutdown -h now" at the root prompt).
- Boot again from the KNOPPIX CD, but this time with the options "knoppix 2 tohd=/dev/hda1"
- Once booted to the root prompt (which will take a while as the CD is copied to hda1), type the following commands:
mkfs /dev/hda2
mkfs /dev/hda3
mount /dev/hda3 /mnt/hda3
cd /mnt/hda3
cp /boot/* .
cp /mnt/cdrom/boot/isolinux/minirt24.gz .
mkdir grub
mount /dev/hda3 /boot
cd /boot/grub
emacs menu.lst
- In emacs, enter these lines:
default=1
timeout=20
#splashimage=(hd0,2)/grub/hello.xpm.gz
title Win
rootnoverify (hd0,0)
chainloader +1
title Knoppix
kernel (hd0,2)/vmlinuz fromhd=/dev/hda1 lang=en apm=power-off hda=scsi hdb=scsi hdc=scsi hdd=scsi hde=scsi hdf=scsi hdg=scsi hdh=scsi
initrd (hd0,2)/minirt24.gz
boot
- Save the file (Ctrl-x Ctrl-s) and exit (Ctrl-x Ctrl-c). At the prompt type:
grub-install hd0
Grub will probably spit-out a lot of non-critical errors (at least I see them - should I do something different?), and it might take a few seconds (looking like it is frozen). But importantly, at the end of all the all the messages you should see "Installation finished. No error reported."
- Now type
shutdown -r now
- Remember to eject the KNOPPIX CD, then hit Enter to let the computer reboot from the new installation. BTW, running "grub-install hd0" was the point where overwrote your old MBR. And while it probably spit-out a lot of non-critical errors, don't worry. Mine did that to, but worked just fine.
- If you did everything according to the steps, KNOPPIX should boot completely. Once booted, set-up your network info, printers, desktop, screensaver, and anything else you might want, then save your KNOPPIX configuration to /dev/hda3. Next create a persistent home directory in /dev/hda2. Both of the latter steps can be done under the KNOPPIX menu entry “Configure”
- Next you need to edit menu.lst to tell the KNOPPIX kernel about your new persistent home directory and saved configuration. My way: open a term and type:
su
mount /dev/hda3 /mnt/hda3
emacs /mnt/hda3/grub/menu.lst &
- In emacs, add "home=/dev/hda2" and "myconfig=/dev/hda3" to the kernel line. And if you want WIndows to be the default boot, change the "default=1" to "default=0"
Here is my entire menu.lst file as an example:
default=0
timeout=20
#splashimage=(hd0,2)/grub/hello.xpm.gz
title Win
rootnoverify (hd0,0)
chainloader +1
title Knoppix
kernel (hd0,2)/vmlinuz fromhd=/dev/hda1 home=/dev/hda2 config=/dev/hda3 \
lang=en apm=power-off hda=scsi hdb=scsi hdc=scsi hdd=scsi hde=scsi \
hdf=scsi hdg=scsi hdh=scsi
initrd (hd0,2)/minirt24.gz
boot
- Save the file and exit emacs and reboot. You are done.
http://www.knoppix.net/wiki/Hd_Based_HowTo#1.2.1._Knoppix_3.4_version_only
I've been using those for some time, well over a dozen times on computers for public kiosk use among other things (thanks, RD! And Marcus for reformatting it) -- but it is starting to be problematic that those instructions don't really apply past 3.4 anymore for me without a bunch of LILO fussiness. Mine apply to at least 3.7, and I'd guess everything since 3.4.
Incidentally, part of the reason I like the "Poor Man's Installation" (besides its iron-clad public kiosk suitability) is that lately whenever a friend or family member with DSL asks me to "fix their computer" I do, but lately my "price" is that they get a dual-boot Poor Man's Install of KNOPPIX! They could care less -- their computer gets fixed, and as the only new feature is that their computer pauses for 5 seconds at the LILO screen... and when I point out to them that they can do all the browsing, emailing, chatting, printing, word-processing, etc., in KNOPPIX -- but without the incessant spyware and virus problems and subtle "dues to Microsoft" -- their interest is piqued. In one case where the visiting neighborhood kids were trashing the Windows installation on a monthly basis, LILO defaults to KNOPPIX, and the family only boots to windows to run educational software they bought for their own kids! (Hey, I tried getting wine to run 'em).
Anyway, here is what I have so-far, more-or-less formatted. If there are any glaring errors (like in my GRUB invocation) or clearly unneeded steps, feel free to respond to this thread.
============================
Dual Booting Win2k and "KNOPPIX tohd=" installation (aka "Poor Man's Install") using GRUB:
Introduction
For me, GRUB has significant advantages over LILO for a Poor Man’s install, because GRUB allows the user to change boot options merely by editing a text file, without LILO’s requirement to rewrite the MBR each time a change is made. GRUB also allows you to experiment with different options at boot time, and helps debug a configuration that isn’t working.
Below are the steps I took to make a Poor Man’s installation of KNOPPIX dual-bootable with a pre-existing Win2k installation. The instructions assume thatyour computer has one hard drive setup as one big partition formatted in FAT32, with Win2k installed. If that isn't the case with your computer, you'll need to improvise. I know the below works because I did my computer as I typed the draft of this document.
Know that GRUB (like LILO) will be installed on the MBR of your hard drive, so if you are afraid of losing whatever is on there now, you might want to back-up the MBR (google "dd if=/dev/hda of=/dev/fd0 bs=512 count=1"). And I'd also strongly suggest backing up anything else in your Win2k installation you can't live without.
Overview
To do a "Poor Man's Install" of KNOPPIX on a computer with Win2k installed, I chose to divide my hard drive in to 4 partitions, like this:
hda1 -- FAT32, ~8 gig. This will hold the Win2k installation and also the KNOPPIX image. Know that you will need at least an extra gig over your Win2k needs to hold the KNOPPIX image; beyond that, I generally want this to be "the big partition", since ultimately it can be storage for both Win2k and Linux.
hda2 -- ext2, ~1 gig. This will hold the KNOPPIX persistent home directory (a gig or so is fine for me)
hda3 -- ext2, ~32 meg. This will hold the KNOPPIX and GRUB boot files, plus the KNOPPIX config file (if you want one).
hda4 -- Linux swap, ~500 meg. will be my Linux swap file. It should be at least 256 meg, IMO
Since the Win2k installation was on one partition that filled the entire drive, I needed to repartition the drive to make room for the other 3 partitions. [NOTE: if you won't be having a second OS on the drive, then just use cfdisk to delete all partitions, the set them to the above partition and formatting specs, and ignore parts below pertaining to Windows]
Procedure (or "How I Did It"):
- The goal for me was to squeeze the FAT32 partition (hda1) with Windows on it in order to fit three more partitions on my drive. To squeeze hda1, I used the linux tool QTParted. Just boot the KNOPPIX CD and type "sudo qtparted &" at a terminal window. With QTParted open, simply slide the right-edge of the Windows partition to give the one or two gigs needed for hda2, hda3, hda4. Remember to leave enough room on hda1 (about 1 gig) for your KNOPPIX image.
- After you press “Commit”, you must completely shut down the computer - type “sudo shutdown -h now" in the term.
- Boot the computer from KNOPPIX CD, at KNOPPIX splash screen prompt type:
knoppix 2 noswap [and anything else you need to get your particular computer booted, like "nodma", etc.]
- Once booted to the command prompt ("root@tty1[/]#"), type "cfdisk"
- From within cfdisk: create 3 partitions out of the free space in accordance with the guidelines in "Overview." For the last partition (hda4), select type "Linux swap" (type 82). The other two should already be type "Linux" by default. Be sure not to alter the first partition. If you make any mistakes in cfdisk, press "Q" to quit without making changes. When you are sure everything is as-you-want-it, use the arrow keys to select "Write" to finalize the partitions, then quit cfdisk and completely shut down the computer ("shutdown -h now" at the root prompt).
- Boot again from the KNOPPIX CD, but this time with the options "knoppix 2 tohd=/dev/hda1"
- Once booted to the root prompt (which will take a while as the CD is copied to hda1), type the following commands:
mkfs /dev/hda2
mkfs /dev/hda3
mount /dev/hda3 /mnt/hda3
cd /mnt/hda3
cp /boot/* .
cp /mnt/cdrom/boot/isolinux/minirt24.gz .
mkdir grub
mount /dev/hda3 /boot
cd /boot/grub
emacs menu.lst
- In emacs, enter these lines:
default=1
timeout=20
#splashimage=(hd0,2)/grub/hello.xpm.gz
title Win
rootnoverify (hd0,0)
chainloader +1
title Knoppix
kernel (hd0,2)/vmlinuz fromhd=/dev/hda1 lang=en apm=power-off hda=scsi hdb=scsi hdc=scsi hdd=scsi hde=scsi hdf=scsi hdg=scsi hdh=scsi
initrd (hd0,2)/minirt24.gz
boot
- Save the file (Ctrl-x Ctrl-s) and exit (Ctrl-x Ctrl-c). At the prompt type:
grub-install hd0
Grub will probably spit-out a lot of non-critical errors (at least I see them - should I do something different?), and it might take a few seconds (looking like it is frozen). But importantly, at the end of all the all the messages you should see "Installation finished. No error reported."
- Now type
shutdown -r now
- Remember to eject the KNOPPIX CD, then hit Enter to let the computer reboot from the new installation. BTW, running "grub-install hd0" was the point where overwrote your old MBR. And while it probably spit-out a lot of non-critical errors, don't worry. Mine did that to, but worked just fine.
- If you did everything according to the steps, KNOPPIX should boot completely. Once booted, set-up your network info, printers, desktop, screensaver, and anything else you might want, then save your KNOPPIX configuration to /dev/hda3. Next create a persistent home directory in /dev/hda2. Both of the latter steps can be done under the KNOPPIX menu entry “Configure”
- Next you need to edit menu.lst to tell the KNOPPIX kernel about your new persistent home directory and saved configuration. My way: open a term and type:
su
mount /dev/hda3 /mnt/hda3
emacs /mnt/hda3/grub/menu.lst &
- In emacs, add "home=/dev/hda2" and "myconfig=/dev/hda3" to the kernel line. And if you want WIndows to be the default boot, change the "default=1" to "default=0"
Here is my entire menu.lst file as an example:
default=0
timeout=20
#splashimage=(hd0,2)/grub/hello.xpm.gz
title Win
rootnoverify (hd0,0)
chainloader +1
title Knoppix
kernel (hd0,2)/vmlinuz fromhd=/dev/hda1 home=/dev/hda2 config=/dev/hda3 \
lang=en apm=power-off hda=scsi hdb=scsi hdc=scsi hdd=scsi hde=scsi \
hdf=scsi hdg=scsi hdh=scsi
initrd (hd0,2)/minirt24.gz
boot
- Save the file and exit emacs and reboot. You are done.