Reply to topic

Welcome to the Knoppix Linux Forums

You are not logged in. Our forum provides a great place to discuss the Knoppix Linux Live CD, as well as other topics such as data recovery using the Knoppix CD or DVD, and general Linux support.

You need to be logged in to post on this forum. If you are not a member you can register by clicking the Register link above.

We hope you enjoy your stay!

How to start HD knoppix with just CD?


Joined: 29 Nov 2003
Posts: 2
Reply with quote
How do I start a harddisk-installed Knoppix using just the Knoppix CD? That is, boot off CD, but run off hard disk?

I installed Knoppix 3.3 onto my laptop's hard disk (hda4) using knx-hdinstall. I did not make a boot floppy as I do not have a floppy drive. I did not specify LILO as I did not want to mess up my finicky WinXP partitions. I thought I could specify at the Knoppix CD boot prompt, something to boot off hda4, using "knoppix fromhd=/dev/hda4", but that did not work. I then tried downloading loadlin.exe and used the hda4's vmlinuz, but I get a message that the WinXP command prompt is not really DOS. I tried (as root in CD Knoppix) mounting /mnt/hda4 and then doing a chroot, but it still ran off the CD.

Can someone help? I want to boot off the Knoppix CD and somehow get the hard disk Knoppix to then take over.

Thanks in advance!
Lynn
View user's profileFind all posts by lynnwgnrSend private message


Joined: 22 Mar 2003
Posts: 555
Reply with quote
I don't think what you want to do is possible. It should be possible to boot off
the CD then direct it to find the big KNOPPIX file on the HD - but that's the so-
called poor man's install, which does not work from an NTFS unit and you've
done the full install anyway. loadlin needs fat and cannot handle NTFS either.
So you should install lilo, really. If you absolutely do not want to allow it to
control your MBR, install it to the start of your root partition (apparently hda4).
Then you can copy the boot sector (a smallish 512 byte file) to your C: drive
but that's gonna be complicated if you have no floppy and C: is NTFS. Well
provided you find a way (hint: explore2fs), then you can create an entry for
linux in the XP boot loader (boot.ini). Frankly that's a lot of trouble to avoid
letting lilo do its job!
View user's profileFind all posts by baldyetiSend private message


Joined: 30 Nov 2003
Posts: 1
Reply with quote
Lynn,
I think this may help you - I use this to run knoppix from my external firewire drive. Which shows just another usage of knoppix - I can hijack about any computer I want and run my complete (adapted) Knoppix environment directly from this computer without installing any single byte on the other computers harddrive ...

What I normally do:

put in the knoppix CD
in the F2 screen (sheatcodes) type
"knoppix single"

which will make knoppix start up in single user mode.

type
sudo su
mkdir /mnt/new_root
to create a mountpoint for your new root.

Then I normally mount my external firewire disk, by first loading the firewire subsystems (you can skip this - I just include it in case someone else wants to run Knoppix from an external firewire or USB drive):

----------------------------------
for firewire:

modprobe ieee1394
modprobe ohci1394
modprobe sbp2

in case your external firewire or USB2 drive is not automatically detected: run the script "rescan-scsi-bus.sh" you find at http://www.garloff.de/kurt/linux/rescan-scsi-bus.sh )
----------------------------------


Here you will have to continue:

