booting trouble - USB issue

Post Reply
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

booting trouble - USB issue

Post by mimosa »

I am creating this new thread to continue the USB issue part of the discussion in this old thread:

http://www.salixos.org/forum/viewtopic. ... 368#p24368

As requested by Shador there, here is the output of

Code: Select all

#bash -x install-on-usb.sh 2>&1 | tee log

Code: Select all

++ dirname install-on-USB.sh
+ cd .
+ VER=1.7
+ AUTHOR='Pontvieux Cyrille - jrd@enialis.net'
+ LICENCE='GPL v3+'
++ basename install-on-USB.sh
+ SCRIPT=install-on-USB.sh
++ readlink -f install-on-USB.sh
+ SCRIPT=/media/disk/boot/install-on-USB.sh
+ '[' '!' -t 0 ']'
+ '[' '' = --version ']'
+ '[' '' = -v ']'
+ '[' '' = --help ']'
+ '[' '' = -h ']'
++ id -ru
+ '[' 0 -ne 0 ']'
++ get_mnt_dir
++ OIFS=' 	
'
++ IFS='
'
+++ mount
+++ sed -e 's/^.* on \(.*\) type.*$/\1/'
+++ sort -dur
++ mounts='/sys
/proc
/media/disk
/home/one/.gvfs
/'
++ startdir=/media/disk/boot
++ unset mntdir
++ '[' /media/disk/boot '!=' / ']'
++ for m in '$mounts'
++ '[' /media/disk/boot = /sys ']'
++ for m in '$mounts'
++ '[' /media/disk/boot = /proc ']'
++ for m in '$mounts'
++ '[' /media/disk/boot = /media/disk ']'
++ for m in '$mounts'
++ '[' /media/disk/boot = /home/one/.gvfs ']'
++ for m in '$mounts'
++ '[' /media/disk/boot = / ']'
++ cd ..
++ '[' /media/disk '!=' / ']'
++ for m in '$mounts'
++ '[' /media/disk = /sys ']'
++ for m in '$mounts'
++ '[' /media/disk = /proc ']'
++ for m in '$mounts'
++ '[' /media/disk = /media/disk ']'
++ echo /media/disk
++ cd /media/disk/boot
++ return
+ MNTDIR=/media/disk
+ RES=0
+ '[' 0 -ne 0 ']'
+ '[' '!' -f /media/disk/salix-mate-13.37-32.live ']'
++ cd ..
++ echo /media/disk
++ sed -e s:/media/disk:: -e 's:^/::'
+ BASEDIR=
+ '[' -n '' ']'
++ get_dev_part /media/disk
++ MNTDIR=/media/disk
+++ mount
+++ grep 'on /media/disk '
+++ cut '-d ' -f1
+++ head -n 1
++ DEVPART=/dev/sdb1
++ '[' -z /dev/sdb1 ']'
+++ echo /dev/sdb1
+++ awk '{s=substr($1, 1, 1); print s;}'
++ '[' / '!=' / ']'
++ '[' '!' -r /dev/sdb1 ']'
++ '[' '!' -b /dev/sdb1 ']'
++ echo /dev/sdb1
+ DEVPART=/dev/sdb1
+ RES=0
+ '[' 0 -ne 0 ']'
++ get_partition_num /dev/sdb1
++ DEVPART=/dev/sdb1
++ echo /dev/sdb1
++ sed 's/^.*[^0-9]\([0-9]*\)$/\1/'
+ PARTNUM=1
+ RES=0
+ '[' 0 -ne 0 ']'
++ get_dev_root /dev/sdb1 1
++ DEVPART=/dev/sdb1
++ PARTNUM=1
+++ echo /dev/sdb1
+++ sed 's/1$//'
++ DEVROOT=/dev/sdb
+++ echo /dev/sdb
+++ awk '{s=substr($1, 1, 1); print s;}'
++ '[' / '!=' / ']'
++ '[' '!' -r /dev/sdb ']'
++ '[' '!' -b /dev/sdb ']'
++ echo /dev/sdb
+ DEVROOT=/dev/sdb
+ RES=0
+ '[' 0 -ne 0 ']'
+ install_syslinux /media/disk /dev/sdb /dev/sdb1 1 ''
+ DIR=/media/disk
+ DEVICE=/dev/sdb
+ DEVPART=/dev/sdb1
+ PARTNUM=1
+ BASEDIR=
+ USELILO=true
+ img=/media/disk/boot/g2l.img
+ relimg=boot/g2l.img
+ '[' -f /media/disk/boot/g2l.img ']'
+ which syslinux
+ '[' 0 -ne 0 ']'
+ which parted
+ '[' 0 -ne 0 ']'
+ which lilo
+ '[' 0 -ne 0 ']'
+ echo 'Warning: syslinux+grub2 is about to be installed in /dev/sdb'
Warning: syslinux+grub2 is about to be installed in /dev/sdb
+ '[' /dev/sdb1 '!=' /dev/sdb ']'
+ echo 'on partition /dev/sdb1'
on partition /dev/sdb1
+ printf 'Do you want to continue? [y/N] '
Do you want to continue? [y/N] + read R
+ '[' y = y ']'
+ set -e
++ dd if=/dev/sdb bs=1 count=2 skip=510
++ od -t x1
++ tr '\n' ' '
+ signature='0000000 55 aa 0000002 '
+ '[' '0000000 55 aa 0000002 ' '!=' '0000000 55 aa 0000002 ' ']'
++ echo /dev/sdb
++ tr / _
++ date +%Y%m%d%H%M
+ bakfile=/media/disk/boot/_dev_sdb.mbr.201207111943
+ echo 'Backing up mbr of /dev/sdb to '\''/media/disk/boot/_dev_sdb.mbr.201207111943'\''...'
Backing up mbr of /dev/sdb to '/media/disk/boot/_dev_sdb.mbr.201207111943'...
+ dd if=/dev/sdb of=/media/disk/boot/_dev_sdb.mbr.201207111943 bs=512 count=1
1+0 records in
1+0 records out
512 bytes (512 B) copied, 3.0156e-05 s, 17.0 MB/s
+ echo 'Installing syslinux...'
Installing syslinux...
+ syslinux /dev/sdb1
+ '[' /dev/sdb1 '!=' /dev/sdb ']'
+ echo 'Do you want to overwrite the MBR loader (first 440 bytes)'
Do you want to overwrite the MBR loader (first 440 bytes)
+ echo 'of the disk? Recommended unless you know the code in there'
of the disk? Recommended unless you know the code in there
+ printf 'already does what you want. [y/N] '
already does what you want. [y/N] + read R
+ '[' y = y ']'
+ '[' true = true ']'
+ lilo -M /dev/sdb mbr -s /media/disk/boot/_dev_sdb.mbr.201207111943
Backup copy of /dev/sdb in /media/disk/boot/_dev_sdb.mbr.201207111943.0810
The Master Boot Record of  /dev/sdb  has been updated.
+ echo 'Setting bootable flag of /dev/sdb1...'
Setting bootable flag of /dev/sdb1...
+ parted /dev/sdb set 1 boot on
[?1034h
                                                                          
Information: You may need to update /etc/fstab.

+ sync
+ cat
+ set +e
+ exit 0
++ dirname install-on-USB.sh
+ cd .
+ VER=1.7
+ AUTHOR='Pontvieux Cyrille - jrd@enialis.net'
+ LICENCE='GPL v3+'
++ basename install-on-USB.sh
+ SCRIPT=install-on-USB.sh
++ readlink -f install-on-USB.sh
+ SCRIPT=/media/disk/boot/install-on-USB.sh
+ '[' '!' -t 0 ']'
+ '[' '' = --version ']'
+ '[' '' = -v ']'
+ '[' '' = --help ']'
+ '[' '' = -h ']'
++ id -ru
+ '[' 0 -ne 0 ']'
++ get_mnt_dir
++ OIFS=' 	
'
++ IFS='
'
+++ mount
+++ sed -e 's/^.* on \(.*\) type.*$/\1/'
+++ sort -dur
++ mounts='/sys
/proc
/media/disk
/home/one/.gvfs
/'
++ startdir=/media/disk/boot
++ unset mntdir
++ '[' /media/disk/boot '!=' / ']'
++ for m in '$mounts'
++ '[' /media/disk/boot = /sys ']'
++ for m in '$mounts'
++ '[' /media/disk/boot = /proc ']'
++ for m in '$mounts'
++ '[' /media/disk/boot = /media/disk ']'
++ for m in '$mounts'
++ '[' /media/disk/boot = /home/one/.gvfs ']'
++ for m in '$mounts'
++ '[' /media/disk/boot = / ']'
++ cd ..
++ '[' /media/disk '!=' / ']'
++ for m in '$mounts'
++ '[' /media/disk = /sys ']'
++ for m in '$mounts'
++ '[' /media/disk = /proc ']'
++ for m in '$mounts'
++ '[' /media/disk = /media/disk ']'
++ echo /media/disk
++ cd /media/disk/boot
++ return
+ MNTDIR=/media/disk
+ RES=0
+ '[' 0 -ne 0 ']'
+ '[' '!' -f /media/disk/salix-mate-13.37-32.live ']'
++ cd ..
++ echo /media/disk
++ sed -e s:/media/disk:: -e 's:^/::'
+ BASEDIR=
+ '[' -n '' ']'
++ get_dev_part /media/disk
++ MNTDIR=/media/disk
+++ mount
+++ grep 'on /media/disk '
+++ cut '-d ' -f1
+++ head -n 1
++ DEVPART=/dev/sdb1
++ '[' -z /dev/sdb1 ']'
+++ echo /dev/sdb1
+++ awk '{s=substr($1, 1, 1); print s;}'
++ '[' / '!=' / ']'
++ '[' '!' -r /dev/sdb1 ']'
++ '[' '!' -b /dev/sdb1 ']'
++ echo /dev/sdb1
+ DEVPART=/dev/sdb1
+ RES=0
+ '[' 0 -ne 0 ']'
++ get_partition_num /dev/sdb1
++ DEVPART=/dev/sdb1
++ echo /dev/sdb1
++ sed 's/^.*[^0-9]\([0-9]*\)$/\1/'
+ PARTNUM=1
+ RES=0
+ '[' 0 -ne 0 ']'
++ get_dev_root /dev/sdb1 1
++ DEVPART=/dev/sdb1
++ PARTNUM=1
+++ echo /dev/sdb1
+++ sed 's/1$//'
++ DEVROOT=/dev/sdb
+++ echo /dev/sdb
+++ awk '{s=substr($1, 1, 1); print s;}'
++ '[' / '!=' / ']'
++ '[' '!' -r /dev/sdb ']'
++ '[' '!' -b /dev/sdb ']'
++ echo /dev/sdb
+ DEVROOT=/dev/sdb
+ RES=0
+ '[' 0 -ne 0 ']'
+ install_syslinux /media/disk /dev/sdb /dev/sdb1 1 ''
+ DIR=/media/disk
+ DEVICE=/dev/sdb
+ DEVPART=/dev/sdb1
+ PARTNUM=1
+ BASEDIR=
+ USELILO=true
+ img=/media/disk/boot/g2l.img
+ relimg=boot/g2l.img
+ '[' -f /media/disk/boot/g2l.img ']'
+ which syslinux
+ '[' 0 -ne 0 ']'
+ which parted
+ '[' 0 -ne 0 ']'
+ which lilo
+ '[' 0 -ne 0 ']'
+ echo 'Warning: syslinux+grub2 is about to be installed in /dev/sdb'
Warning: syslinux+grub2 is about to be installed in /dev/sdb
+ '[' /dev/sdb1 '!=' /dev/sdb ']'
+ echo 'on partition /dev/sdb1'
on partition /dev/sdb1
+ printf 'Do you want to continue? [y/N] '
Do you want to continue? [y/N] + read R
+ '[' y = y ']'
+ set -e
++ dd if=/dev/sdb bs=1 count=2 skip=510
++ od -t x1
++ tr '\n' ' '
+ signature='0000000 55 aa 0000002 '
+ '[' '0000000 55 aa 0000002 ' '!=' '0000000 55 aa 0000002 ' ']'
++ echo /dev/sdb
++ tr / _
++ date +%Y%m%d%H%M
+ bakfile=/media/disk/boot/_dev_sdb.mbr.201207111943
+ echo 'Backing up mbr of /dev/sdb to '\''/media/disk/boot/_dev_sdb.mbr.201207111943'\''...'
Backing up mbr of /dev/sdb to '/media/disk/boot/_dev_sdb.mbr.201207111943'...
+ dd if=/dev/sdb of=/media/disk/boot/_dev_sdb.mbr.201207111943 bs=512 count=1
1+0 records in
1+0 records out
512 bytes (512 B) copied, 3.0156e-05 s, 17.0 MB/s
+ echo 'Installing syslinux...'
Installing syslinux...
+ syslinux /dev/sdb1
+ '[' /dev/sdb1 '!=' /dev/sdb ']'
+ echo 'Do you want to overwrite the MBR loader (first 440 bytes)'
Do you want to overwrite the MBR loader (first 440 bytes)
+ echo 'of the disk? Recommended unless you know the code in there'
of the disk? Recommended unless you know the code in there
+ printf 'already does what you want. [y/N] '
already does what you want. [y/N] + read R
+ '[' y = y ']'
+ '[' true = true ']'
+ lilo -M /dev/sdb mbr -s /media/disk/boot/_dev_sdb.mbr.201207111943
Backup copy of /dev/sdb in /media/disk/boot/_dev_sdb.mbr.201207111943.0810
The Master Boot Record of  /dev/sdb  has been updated.
+ echo 'Setting bootable flag of /dev/sdb1...'
Setting bootable flag of /dev/sdb1...
+ parted /dev/sdb set 1 boot on
[?1034h
                                                                          
Information: You may need to update /etc/fstab.

+ sync
+ cat
+ set +e
+ exit 0 
[url][/url]
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: booting trouble - USB issue

Post by mimosa »

I am very surprised to find that the Maté USB now works on the laptop. It definitely didn't before.

The only thing I can think that might have changed is that when I ran the install script to produce the log file above, I did so on this machine (a brand new Thinkpad) whereas before, I did so on our decrepit old desktop machine.

It will be interesting to see:

i) whether the stick works as is on the other machine (only when my daughter lets me use it);

ii) whether I can break it again by running the install script on that machine;

