PDA

View Full Version : KNOPPIX 6.7.1 on USB with very large persistent data image.



Blacksimon
12-27-2011, 09:21 AM
Hello to all you guys.
If you don't like remaster and you want to increase the Knoppix-data.img (or .aes) size up to 4GB permitted by the FAT32 file system in your USB installation, here the explanation what I did until now. I use a micro size USB 16GB with inside a micro SDHC card produced by PNY.
I first tried knoppix 6 months ago after my Win XP notebook crashed (M$ damn!), and during all this time I updated the program by installing the ones that I needed to get to the space limit allowed, and so here I am.

1) Run a Knoppix live DVD
2) Install Knoppix on Fat32 formatted USB
3) Restart Knoppix from newly created USB
4) Create new persistent data image of 3840MB size
5) Shutdown and run again a Knoppix live DVD
6) Move the entire KNOPPIX folder from USB to a temp HDD directory
7) Start GParted and choose USB Disk
8) Reduce the FAT32 partition size at 1GB (or 512MB if you want)
9) Create second partition with unallocated space formatted in NTFS (or even Ext2, Ext3, Ext4)
10) Move now KNOPPIX folder stored in temp HDD to the second partition just created
11) Resize Knoppix-data.aes (or .img).

Code for Knoppis-data.img
* Change to the directory with that persistent image
* Open a root terminal

* e2fsck -fy knoppix-data.img #Check the ext2 filesystem and allow corrections
* dd if=/dev/zero bs=1M count=3328 >> knoppix-data.img #Add 3328MB to the container (total 7GB store image)
* resize2fs knoppix-data.img #Resize the filesystem
* e2fsck -fy knoppix-data.img #Check again
* Close terminal
* Shutdown the system and boot (and using the cheat Knoppix FROMHD=/dev/sdxy where x= a,b,c,.. and y= 1,2,3,.. if you have more one Knoppix installation)

Code for Knoppis-data.aes
* Change to the directory with that persistent image
* Open a root terminal

* dd if=/dev/zero bs=1M count=3328 >> knoppix-data.aes #Add 3328MB to the container (total 7GB store image)
* echo yourpassword | losetup -e aes -p 0 /dev/loop6 knoppix-data.aes #yourpassword is the password knoppix ask you at the boot to open the persistent data image aes encrypted
* e2fsck -fy /dev/loop6 #Check the filesystem and allow corrections
* resize2fs /dev/loop6 #Resize the filesystem
* e2fsck -fy /dev/loop6 #Check again
* losetup -d /dev/loop6 #destroy the loop device association
* Close terminal
* Shutdown the system and boot

At boot you can use the cheat Knoppix FROMHD=/dev/sdxy where x= a,b,c,.. and y= 1,2,3,.. if you have more one Knoppix installation like me
And naturally you can change the MB to add at your persistent image what you want (1GB=1024MB)
Note that the more the file is large and takes longer to load, but the few seconds of waiting are acceptable for me...

Thanks to these threads at first:
http://www.knoppix.net/forum/threads/28316-resizing-knoppix-data.img?highlight=resize
http://www.knoppix.net/forum/threads/28207-Adding-more-persistent-disk-images
and many many many others i've read.
Bye

Capricorny
01-10-2012, 02:18 PM
Nice!
A quick comment: At the first running from the DVD, you might also open a terminal and run fdisk on the USB stick, deleting all partitions on it and then recreating one of, say 1GB, make it FAT32. Flash-installing from DVD to this partition will eventually crash with "No space left on device", but booting stuff and kernels will be in place before that. Next, you can create a second partition with fdisk, and it should be possible to just copy KNOPPIX to the new place, from /mnt-system/KNOPPIX. After copying, you can create KNOPPIX/knoppix-data.img as big as you like, and the medium permits, loop-mount and setup an ext2 file system on it. Which will then be used when you boot up the stick and use the fromhd cheatcode.

Blacksimon
01-11-2012, 07:06 PM
Thanks , it's a good "quick comment".....to sure to save time of resizing partitions
:-)

fmateo
01-16-2012, 08:59 PM
I think also is useful to format the usb stick as reiserfs and copying knoppix files there, and make it bootable manually with grub.. at this point with reiserfs you can create the persistent file even larger..