mount /dev/hda2 /mnt/new_root (use the partition your knoppix is on - I took /dev/hda2 as an example)
mkdir /mnt/new_root/mnt/old_root (make place to put your current root ...)
cd /mnt/new_root (go to your /dev/hda2 disk)
pivot_root . /mnt/new_root/mnt/old_root (and make it your new root ...)
mount /proc /proc -t proc (Don't know anymore why I added this, but I know I needed it)

which basically remaps your running "root" - the running root becomes /mnt/old_root, and the /mnt/new_root (your knoppix partition) becomes your running root - just as you want.

Then type

init 5

to continue the rest of your startup process from your harddisk partition.
I don't know if this is technically the correct way to do it, but I sure was very glad to find out that it just works ...
In case someone of the more technical people on the board know of a better way to boot firewire (or got any suggestion to improve the above script), I'd like to find out.


Baldyeti,
don't be to quick to say something is impossible with linux Very Happy
View user's profileFind all posts by tinkerSend private message


Joined: 22 Mar 2003
Posts: 555
Reply with quote
Sure. I probably could have come up with something even more contorted to astonish the newbies out there.
Your inventive solution is certainly fine for a portable drive you want to hook to different systems,
...but in the case of a single machine, lilo _is_ a proven boot-loader.
Besides as I originally suggested, the NT/XP bootloader can be used as well.
IMHO, the aim should _not_ be to make linux look complicated.
View user's profileFind all posts by baldyetiSend private message


Joined: 29 Nov 2003
Posts: 2
Reply with quote
Tinker
You are a genius, it works perfectly! I had a feeling there was a way to do it in Linux without having to use LILO. After all this must be what initrd/ramdisk essentially does to use the file system on the CD? LILO is a great boot manager, but in this case I simply did NOT want a hard disk based boot manager. I learned something new today, and am glad that with Linux I am not a sandboxed and patronized lemming end user that some large OS companies would like us to be Smile
Thanks for all your help--your constructive and detailed advice is greatly appreciated!
Lynn

knoppix single (at boot prompt)
sudo su
mkdir /mnt/new_root
mount /dev/hda4 /mnt/new_root
mkdir /mnt/new_root/mnt/old_root
cd /mnt/new_root
pivot_root . /mnt/new_root/mnt/old_root
mount /proc /proc -t proc
init 5
View user's profileFind all posts by lynnwgnrSend private message


Joined: 22 Mar 2003
Posts: 148
Location: Europe
Reply with quote
My heroes.

I've been trying to do something like this (on and off) for months. I've got an old laptop that has no internal HDD but which has access to a firewire drive via a PC Card. I tried building a custom kernel and creating an initrd (via pcinitrd), but it's just too advanced for me. Got a friend to have a go for me, but he too could not manage it.

So I'll test this out this weekend (should work, although I have to make sure pcmcia drivers are loaded as well). If all goes well I'll revisit various threads I've added to/read that discuss this tricky config (booting, or more accurately putting the root on an external USB or 1394 drive) and point them to this thread.

@Baldyeti - I agree that linux should be made easier for the average person, but at the same time it should not be dumbed down. One thing I like about Linux is that if something does not work, I can have a go at understanding and ultimately solving the problem as things are so open. Try doing that under Windows. Also these forums are for discussing advanced topics, learning, leaving linux-newbie-land etc. Anyway if this thing works for my old laptop I'll be very happy :))
View user's profileFind all posts by c123Send private message
Moderator

Joined: 22 Mar 2003
Posts: 871
Reply with quote
This pivot root then init trick works provided that the target root has the same kernel modules as the boot up one(meaning /lib/modules'`uname -r` exists on target). Otherwise, expect troubles.
View user's profileFind all posts by garyngSend private message
Can Be Simpler


Joined: 22 Dec 2003
Posts: 1
Reply with quote
I was just on the Forum looking for exactly this solution. Baldyeti, when I test this, I'll write a script and post it here so that the next person won't need to experience quite as much complexity when doing this maneuver.
View user's profileFind all posts by Win_A_New_HeadSend private message


Joined: 22 Mar 2003
Posts: 148
Location: Europe
Reply with quote
Finally got round to trying this. Works as advertised with Koppix 3.2, will try with latest 3.3 (from 19th November 2003?) soon.

Great, will finally be able to use my old laptop with the dead HDD :)

Win_A_New_Head, if you did write a script that automates this process, I'm interested ;)

Thanks everyone.
View user's profileFind all posts by c123Send private message


Joined: 22 Mar 2003
Posts: 148
Location: Europe
Reply with quote
I tried automating the process, but my 'script' does not work. I start off as normal:

knoppix single (at boot prompt)
sudo su
lsmod (tells me firewire modules are loaded)

Then I goto floppy to run two scripts:

cd /mnt/floppy
ls
./rescan-scsi-bus.sh (first one, works fine)
./start.sh

But that gives me an ":bad interpreter : No such file or directory" error. I don't understand, when I type these commands, all goes well. Anything wrong with the script below? (I have no experience in shell scripting).

Code:

#!/bin/bash
mkdir /mnt/new_root
mount /dev/sda5 /mnt/new_root
mkdir /mnt/new_root/mnt/old_root
cd /mnt/new_root
pivot_root . /mnt/new_root/mnt/old_root
mount /proc /proc -t proc
View user's profileFind all posts by c123Send private message
How to start HD knoppix with just CD?
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 3  

  
  
 Reply to topic