-
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
ORICO Multi Bay RAID Hard Drive Enclosure USB 3.0/ Type-C For 2.5/3.5'' HDD SSDs
$179.99
ACASIS 2.5/3.5 inch 2 Bay SATA USB 3.0 Hard Drive Disk HDD SSD Enclosure 4 RAID
$55.45
0XYHWN Dell PERC H730P PCIe 3.0 SAS 12GB RAID CONTROLLER
$65.00
LSI MegaRAID 9361-8i 12Gbps PCIe 3 x8 SATA SAS 3 8 Port RAID + BBU & CacheVault
$39.00
Inspur LSI YZCA-00424-101 Raid Card 12Gbps HBA Controller Low Profile 9300-8i IT
$15.98
DELL PERC H310 RAID Controller with Cables, OHV52W, 6Gb/s SAS SATA PCIe x8
$19.95
ORACLE 7085209 MegaRAID 9361-8i 12Gb/s SAS /SATA RAID 1G Cache CARD w/Battery
$24.99
Dell PowerEdge PERC H730P 2GB 12Gbps SAS SATA Mini RAID Controller Battery 7H4CN
$22.50
OWC Guardian Maximus Raid Enclosure SATA Hard Drive FireWire
$36.99
Dell 7H4CN PERC H730P Raid Controller Mini Mono12GBPS 2GB NV Cache
$44.99