Page 1 of 2

booting from usb

Posted: 15. Nov 2013, 12:41
by anamesa
After successfully booting from usb, following the procedure described in following post:
http://forum.salixos.org/viewtopic.php?f=16&t=4941
(borrowed from another salixos forum post), I encountered a problem with booting the second, third etc times. I repeated the initrd procedure (essentially I re-made initrd) and booted for one time, then again could not, with some info about not being able to load a tty. I cannot copy-paste this info, the best I could do was to save the dmesg to another disk, which I upload, but there isn't much info there.

It seems that something in the initrd works the first time but not on second boot.

I'll come back with more info, by editing this post.

So, here are some snips from the end screen when trying to boot (I read and write parts from the screen of my laptop to this post)
The ..... are to spare me some typing.

Code: Select all

/boot/initrrd.gz: Loading kernel modules from initrd image:
insmod /lib/modules/3.2.45/kernel/drivers/hid/hid.ko
insmod /lib/modules/............................../hid/usbhid/usbhid.ko
insmod /lib/modules/............................../fs/mbcache.ko
....
ERROR: could not insert 'mbcache': Exec format error
insmod /lib/modules/........................../fs/jbd2/jbd2.ko
.......
ERROR:  could not insert 'jbd2': Exec format error
.......
insmod /lib/modules/........................../fs/jbd2/jbd2.ko
........
ERROR: could not insert 'ext4': Exec format error
..........
..........
..........
mount:  mounting /dev/sdd10 on /mnt failed: No such file or directory
ERROR:  No /sbin/init found on rootdev (or not mounted). Trouble ahead. 
               You can try to fix it. Type 'exit' whhen things are done.

/bin/sh:  can't access tty; job control turned off
/#

Any ideas as to what causes the failure?

PS
The last lines of dmesg don't say anything useful:

Code: Select all

...
[   10.282232] usbcore: registered new interface driver usbhid
[   10.282235] usbhid: USB HID core driver
[   10.284127] mbcache: exports duplicate symbol mb_cache_create (owned by kernel)
[   10.290734] jbd2: exports duplicate symbol jbd2__journal_restart (owned by kernel)
[   10.297693] jbd2: exports duplicate symbol jbd2__journal_restart (owned by kernel)
[  295.863823] EXT3-fs (sda7): error: couldn't mount because of unsupported optional features (240)
[  295.879481] EXT2-fs (sda7): error: couldn't mount because of unsupported optional features (240)
[  295.917163] EXT4-fs (sda7): mounted filesystem with ordered data mode. Opts: (null)

Re: booting from usb

Posted: 16. Nov 2013, 05:08
by djemos

Re: booting from usb

Posted: 16. Nov 2013, 07:48
by anamesa
I did exactly what is described in this forum post you refer me to (changing the partition name of course to suit my installation), albeit not from a hard drive installation, but from salix's live media (cd) as per gapan's suggestion. It worked the first, maybe also the second time, but then I couldn't boot, and describe the situation in my previous post. I essentially repeated the procedure of building initrd, then it booted for once again, and then again not. So I tried to copy per hand the messages of the failure by writing them in my post in another computer, while booting my laptop. If this cannot help, I'll repeat the initrd procedure once more, and then, if not successfull, I'll do a reinstallation.

Thank you for answering.

Re: booting from usb

Posted: 16. Nov 2013, 08:55
by anamesa
I just repeated the initrd procedure, and booted again, for three consequential times. I hope this time it lasts, but I'm afraid it won't. In this case I'll come back.

Thanks.

Re: booting from usb

Posted: 21. Nov 2013, 14:57
by anamesa
But after a couple of days, previous behaviour returned. It ends with:

Code: Select all

ERROR: could not insert 'ext4': Exec format error
..........
..........
..........
mount:  mounting /dev/sdd10 on /mnt failed: No such file or directory
ERROR:  No /sbin/init found on rootdev (or not mounted). Trouble ahead. 
               You can try to fix it. Type 'exit' whhen things are done.

/bin/sh:  can't access tty; job control turned off
/#
and in order to fix it I have to repead the inirtd procedure once more. Any ideas as to what would be causing the problem?