This link have more info
http://www.knoppix.net/forum/threads/29689-Knoppix-Performance-on-USB-with-ReiserFS

fmateo
01-16-2012, 09:00 PM
I think also is useful to format the usb stick as reiserfs and copying knoppix files there, and make it bootable manually with grub.. at this point with reiserfs you can create the persistent file even larger..

My first thread have more info about how to do that

Capricorny
01-17-2012, 06:00 PM
I think also is useful to format the usb stick as reiserfs and copying knoppix files there, and make it bootable manually with grub.. at this point with reiserfs you can create the persistent file even larger..

My first thread have more info about how to do that
I wonder what you mean by "create .. even larger"? The main reason Klaus K has given for why reiserfs is used, has to do with file system checking/repair, are there more? For large persistent stores, the default, ext2, is not optimal, so, for example, ext4 may be better. But that is on the store, not on the underlying file system. Which very often is ext3 or ext4, and I wonder if there are little known reasons to go reiserfs?

As for grub, I tend to follow the old advice and create a small boot partition and install it there. Where ext2 is a rather natural choice for me - this partition is seldom written to, only at booting data updates.

Furthermore, my experience is that persistent stores above, say, 8 GB are often not optimal. So personally, I have returned to the 4 GB limit, often going somewhat lower, and remastering as needed. With e.g. NTFS, it may be a "Linux solution" to create a large loopfile with a Unix file system on it, but I prefer rather to shrink NTFS and create pure Unix partitions whenever possible.

utu
01-17-2012, 06:38 PM
The main reason Klaus K has given for why reiserfs is used, has to do with file system checking/repair, are there more?


This bothers me as well. I thought it was the case that reiserfs checking
had the reputation of being deficient, relative to, say, ext3.

If so, the reiserfs filesize limits are similar to ext3; both are in the Tb range.
And, since both reiserfs and ext3 are journalled, what is the justification for reiserfs?

After all, a big negative is reiserfs's questionable (if not definitively dismal future) development support state.

Capricorny
01-17-2012, 06:58 PM
As long as reiserfs is maintained and runs well, I wouldn't be too much concerned about its future development. I mean, the ext2 system I install grub on is very similar to the ext2 i used back in 1994, I've got the impression not that much has happened in the way of development, but I may be wrong.

I stilll keep looking for the compelling reasons to use reiserfs, though. And I think it may be very little, making fs choice a big issue for everyday use is not very productive in my view.

Blacksimon
01-17-2012, 10:56 PM
I tried several alternatives:
1) Standard Live USB installation (FAT32 formatted ) with max 4GB persistent store
2) Live USB with two partition: first FAT32 for syslinux boot, second NTFS (or what you like) with 7GB persistent store
3) HDD installation with 1GB swap and 59GB RaiserFS filesystem (using 0wn standard installation)