iii) whether the log file output is then different.

In any case, in a practical sense, my problem is solved - I have a working Salix stick with persistence and pine. So thanks to everyone for their time and thoughts. :D

However, natural curiosity makes me want to continue the investigation, especially to the extent that it may be useful for Salix. The CD issue (on the other thread) is now probably more so than the USB issue.
Adys
Posts: 156
Joined: 3. Apr 2012, 04:17

Re: booting trouble - USB issue

Post by Adys »

Good to know you have now a working USB device with Salix 8-) .

For the most part, setting a "clean" MBR and one (and only one) formatted FAT32 partition and using unetbootin 575+ is "safer" (in the sense that it covers more cases than the "install-on-USB" scripts). In certain cases, having a second hidden tiny partition may help with older BIOSes, but that's more of a "last resort".

Let's now solve the CD booting issue in the other topic (because the CD content is anyway the base for the installation on USB devices).
Shador
Posts: 1295
Joined: 11. Jun 2009, 14:04
Location: Bavaria

Re: booting trouble - USB issue

Post by Shador »

Adys wrote:For the most part, setting a "clean" MBR and one (and only one) formatted FAT32 partition and using unetbootin 575+ is "safer" (in the sense that it covers more cases than the "install-on-USB" scripts).
That's completely unrelated here. The problem is primarily caused by the absence of the syslinux.cfg file. No idea, how that could have happened. Maybe it was deleted accidentally? There was some problem with the filesystem, or for some reason the permissions did not suffice (but that shouldn't happen with root as required by the script). Maybe some application required by the script was not compatible (bash, cat, .....). Unless we're able to reproduce the issue and narrow it down, we'll probably never find out.
I guess it's rather some external issue, but maybe we could fail more gracefully.
Image
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: booting trouble - USB issue

Post by mimosa »

@ Shador

I'm happy to continue investigating if you feel it would be useful for the development of Salix.
Post Reply