Re: booting from usb

Posted: 22. Nov 2013, 06:34
by Atip
I use pkgtool to create a boot stick. Easy to do and never failed me.

As su: pkgtool>setup>make-bootdisk>OK>Create
insert USB stick >OK

After that copy vmlinuz from wanted boot directory to stick as vmlinuz.
Create file syslinux.cfg on boot stick.
Edit syslinux.cfg. Mine looks like this:

Code: Select all

default vmlinuz root=/dev/sda6 vga=791 ro
prompt 1
timeout 60
label mount
  kernel vmlinuz
  append root=/dev/sda6 vga=791 ro
Change to your needs.

In the boot directory initrd.gz must be present.

Re: booting from usb

Posted: 22. Nov 2013, 07:00
by anamesa
OK, thanks, I'll temporarily follow your suggestion for creating the boot usb stick. This is of course an intermediate solution, it makes things easier, but it doesn't address the reason why my boot procedure fails. Anyway, I'll be happy not to be forced to build an initrd everytime I want to boot into salix.

Re: booting from usb

Posted: 22. Nov 2013, 17:40
by anamesa
I wonder if there is a kernel (eg the one used for the installation), which contains the needed modules. I suppose the kernel used after the installation is a mofified one, offering modules needed to boot from usb. Is there any other difference between this kernel and the finally installed one? I suppose this could be a (not optimal, but convenient) solution to the problem I have with booting (only with salix, I have about 8 different distros installed at the time, none of which has this problem of usb booting, but I like salix and intend to use it on my netbook. For now, I use the 64bit edition on my laptop, have installed wine (and multilib) and enjoy the distro.

Re: booting from usb

Posted: 23. Nov 2013, 08:34
by djemos
anamesa wrote:I wonder if there is a kernel (eg the one used for the installation), which contains the needed modules. I suppose the kernel used after the installation is a mofified one, offering modules needed to boot from usb. Is there any other difference between this kernel and the finally installed one? I suppose this could be a (not optimal, but convenient) solution to the problem I have with booting (only with salix, I have about 8 different distros installed at the time, none of which has this problem of usb booting, but I like salix and intend to use it on my netbook. For now, I use the 64bit edition on my laptop, have installed wine (and multilib) and enjoy the distro.
the kernel used after the installation is the original. The live kernel is a modified one. The problem appears because you use a live kernel to make an initrd to be used from the installed kernel to boot from usb.
In the above link i wrote in a previous post i said to make the initrd from a hard disk salix installed system which has the right kernel and not from a live iso.
Follow exactly the steps 1,2,3,4 as described there.

Re: booting from usb

Posted: 24. Nov 2013, 11:06
by anamesa
Thank you for the reply. I'll follow your suggestion, when I get some space on my /dev/sda to make an "original" hard disk installation. I hope this will be in the next couple of days. Your explanation of the problem is the best I have read till now, but it doesn't explain why I can indeed boot the first 2, 3, 4 maybe even more times, in the beginning, with the procedure I followed (which BTW was just an implementation of gapan's suggestion in a previous post).

Having had the same problem with an antix usb installation, which worked from this laptop (Lenovo) but not (another usb installation) from an acer netbook, the message from the debian kernel was that common problems are either boot arguments (rootdelay= , or not right root device) or modules missing. In this case it was not the right root device having been chosen by grub2. In the case of salix this is not the case, so I'll try to set rootdelay parameter at first, and if I fail, I'll head to a hard drive installation.

EDIT:
If I understand correctly, then the initrd has to be built from a system with the right kernel, that is the one the installed (in HDD) distro uses. So, if I manage to boot to my salix usb installation once more, I can try to make the initrd from there, with the running kernel, which is the one of the installed in HDD distro. That would replace the initrd.gz from the huge.smp kernel used for the live media. So, I'll repeat the initrd procedure once more from the live media, hopefully boot to the distro, and then redo the initrd, so as to have an initrd.gz corresponding to the distro's normal kernel. If this succeeds it could be a way to avoid doing a hdd installation, but merely doing the initrd thing twice. I'll post the results.