at the end my comments are:
1) best choice from every point of view. Knoppix is a good live distro as it is
2) non-optimal: is slightly slower in boot or loading applications...
but if you need extra persistent store to update or installing more preferred applications without remastering is an acceptable compromise
3) I strongly advise against: if a crash happens, or is a power failure, or an incorrect update package, the file system will be damaged, or there will be a kernel panic, or grub2 will not boot, and so on up to having to reinstall everything from scratch
(the third time that I've such a problem I gave up trying to fix it)

I will wait a new release of knoppix to have new experiences....he he he he

Blacksimon
01-17-2012, 10:57 PM
I forgot to say good night.
Bye guys

Blacksimon
01-23-2012, 10:43 PM
....strange behavior.....using my new USB HDD 500GB instead of the broken internal 60GB SDD.
For Knoppix Live Usb I create:
- 1 partition FAT32 about 50GB with Syslinux Boot folder
- 2 partition NTFS about 300GB with my 7GB presisten image and 1GB extra personal data and future VirtualBox HDD image
- 3 partirion EXT2 about 150GB for temporary store to try to use recombine script (see the Werner P. Schulz recombine script at http://www.wp-schulz.de/knoppix/recombine.html)
Usually this 3 partition is un-allocated and all work fine.
But after activating the 3 Ext2 partition using GParted, exit and reboot....the system break in kernel panic with an error about the mount of mnt-system...
I think the problem is the Init script in minirt.gz
It seems that the EXT2 partition is the favorite to be mounted as mnt-system/knoppix instead the NTFS (where knoppix-data.img is real located).

Any suggestion ? There is a bug ?
Thanks
Bye

utu
01-23-2012, 11:06 PM
How big are your files for Fat32?

Capricorny
01-23-2012, 11:48 PM
....strange behavior.....using my new USB HDD 500GB instead of the broken internal 60GB SDD.
For Knoppix Live Usb I create:
- 1 partition FAT32 about 50GB with Syslinux Boot folder
- 2 partition NTFS about 300GB with my 7GB presisten image and 1GB extra personal data and future VirtualBox HDD image
- 3 partirion EXT2 about 150GB for temporary store to try to use recombine script (see the Werner P. Schulz recombine script at http://www.wp-schulz.de/knoppix/recombine.html)
Usually this 3 partition is un-allocated and all work fine.
But after activating the 3 Ext2 partition using GParted, exit and reboot....the system break in kernel panic with an error about the mount of mnt-system...
I think the problem is the Init script in minirt.gz
It seems that the EXT2 partition is the favorite to be mounted as mnt-system/knoppix instead the NTFS (where knoppix-data.img is real located).

Any suggestion ? There is a bug ?


Sure there is either a bug or some file or hardware error. But you give too little information to tell what it is. I like to keep things as simple as possible, which means that I keep KNOPPIX and the persistent image at the same place (the default setup), and I use legacy grub for booting. In your case, I would have created a smaller ext2 partition in addition to the other, installed grub to that, made it active, and then created different menu items for KNOPPIX. After copying the contents of the syslinux boot directory to a subdirectory knx671 on the boot partition, I would have forgotten about it.

Here are my grub entries for Knoppix 6.7.0, incidentally I have this version of KNOPPIX on the boot partiton - that's just because all the other partitions were in use for other versions, the norm is that the boot partition is not mounted during normal use.


title Knoppix 6.7.0 all arch (sda5)
kernel (hd0,4)/boot/knx670/linux ramdisk_size=100000 lang=no keyboard=no fromhd=/dev/sda5 nosound vt.default_utf8=0 apm=power-off initrd=minirt.gz nomce libata.force=noncq loglevel=1 tz=localtime
initrd (hd0,4)/boot/knx670/minirt.gz

title Knoppix 6.7.0 64 bits kernel (sda5)
kernel (hd0,4)/boot/knx670/linux64 ramdisk_size=100000 lang=no keyboard=no fromhd=/dev/sda5 nosound vt.default_utf8=0 apm=power-off initrd=minirt.gz nomce libata.force=noncq loglevel=1 tz=localtime
initrd (hd0,4)/boot/knx670/minirt.gz

Werner P. Schulz
01-24-2012, 09:24 AM
- 3 partirion EXT2 about 150GB for temporary store to try to use recombine script (see the Werner P. Schulz recombine scriptDid you use my script or not? If so, tell us step by step what you've done. In case of error, what messages? Otherwise what else is on partition#3?

Greetings Werner * http://www.wp-schulz.de/knoppix/summary.html
Own Rescue-CD (Knoppix V6.7.1 remaster)

Blacksimon
01-24-2012, 10:29 AM
I use the recombine script and works well. Thanks Werner P. Schulz !!

The strange behavior happen before using the script, when I created tree partitions and normally boot the first time.
With 3 EXT2 partition active system halted in kernel panic with an error about the impossibility of mounting Knopppix in mnt-system
With 3 partition removed (un-allocated) all works fine


I'll try again

Blacksimon
01-24-2012, 10:50 AM
partially solved using at boot the cheat KNOPPIX FROMHD=/dev/sda2 instead the auto search

I'll try to change the 3 partition in NTFS or other and try again
I want understand

Capricorny
01-26-2012, 12:34 PM
Why should NTFS vs ext2 make any difference here?
And when you make a partition active, you tell the system to boot from there, right?
I think that whenever we experiment with alternative setups from the default, leaving it to then Knoppix init to find and mount a Knoppix image may be relatively bad practice. Always specify fromhd= in such situations. (For me, init may find 5-7 Knoppixes, small probability it will auto-pick the correct one :))

Blacksimon
01-26-2012, 10:14 PM
probably nothing.....
sure best to use cheats fromhd=

experience leads to knowledge :-)))