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

Loop install guide question
  • marquiticomarquitico February 2011
    I was reading the guide for Unusual Install Methods, and decided to try the "Loop Install" method. I don't understand the following part, so I thought I'd ask first:

    Root filesystem files installation


    Copy files from the rootfs.gz archive of a cdrom into the loopfile:

    # mount /dev/cdrom /media/cdrom
    # mount -o loop,ro slitaz.fs /media
    # unlzma -c /media/cdrom/boot/rootfs.gz | ( cd /mnt; cpio -idmu )
    # umount -d /mnt
    # umount /media/cdrom
    My first question is how do you first mount something on /media/cdrom, and then in the next step mount something else on /media? As I am reading the last two lines there, I begin to wonder is this a mistake; perhaps the second line should be:
    # mount -o loop,ro slitaz.fs /mnt
    so that /mnt can be used in the third line and then unmounted in the fourth line?

    If so, then my next question is, shouldn't you mount the the loopfile as rw instead of ro? Otherwise how can you unpack anything into it with cpio? So actually, it must really be:
    # mount -o loop,rw slitaz.fs /mnt

    Or maybe I misunderstood this whole thing, which is very possible... :-P

    Thank you in advance, everybody.
  • babaorumbabaorum February 2011
    Hi Marquitico,
    I think there is a mistake in tutorial: please use mount -o loop,ro slitaz.fs /mnt to mount your loop-type file system, and then umount -d /mnt to unmount it when not being used anymore. ;-]
    You may be right to suggest mounting the loop in a read+write mode, I think as you do that it will not be possible to "un-lzma" then "un-cpio" rootfs unless you can write at specified location !
    -Babaorum
  • marquiticomarquitico February 2011
    Oh, thank you for confirming my thoughts! I will try this method very soon.
  • babaorumbabaorum March 2011
    I've updated the online tutorial according to our conclusion ;-]
  • marquiticomarquitico March 2011
    Alas, I can't get this to work. When I boot up, I'm not in the loopfile, and the flash drive it's on isn't mounted. Dmesg is no help because the error message comes very, very late. Because it goes by so fast, I cannot see whether the error refers to the mount= option or the loopfs= option (maybe both?). What would you suggest? Where would you investigate?

    If I mount everything by hand after booting, the loopfile looks good. Can a switch_root be done manually after booting? Just an idea...
  • mojomojo March 2011
    What boot loader has been tested as  working on those boot setup examples for loop and subdirectory installs?

     http://doc.slitaz.org/en:guides:uncommoninst
  • marquiticomarquitico March 2011
    Very good question. Was wondering that myself.

    Meanwhile: do we have a single page with a definitive list of SliTaz boot cheatcodes, by the way?
  • marquiticomarquitico March 2011
    OK, I'm fairly sure that the problem is that the boot process fails to mount the flash drive. I can see it hesitate when it attempts to loopmount slitaz.fs on /mnt, because of not having first mounted the flash drive that it's hosted on, at which point it then complains "no such file". But at least it's attempting to obey the loopfs=slitaz.fs code.

    @Mojo: that page is evidently incomplete. For example, it doesn't discuss the loopfs=<filename> code. Nor the mount=<device> code, either.

    So I'm wondering if there are other cheatcodes that remain undocumented. What I'd like to try is to sneak a delay code, because I'm wondering whether perhaps my usb drives are too slow to register. I've tried a couple of options imitating the syntax of other distros, but no luck.
  • wangjiwangji March 2011
    @marquitico
    # mount /dev/cdrom /media/cdrom
    # mount -o loop,ro slitaz.fs /media
    # unlzma -c /media/cdrom/boot/rootfs.gz | ( cd /mnt; cpio -idmu )
    # umount -d /mnt
    # umount /media/cdrom

    there is no error in those above lines ;
    the 2nd mount "just over_cache" on /media , so while that 2nd mount lives on
    no /media/cdrom/* is visble...until unmount the 2nd mount !
    But it is correct ,and it does work !

    the 3rd line needs may be "a slight modif" :
     replace unlzma with "unlzma -S gz"
    to specify the suffix used by slitaz as rootfs.gz
    (which should be rootfs.lzma
    or some thing unlzma recognises as defaut suffix )

    And the 1st line /dev/cdrom could have been -if you just download slitaz.iso ,whithout burning it
    mount -oloop slitaz.iso /media/cdrom

    the result of the 4 operations above = "rootfs inside /mnt" !!!!

    not rootfs mounted on /mnt !
     true "physical files" unpacked by cpio into the directory /mnt

    the only true mistype is the 1st umount -d /mnt which should really be umount /media
    since /mnt has never been mount on the above operations
    HTH
  • mojomojo March 2011
    I have to use rootdelay=10 on all my slitaz flash drive installs with grub.
  • marquiticomarquitico March 2011
    @wangji:
    Sorry to say that your advice does not work.

    First problem: If I use /media, then the third line doesn't work. You yourself wrote:
    so while that 2nd mount lives on
    no /media/cdrom/* is visble...until unmount the 2nd mount!
    On three different machines unlzma complains that it cannot find /media/cdrom/boot (No such file or directory). I must use /mnt on lines 2 & 4 instead of /media. I don't know what works for other people.

    Second problem: unlzma -S gz doesn't work either because no "-S" option. SliTaz unlzma is not a "real" unlzma; it's only busybox, so only two options: -c -f.

    In any case, I already have a working slitaz.fs doing it the other way. What I'm working on is making the boot process find the flash drive and loopmount the loopfile and then switch_root into it.
  • marquiticomarquitico March 2011
    @mojo:
    Oh, if that works here, you will have soooooo made my whole day. Will try it when I get home.
  • marquiticomarquitico March 2011
    @mojo:
    Alas, no joy.

    After trying over and over and staring at the screen, I am fairly certain that it simply never mounts /dev/sdb1, which is the flash drive my slitaz.fs loopfile is on. But I can't tell why. The boot messages do not refer to the mount= cheatcode at all, but mojo's rootdelay has no effect either, so I'm not sure.

    The loopfs= cheatcode does work, however. The boot process tries to find slitaz.fs and loopmount it on /mnt, but since the flash drive is not mounted, it produces a "no such file" error.

    mojo asked a very good question: did anybody actually test the loop install method to verify it?

    In the meanwhile, my poor man's alternative: after booting up, I mount the flash drive and loopmount the slitaz.fs manually, and then chroot into the loopfile. So I know that the loopfile was not only created properly, but contains a viable filesystem, just waiting to be used!

    But making the chrooted filesystem usable is a little tedious since it must be done every time, so booting directly into the loopfile would be ideal. Any thoughts?
  • ultraradultrarad March 2011
    The problem could be hardware related, so you could try both grub and grub2 in addition to syslinux/isolinux.  Try these with an extreme rootdelay=80 and if that works reduce it to find the minimum.

    HTH

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