[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [debian-knoppix] Problem understanding how knoppix works

On Tue, Apr 15, 2003 at 01:06:18AM +0300, Mihai Tanasescu wrote:
> Hello,
> I've read some of the knoppix documentation and I still can't figure out
> how it all works.

If you are familiar with Unix, you can learn from the bootscripts. But
I'm trying to give a brief overview here.

> I'm having problems with all those knoppix mounts.
> I saw that /home and /usr are mounted under /ramdisc which is RAM memory
> emulated from /dev/shm (usually it emulates half of the total RAM
> memory). I presume the /usr directory is taken from the cd and placed
> into ramdisc.

/usr (and many others) are symlinks to read-only directories
mounted from the compressed image on the CD.

> But when I issue a du -k under the root directory I see a KNOPPIX one
> occupying about 2 Gb of space. How is this possible? while the rest
> occupies a total of 700 Mb (exactly the cd size).

Do a df -k, and you will see it. The cloop device does a transparent
decompression of the compressed loopback file KNOPPIX/KNOPPIX on the CD.
With gzip -9, about 2 GB of uncompressed data fit in a 700MB loopback

> And what is realy that device /dev/root which is mounted as "/"? I want
> to understand the concept behind this.

/ is the initial ramdisk, about 3 MB in size. It contains the (writable)
/etc directory, and mostly symlinks either to writable areas in
/ramdisk, or to read-only areas on the compressed loopback device

> And if I modify with vim the file lets say /etc/resolv.conf where does
> he save it afterwards ?

For this file, that would be the initial ramdisk, which is the / file

> as the file resides in /etc/ on /dev/root which
> is mounted as "/". and /dev/root is mounted from the cd..and it seems
> strange.

No, /dev/root is not mounted from the CD. It's the initial ramdisk.

> And the directory structure on " /" look exactly like the one under the
> KNOPPIX folder.(the only difference being that / occupies 700 Mb not
> counting the knoppix folder it contains)

I assume that you are familar with symlinks. Please compare ls -l /
to ls -l /KNOPPIX, and you will see that most of those symlinks just
point to the CD.

> Please help me understand the way this works. (and how knoppix emulates
> and uses the system ram).

Knoppix does not emulate ram, it uses a dynamic ramdisk for variable
data like in /home and /var, and a static ramdisk for the smaller
writable system area, like /, which contains /etc.

> or give me some relevant material that
> explains this process of organizing files and running programs and
> allowing the user to modify files that are not mounted in ramdisc but
> are on a cd.(like the ones in /etc ).

You should read:

/linuxrc on the initial ramdisk (inside of miniroot.gz on the boot.img bootfloppy)
/etc/X11/Xsession.d/45xsession (for the autostart of the desktop).

All of these are just shellscripts (source included ;-)
The whole hardware detection and startup process in Knoppix is mainly
done with shellscripts. For the few C programs that are needed, see
http://www.knopper.net/knoppix/sources/ for the source code.

Hope this helps for a start.

-Klaus Knopper
Klaus Knopper                           Technical Solutions & Finances
knopper@linuxtag.org                          http://www.linuxtag.org/
Phone +49-(0)631-3109371                        Fax +49-(0)631-3109372
LinuxTag 2003 - Europes largest Linux Expo       Where .com meets .org
debian-knoppix mailing list

Reply to: