PDA

View Full Version : Can I boot from iso but still use persistent memory?



rajibando
01-09-2013, 04:06 PM
Is it possible that I boot from an iso image using Grub and loopback command, and still be able to use persistent memory, so that my settings and choices are carried on to the next boot?
If possible, that would be great. You know, knoppix from iso is faster and smoother than hard drive installed Debian system!

Capricorny
01-10-2013, 01:20 PM
I just can't understand why you don't just use a Poor Man's Install (PMI) instead. AFAIK, there is no way Knoppix from ISO could be smoother and faster than the very same KNOPPIX cloop file from the ISO directly cloop-mounted on (the same) disk. And you can drop the KNOPPIX-directory practically anywhere there is room for it, using the knoppix_dir cheatcode you can have as many different versions in use as you like. If you want to run it read-only, you can use the noimage cheatcode. Etc etc. Space requirements are roughly the same etc. And no hassle with persistent store - user data, program updates and installs, not only settings/choices, are preserved.

I know of only one occasion where running the ISO from disk is, arguably, a very good solution: Setting up a new version. Then grub2 can be used to boot it, but why not use qemu/kvm for that instead, then the setup can be done with no reboot at all, as far as I remember (Did it with 7.0.3 ISO, I think.)

Of course, I would like to be informed about new use cases. But,having used Knoppix PMIs as my main daily system for about 5 years now, trying out a lot of other alternatives (like ordinary hard disk install, running the ISO, running from cards and sticks and mobile phones) with none of them being able to compete in efficiency and flexibility, I tend to consider quite a few Knoppix users as rather masochistic :)

rajibando
01-10-2013, 04:29 PM
Let us change the subject and use
How to boot using the Knoppix cloop file within the iso

rajibando
01-10-2013, 04:34 PM
I just can't understand why you don't just use a Poor Man's Install (PMI) instead. AFAIK, there is no way Knoppix from ISO could be smoother and faster than the very same KNOPPIX cloop file from the ISO directly cloop-mounted on (the same) disk.

How do you differentiate between the two?
Suppose, if I downloaded the Knoppix files using bittorrent client, and have the folder with the following files:



dpkg-l-dvd-704.txt
KNOPPIX_V7.0.4DVD-2012-08-20-EN.iso.md5
info
KNOPPIX_V7.0.4DVD-2012-08-20-EN.iso.md5.asc
knoppix-cheatcodes.txt
KNOPPIX_V7.0.4DVD-2012-08-20-EN.iso.sha1
KNOPPIX.iso
KNOPPIX_V7.0.4DVD-2012-08-20-EN.iso.sha1.asc

I mount the iso file, using the code:
mount -o loop -t iso9660 /media/sdax/KNOPPIX/KNOPPIX.iso /media/cdrom0
Are you talking about the file /media/cdrom0/KNOPPIX which is 3.8 GB (4072328837 bytes) for the 7.0.4 version when you are talking about cloop?
And how do you use the cloop code to boot the cloop file from grub?



And you can drop the KNOPPIX-directory practically anywhere there is room for it, using the knoppix_dir cheatcode you can have as many different versions in use as you like. If you want to run it read-only, you can use the noimage cheatcode. Etc etc. Space requirements are roughly the same etc.
I get it, then how to I accomplish this when I have bought a brand new system and have to data or partition in the drive?
should I boot using Knoppix DVD, partition the drive using gparted, then copy the knoppix file using tohd?


And no hassle with persistent store - user data, program updates and installs, not only settings/choices, are preserved.
Please, please, tell me the steps!




but why not use qemu/kvm for that instead, then the setup can be done with no reboot at all, as far as I remember (Did it with 7.0.3 ISO, I think.)
Then how do I use qemu/kvm to configure the MBR?


Of course, I would like to be informed about new use cases. But,having used Knoppix PMIs as my main daily system for about 5 years now, trying out a lot of other alternatives (like ordinary hard disk install, running the ISO, running from cards and sticks and mobile phones) with none of them being able to compete in efficiency and flexibility
Should this mean I use the contents in http://smtp.knoppix.net/wiki/Category:Hard_drive_Installation#Poor_man.27s_inst all with the old tohd cheatcode and create persistent drive? And then use grub to boot the knoppix cloop file? I have to learn this cloop option from you. It sounds pretty interesting!


I tend to consider quite a few Knoppix users as rather masochistic :)
I do not wish to be identified as one:)!

