This is the old SliTaz forum - Please use the main forum.slitaz.org

How is the rootfs mounted ?
  • XavierJXavierJ August 2010
    Hello.

    I don't understand how the rootfs is mounted on slitaz.
    In the fstab there is no ligne for the root, and mount output theses lignes : "rootfs on / type rootfs" and "/dev/root on / tupe ext2 ", but there is no root device in /dev.
    I found that rootfs is remounted in read only or read/write mode in the /etc/init.d/rcS script, but when is it firts mounted ?

    thanks for your help.
  • TotoetsasoeurTotoetsasoeur August 2010
    I think, but may be wrong, that it is mounted on a (rootfs) loop as stated here:
    http://doc.slitaz.org/en:scratchbook:start

    Here is a link about the loop mount option (in french):
    http://www.linux-france.org/article/man-fr/man8/mount-8.html

    I hope this helps.
    Cheers.

    ps: Just to make sure English people understand: "ligne" is in french and means line.
  • XavierJXavierJ August 2010
    Thank you.

    I must add that I'm using a HD installed slitaz.
    I don't get why the rootfs would be mount as a loop. The rootfs is in /dev/sda1, it's not a regular file.

    PS:yes, sorry for the "ligne".
  • seawolfseawolf August 2010
    Perhaps something to do with the boot-loader; is the kernel auto-mounting it? It has an ext3 mondule built-in, after all.

    title SliTaz GNU/Linux (Kernel 2.6.30.6-slitaz)
    root (hd0,4)
    kernel /boot/vmlinuz-2.6.30.6-slitaz root=/dev/sda5

    Just a thought.
  • TotoetsasoeurTotoetsasoeur August 2010
    yeap, you're probably right about the loop. Sorry about that.

    Anyway, 2 points to consider:
    - As I understood, rootfs is mounted by the startup scripts prior to mounting the rest of file systems. So there is no need to mount it again through fstab file. This may explain why it is not in fstab.
    - as rootfs is in RAM, I am wondering if RAM is considered as a device. I guess it is not. This may explain why there is no root device in /dev.

    Quite interesting post. Please let us know your conclusions.
    Cheers.
  • LexeiiLexeii September 2010
    Bootloader (grub) loads kernel (vmLinuz) and kernel loads initrd (=initial RAM disk, rootfs.gz) thru boot loader. Then kernel starts 'init' script and then etc.

    If you have full (not frugal) installation, then you haven't initrd and 'initrd ...' line in grub menu. But you need 'root=/dev/...' in 'kernel' line. And 'init' script runs from 'root' partition.

    You have a full installation and want to mount initrd? For what, if this is not secret?
  • XavierJXavierJ September 2010
    I have a full installation and I have root=/dev/sda1 in the kernel line. So it's grub which "mount" the rootfs ?

    Actualy I'm asking about that because I want my rootfs to be mount read only or synchronous. So I looked for the place where the rootfs is mounted to pass some options and I didn't found it... And I saw theses weird lines int fstab.

    About my first problem, I known I can fix it by editing the line in /etc/init.d/rcS where the rootfs is remount in read/write mode. But I think it isn't a good idea so I'm looking for another way.
  • LexeiiLexeii September 2010
    Xavier, it seems that your question is more complex that it looks at first sight. You need a sort of unionfs or aufs to combine regular file system with initrd.
  • XavierJXavierJ September 2010
    Hm, I realy don't want to mess with initrd.

    If there is no configuration file to modify this part of rcS I guess I'm just going to edit it.
    Anyway, to fix my problem, knowing how the rootfs is mounted doesn't matter in the end, since it's remount with others options in rcS.

    Still I'd like to understand... the answer is probably somewhere in a documentation on the linux boot process.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

SliTaz Social