-
Miniboot Disk for Knoppix with Persistent Data as a Virtual Machine Guest OS
Knoppix is great. Knoppix on a USB stick with persistent data is really neat. If you can dual-boot that is: in some places of work it is not considered polite.
If you can't dual boot, you can still run Knoppix in a Virtual Machine. It is not quite as portable but you can still take your persistent data with you. Or at least you used to be able to.
Prior to Knoppix 6 is was possible to save your persistent data to a device other than the one Knoppix is run from. Many people ran Knoppix from CD and saved their persistent data to a (small by today's standards) USB stick. This is no longer possible.
This is a problem for those running Knoppix 6 as a guest OS in a Virtual Machine (such as VirtualBox). Although you can access USB devices from within Virtual Machines, you cannot boot from them. It is possible to boot from a USB stick if it is defined as a 'rawdisk' (a special kind of virtual disk) but the 'rawdisk' may be read-only so you can't save any persistent data to it.
This is Windows®: under Windows® XP you can write to a 'rawdisk' used as a boot device but under Windows® 7 you can't. It's an security thing.
The simply way around this is to redirect the Knoppix boot using the fromhd= cheatcode.
To set it up, you arrange for the Virtual Machine to boot a Knoppix CD/DVD image and you connect your USB stick as a USB device. Boot up Knoppix and do an 'install to USB' onto the USB device.
To use it, you reboot the Virtual Machine and let it boot from the CD/DVD image but stop it at the boot prompt. Enter (depending on how many Virtual Disks the Virtual Machine has):
Code:
knoppix fromhd=/dev/sdb1
The Knoppix boot is redirected to the USB stick, to which you have read/write access, so Koppix can create and use a persistent store on the USB stick.
You need two copies of Knoppix to run just one. This has two minor inconveniences: it is just a little too easy to boot the wrong one and it isn't as portable as single copy on a USB stick.
The notes below describe how to do a manual 'install to USB' of just enough to be able to Knoppix on another device. This cuts the ~ 3.5 Gb needed for a full 'install to USB' down to less than 8 Mb. A Virtual Disk this small is easily backed up on the USB stick itself giving a transportable, if not portable, solution.
These notes were prepared with reference to the script /usr/bin/flash-knoppix from Knoppix 6.4.3.
1 . Add a new Virtual Disk to your Virtual Machine, Make it 'expandable' to a maximum size of 8 Mb. Arrange the Virtual Machine's device to boot Knoppix from a CD/DVD image and to have the new Virtual Disk as the IDE 'primary master'.
2. Boot Knoppix and open a console. Check /dev/sda exists and that /dev/sda1 doesn't (inspect the output of ls -l /dev/disk/by-id).
3. Create a single partition on /dev/sda that occupies the full disk. If you use cfdisk /dev/sda, the selection sequence is [New] / [Primary] / all / [Bootable] / [Write] / yes / [Quit].
4. Now enter the commands below as shown:
Code:
# Write boot sector
ms-sys -s /dev/sda
# Make Linux read the partition table
sudo blockdev --rereadpt /dev/sda
# Create a vfat file system
mkdosfs /dev/sda1
# Knoppix should automatically mount the new filesystem, if not ...
sudo mkdir -p /media/sda1
sudo mount /dev/sda1 /media/sda1
# Install the boot loader
syslinux /dev/sda1
# Copy boot files
rsync -ax /mnt-system/boot /media/sda1
cd /media/sda1/boot
# If you've copied from an 'install to USB', skip the rest
mv -f {iso,sys}linux
mv -f syslinux/{iso,sys}linux.cfg
rm -f syslinux/isolinux.bin
5. To make the mini boot disk automatically redirect the boot to the USB you need to edit syslinux/syslinux.cfg. Here's a suggestion:
Code:
sed -e '/APPEND ramdisk/s~$~ fromhd=/dev/sdc1~' -i syslinux/syslinux.cfg
Make sure you don't leave out the space before fromhd=.
This assumes /dev/sda will be the mini boot disk, /dev/sdb will be the main disk (with swap partition if nothing else) and the USB stick will show up as /dev/sdc.
6. Shut down the Virtual Machine. Change its configuration so that is doesn't boot the CD/DVD image. Add a second, larger, Virtual Disk for swap space and stuff. Make sure it isn't the IDE primary master.
7. Start the Virtual Machine again.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Juniper Networks EX3300 EX3300-48P 48-Port Gigabit PoE+ Switch
$37.20
Juniper EX4300-48P 48 Port PoE Gigabit Network Switch - COMES WITH DUAL POWER
$325.00
Juniper EX3300-48P 48-Port 10/100/1000BASE-T (48 PoE+ ports) with 4 SFP+
$74.00
JUNIPER EX3400-48P 48x 1GB PoE+ RJ-45 4x 10GB SFP+ 2x 40GB QSFP+, DUAL AC POWER
$168.00
Juniper Networks EX3300 EX3300-48P 48-Port Gigabit PoE+ Switch
$59.95
Juniper EX2200-C-12T-2G 12-Port 10/100/1000 2x SFP Uplinks Compact Switch
$89.99
Juniper Networks SRX320-POE 6-Port Service Gateway Security Appliance Tested
$149.99
Juniper SRX320 8-Port Security Services Gateway Appliance w/ Rack Ears
$99.97
Juniper Networks EX3300 EX3300-48P PoE+ 48-Port 4x SFP Gigabyte Ethernet Switch
$59.99
Juniper EX 4300 EX4300-48P Gigabit Network Switch JunOS 21.4R3-S7 48 Port PoE
$249.00