Capricorny
01-10-2013, 05:13 PM
I advise you to download the 7.0.5DVD image and work from there. Forget the 7.0.4 if you have no special reason to stay with it. You need only one, and you don't have to rename that file if you download it from one one of the standard mirrors.

The simplest route to PMI with minimal use of tools, is burning the image (or booting it with grub2), and use the flash-knoppix. Install Knoppix to flash disk to transfer to USB media. Then a persistent store will be created with the install, and you can boot from that. If you look into the KNOPPIX directory, you see the huge KNOPPIX file, that's a compressed cloop image that will be cloop-mounted when you boot up Knoppix - it's similar to ordinary loop, but uses cloop compression. (There are alternatives for compression, but that's nothing to bother about for now.)

After having checked that the USB medium boots and runs fin, you can install programs and make tweaks etc, I would suggest you copy the whole KNOPPIX directory from the USB to somewhere on the harddisk where there is room for it. It's no big problem really, unless you grow your persistent store, the thing will not change in size afterwards, and only the loop-mounted persistent store file knoppix-data.img is ever written to. So an NTFS partition is fine, FAT32 and the standard Linux file types also works.

Now. the next time you boot from the USB medium, Knoppix will suddenly not use the install there other than for booting the kernel and starting up, it will search for KNOPPIX on the hard disk and find and run the copy you made there. That's another reason it may be practical to call the Knoppix directory you copy into something slightly different, I use KNOPPIX705 for current Knoppix - try that.

If you have a 64-bits CPU, next time you can boot from USB with the parameters knoppix64 knoppix_dir=KNOPPIX705, and you will run a 64-bits kernel (using all system memory on the PC) and the hard disk KNOPPIX copy. Maybe you have to use a fromhd=/dev/sdaX parameter too, I always use it because I may have several KNOPPIX705's spread around. You backup and copy the whole thing just by backing up the knoppix-data.img, with USB3 sticks, that goes fairly quickly even with USB2 ports.

When you have gotten used to this, and become familiar with the parts, it may be time to proceed, if you want to. But you don't really have to think much about low level stuff, if you are not inclined to do. If you use qemu/kvm to run the ISO and create the first bootable USB medium for example, you still use the flash-knoppix service to make it bootable.

Myself, I mostly use legacy grub for booting. But that's another story.
Good luck!

Capricorny
01-10-2013, 05:26 PM
You can partition a drive using Knoppix either on USB or CD/DVD - I use USB whenever I can, and I use fdisk out of old habit, but use the available tool you like best. Also, Knoppix considerations are probably the least important for how you setup the drive, unless you plan ordinary hard disk installs later. Knoppix just needs ca 8GB of disk space somewhere. You don't have to install a bootloader at once, Knoppix can boot the computer from USB.

When I say 'copy' I mean using something like cp or rsync.

rajibando
01-11-2013, 05:48 PM
I acknowledge your compassion and hard work for your post above, and profusely thank you.

I had once collected data and posted the issue in the Debian Forum:
http://forums.debian.net/viewtopic.php?f=5&t=52419&start=15#p369551
However, as Grub has given way to Grub2 the system changed a bit, I was confused about the issue, and I experimented before I could be successful, and your help was indispensible. The process is way easier than the method you have suggested.
The process is given in http://smtp.knoppix.net/wiki/Category:Hard_drive_Installation#Persistent_memory
create an entry within '/boot/grub/menu.lst' (GRUB legacy)

title Knoppix
kernel (hd0,x)/BOOT/isolinux/linux
initrd (hd0,x)/BOOT/isolinux/minirt.gz

use your own value! "(hd0,0)" means first hard drive and first partition if you use GRUB legacy; with GRUB 2 take "(hd0,1)" for first hard drive and first partition.

Plain and simple copy paste the KNOPPIX (only the large KNOPPIX file is required within the KNOPPIX folder, and nothing else) as root and BOOT folders in the drive from where we would like to boot the cloop file.

The work is accomplished!

---------------------------------------
There has been an error in the wiki with "(hd0,0)" and GRUB legacy; I've corrected it and edit your posting.
wps

Capricorny
01-12-2013, 12:02 AM
The reason I don't use that approach myself, is that it doesn't scale well, and with rather small adjustments, it becomes a very general booting method.

First, for defensive practice, I try to avoid booting from a partition in much use, like where /mnt-system will usually be mounted. Then the booting partition is not mounted during usual system use, and chances for corruption or occasional overwriting are small. I have experienced both enough times to say it pays to be defensive.

Second, I use one boot subdirectory per OS release/booting variant. This is the boot directory on the pc I post from:


knoppix@Microknoppix:~$ ls -alt /media/sda6/boot
total 76
drwxrwxrwx 2 knoppix knoppix 4096 Jan 5 13:31 grub
drwxr-xr-x 2 root root 4096 Jan 5 13:16 knx705
drwxr-xr-x 19 root root 4096 Jan 5 13:15 .
drwxr-xr-x 2 root root 4096 Aug 1 10:39 ubu1204
drwxr-xr-x 4 root root 4096 Aug 1 10:36 ..
drwxrwxrwx 5 knoppix knoppix 4096 Jul 19 01:29 ubu12
drwxrwxrwx 5 knoppix knoppix 4096 Jul 4 2012 knx703
drwxrwxrwx 2 knoppix knoppix 4096 Jun 21 2012 knx702
drwxrwxrwx 4 knoppix knoppix 4096 Jun 12 2012 knx644_64a
drwxrwxrwx 3 knoppix knoppix 4096 Jun 11 2012 debootstrap_64
drwxrwxrwx 3 knoppix knoppix 4096 Jun 10 2012 knx644_64sq
drwxrwxrwx 4 knoppix knoppix 4096 Jun 8 2012 deb605
drwxrwxrwx 3 knoppix knoppix 4096 Jun 8 2012 knx702_0wn
drwxrwxrwx 2 knoppix knoppix 4096 Dec 27 2011 knx671
drwxrwxrwx 2 knoppix knoppix 4096 Dec 27 2011 syslinux
drwxrwxrwx 2 knoppix knoppix 4096 Aug 10 2011 knx670_64
drwxrwxrwx 2 knoppix knoppix 4096 Aug 10 2011 knx670
drwxrwxrwx 2 knoppix knoppix 4096 Jul 24 2011 knx644
drwxrwxrwx 3 knoppix knoppix 4096 Jul 24 2011 knx644_sqThere are booting data for Knoppixes from 6.4.4 to 7.0.5 plus Debian, Ubuntu etc.

Third, I use different entries in boot/grub/menu.lst for differentiation - always at least two per Knoppix release for example, using 32 and 64 bits kernels, respctively.

My 7.0.5 entries are currently as follows, rather elementary:


title Knoppix 7.0.5 64 bits sda1 cloop
kernel (hd0,5)/boot/knx705/linux64 fromhd=/dev/sda1 knoppix_dir=KNOPPIX705 nosound keyboard=no ramdisk_size=100000 lang=no apm=power-off initrd=minirt_sq_1.gz nomce libata.force=noncq hpsa.hpsa_allow_any=1 loglevel=1 tz=localtime
initrd (hd0,5)/boot/knx705/minirt.gz

title Knoppix 7.0.5 32 bits sda1 cloop
kernel (hd0,5)/boot/knx705/linux fromhd=/dev/sda1 knoppix_dir=KNOPPIX705 nosound keyboard=no ramdisk_size=100000 lang=no apm=power-off initrd=minirt_sq_1.gz nomce libata.force=noncq hpsa.hpsa_allow_any=1 loglevel=1 tz=localtime
initrd (hd0,5)/boot/knx705/minirt.gz


Here are the entries for Ubuntu 64 bits, Ubuntu 32 bits and Win 7. Lazily, I use booting information off the install partitions - better copy them to subdirectories as shown above.


title Ubuntu 64 bits HD install sda6
root(hd0,7)
kernel (hd0,7)/boot/vmlinuz-3.2.0-23-generic root=UUID=e71d3494-e9d5-4b23-908f-8acefde096e8 ro quiet splash
initrd (hd0,7)/boot/initrd.img-3.2.0-23-generic

title Ubuntu 32 bits HD install sda7
root(hd0,6)
kernel (hd0,6)/boot/vmlinuz-3.2.0-23-generic-pae root=UUID=13cbadae-eac2-413a-bd02-0e1dc9f1ee4d ro quiet splash
initrd (hd0,6)/boot/initrd.img-3.2.0-23-generic-pae


title Windows 7
rootnoverify (hd0,1)
makeactive
chainloader +1