-
Senior Member
registered user
This is all for Knoppix 3.8 Cebit Edition which is 4 months old but it should be roughly the same for Knoppix 3.9 & 4.0. Knoppix loads the kernel and mini root partition from /KNOPPIX-CD-ROOT/boot/isolinux. The kernel loaded is linux and the mini root is minirt.gz. You can view the mini root by copying it to another location, unziping it, and loop mounting it.
Code:
cd $HOME
cp /KNOPPIX-CD-ROOT/boot/isolinux/minirt.gz ./
mkdir foobar
gunzip minirt.gz
sudo mount -t ext2 -o loop,ro minirt ./foobar
Inside the minirt you will find a executable script named linuxrc. This linuxrc script is init script for Knoppix.
The entire linuxrc script for Knoppix 3.8 Cebit Edition is posted at my website at http://virtualacuity.com/james/knopp...nuxrc-3.8.html
Code:
11 # hardcoded configurable options
12 # Default maximum size of dynamic ramdisk in kilobytes
13 RAMSIZE=1000000
612 # New in Kernel 2.4.x: tmpfs with variable ramdisk size.
613 # We check for available memory anyways and limit the ramdisks
614 # to a reasonable size.
615 FOUNDMEM="$(awk '/MemTotal/{print $2}' /proc/meminfo)"
616 TOTALMEM="$(awk 'BEGIN{m=0};/MemFree|Cached/{m+=$2};END{print m}' /proc/meminfo)"
617
618 # Be verbose
619 echo "${CRE}${BLUE}Total memory found: ${YELLOW}${FOUNDMEM}${BLUE} kB${NORMAL}"
620
621 # Now we need to use a little intuition for finding a ramdisk size
622 # that keeps us from running out of space, but still doesn't crash the
623 # machine due to lack of Ram
624
625 # Minimum size of additional ram partitions
626 MINSIZE=20000
627 # At least this much memory minus 30% should remain when home and var are full.
628 MINLEFT=16000
629 # Maximum ramdisk size
630 MAXSIZE="$(expr $TOTALMEM - $MINLEFT)"
631 # Default ramdisk size for ramdisk
632 RAMSIZE="$(expr $TOTALMEM / 5)"
633
634 # Create additional dynamic ramdisk.
635 test -z "$RAMSIZE" -o "$RAMSIZE" -lt "$MINSIZE" && RAMSIZE="$MINSIZE"
636 mkdir -p /ramdisk
637 # tmpfs/varsize version, can use swap
638 RAMSIZE=$(expr $RAMSIZE \* 4)
639 echo -n "${CRE}${BLUE}Creating ${YELLOW}/ramdisk${BLUE} (dynamic size=${RAMSIZE}k) on ${MAGENTA}shared memory${BLUE}...${NORMAL}"
640 # We need /bin/mount here for the -o size= option
641 /bin/mount -t tmpfs -o "size=${RAMSIZE}k" /ramdisk /ramdisk
Those lines detect the system's total RAM, calculate the ramdisk size, & then create the ramdisk. This calculation is not user configurable but in theory it should be possible to create a boot time cheat code for ramdisk size that is then detected & used in this script. The logic of it would have to do bounds checking to make sure the user is not setting the ramdisk too small or too large.
I hope this helps.
James
Similar Threads
-
By JohnnyH in forum Hdd Install / Debian / Apt
Replies: 1
Last Post: 03-08-2007, 04:01 AM
-
By Steven Hair in forum Hdd Install / Debian / Apt
Replies: 2
Last Post: 09-29-2004, 03:04 PM
-
By maurovik in forum Laptops
Replies: 0
Last Post: 09-03-2004, 08:22 AM
-
By jazzback in forum Customising & Remastering
Replies: 0
Last Post: 06-01-2004, 12:52 AM
-
By A. Jorge Garcia in forum Hdd Install / Debian / Apt
Replies: 2
Last Post: 11-02-2003, 09:43 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

Dell 6P85J 4TB ST4000NM0063 7.2k 6Gb/s 3.5” SAS SED Hard Drive with Tray
$39.99

Western Digital HUS726T4TAL5204 4TB 7.2K SAS 12Gb/s 3.5" 512e HDD NetApp X375A
$64.00

(ST8000NM0045) SEAGATE ENTERPRISE 8TB 7200RPM 4Kn SATA 6Gb/s 3.5" HARD DRIVE
$199.99

Western Digital 1TB 3.5" SATA III 7200RPM Desktop Hard Drive
$34.99

HGST 0F23072 Deskstar NAS 6TB SATA III 7200RPM 128MB 3.5in HDD
$84.99

Seagate ST500DM009 BarraCuda 500 GB 3.5" SATA III Desktop Hard Drive
$14.99

HGST 0F23651 8TB SAS 12Gb/s 7200RPM 128MB 3.5" Ultrastar He8 HDD
$89.99

Dell ST6000NM0034 1HT27Z-150 NWCCG 6TB SAS 3.5 7.2K ENTERPRISE SERVER DRIVE
$68.99

DELL 2TB Enterprise HDD (7200RPM, 3.5", SATA III, 128MB Cache) HUS722T2TALA600
$49.95

Western Digital Red WD60EFRX-68MYMN1 6 TB,Internal,5400 RPM,3.5 inch Hard Drive
$179.99