-
Senior Member
registered user
Adding more persistent disk images
In Knoppix 6.X, the persistent image is a file, knoppix-data.img, which at boot gets loop-mounted on KNOPPIX-DATA and merged with the cloop-mounted Knoppix image in unionfs.
If something has gone wrong with this image, you may just mount the media (for instance fram another running version of Knoppix), and delete the file. (Don't try to delete a mounted image). On next booting from this device, you will be asked to create a new persistent image.
This image is very tightly integrated with the Knoppix version you are running, and on FAT32 it is limited to 4GB. I find I need more space, I'd like not to have it integrated with the current Knoppix version, and I want to store it on USB-sticks etc.
Typically, I want to install Eclipse, Groovy, Grails and several other Java packages on the stick independent of the running Knoppix. I also want to use USB sticks without all the limitations of the FAT32 file system.
One way to accomplish this, is adding more persistent disk images. I use a 16GB stick, with ca 1 GB for Knoppix 6.2 from CD, 4GB for standard persistent disk image, and two more persistent images, which will be mounted at boot time, but not merged with KNOPPIX in unionfs.
I choose to put the images together with the standard image inside the /knoppix folder.
First step is to create the file, which is done with dd.
Second is to setup a loop device on the file, with losetup
Third is creating an ext2 file system on the image.
Next, create a mounting point and test-mount the loop device. After testing, unset the loop connection with losetup -d
Now, the new image is ready for mounting with mount -o loop <image> <mount point>.
Code:
root@Microknoppix:/media/sdd1/knoppix# dd if=/dev/zero of=knoppix-data2.img bs=512 count=8000000
8000000+0 records in
8000000+0 records out
4096000000 bytes (4.1 GB) copied, 336.48 s, 12.2 MB/s
root@Microknoppix:/media/sdd1/knoppix# losetup /dev/loop6 knoppix-data2.img
root@Microknoppix:/media/sdd1/knoppix# mkfs -t ext2 /dev/loop6
mke2fs 1.41.3 (12-Oct-2008)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
250480 inodes, 1000000 blocks
50000 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1027604480
31 block groups
32768 blocks per group, 32768 fragments per group
8080 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736
root@Microknoppix:/media/sdd1/knoppix# mkdir /mnt/knxdata2 && mount /dev/loop6 /mnt/knxdata2
root@Microknoppix:/media/sdd1/knoppix# umount /mnt/knxdata2 && losetup -d /dev/loop6
root@Microknoppix:/media/sdd1/knoppix# mount -o loop knoppix-data3.img /mnt/knxdata2
After this setup is performed, necessary mounting code may be added to /etc/rc.local. I prefer to stay entirely outside the hard-coded directory system, which eliminates a lot of otherwise natural choices. I use store as a common mounting point for extra "partitions", and mount the development tools volume as /store/share and the user projects as /store/varl.
Edit 20100220:
It seems to be possible to make a backup of the standard persistent image, compress it, and have it copied back at boot time if something has gone wrong with the running image. From Klaus' comments to his list of 6.2.0 cheat codes:
If you place an update*.zip or update*tar.gz file on the medium holding
the KNOPPIX data, it will be unpacked onto the overlayed filesystem
before starting "init", thus allowing quick reconfiguration of the
system.
One consequence of this, is that it may be good practice to back up the persistent image now and then. Accessing it when it is not mounted. For instance, put a KNOPPIX copy somewhere else, and either use that with the fromhd= cheat code, or (g)zipping the knoppix-data.img file from it.
Similar Threads
-
By greenfly in forum Ideas
Replies: 2
Last Post: 01-10-2009, 12:31 PM
-
By hotplainrice in forum General Support
Replies: 0
Last Post: 11-02-2006, 11:02 PM
-
By linuxman in forum General Support
Replies: 2
Last Post: 12-10-2005, 11:47 PM
-
By rwcitek in forum Hardware & Booting
Replies: 0
Last Post: 05-29-2005, 08:37 PM
-
By captain in forum The Lounge
Replies: 1
Last Post: 05-20-2004, 06:19 PM
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
Western Digital WD4000FYYZ RE 4TB 7200 RPM 64MB Cache SATA 6Gb/s 3.5" Hard Drive
$28.52
Seagate ST8000NM0055 8TB 7200RPM 256MB SATA 6.0 Gb/s 3.5" Enterprise Hard Drive
$44.62
WD 16TB Elements Desktop, Certified Refurbished Hard Drive - RWDBWLG0160HBK-NESN
$209.99
HDD 3.5" SATA Hard Drive with Windows 7/Win 10 Installed Legacy
$35.99
HGST Ultrastar DC HC520 12TB SATA 6Gb 256MB 3.5" Enterprise HDD- HUH721212ALE601
$89.99
1TB HDD/SSD 2.5" SATA Hard Drive for Laptop with Win 10/Win 11 Pro Pre-installed
$18.99
Seagate Exos X14 12TB SATA6Gb/s 7200RPM 3.5" Enterprise Hard Drive ST12000NM0558
$99.95
SEAGATE ST500LM021 500GB 7200RPM 2.5" SATA 6Gb/s 32MB Laptop Thin Hard Drive
$7.99
Western Digital Gold Enterprise 4TB,7200 RPM Internal Hard Disk Drive WD4002FYYZ
$39.95
WD 4TB Certified Refurbished Elements, External Hard Drive - RWDBU6Y0040BBK-WESN
$87.49