Hi there !

I'm trying to boot from an iSCSI target using open-iscsi and a ubuntu
karmic revision.

# uname -a
Linux 2.6.35.9 #40 SMP Fri Jul 8 10:27:20 EDT 2011 armv6l GNU/Linux

# iscsid -v
iscsid version 2.0-870

I've managed to build a valid initramfs, to boot on it and get a valid
mount point giving a perfect acces to my iSCSI target contents. But
when my init script chroot to iSCSI rootfs and run real root /sbin/
init execution get unexpectedly stopped and kernel crashes.

So, I did the following test in my initramfs :

# iscsiadm -m node -T iqn.2011-06.net.online:tgt05 --login
Logging in to [iface: default, target: iqn.2011-06.net.online:tgt05,
portal: 192.168.11.42,3260]
Login to [iface: default, target: iqn.2011-06.net.online:tgt05,
portal: 192.168.11.42,3260]: successful
# mount /dev/sda /mnt
# chroot /mnt /bin/ls /
Segmentation fault
# chroot /mnt /bin/ls /
Segmentation fault
# chroot /mnt /bin/ls /
bin  boot  chroot.sh  dev  etc  home  lib  lost+found  media  mnt
opt  proc  root  sbin  selinux  setup.sh  srv  sys  tmp  usr  var

As you can see, chrooted execution of ls fails several times and then
works.

I can get the error again by relogging to my target :

# iscsiadm -m node -T iqn.2011-06.net.online:tgt05 --logout
Logging out of session [sid: 2, target: iqn.2011-06.net.online:tgt05,
portal: 192.168.11.42,3260]
Logout of [sid: 2, target: iqn.2011-06.net.online:tgt05, portal:
192.168.11.42,3260]: successful
# iscsiadm -m node -T iqn.2011-06.net.online:tgt05 --login
Logging in to [iface: default, target: iqn.2011-06.net.online:tgt05,
portal: 192.168.11.42,3260]
Login to [iface: default, target: iqn.2011-06.net.online:tgt05,
portal: 192.168.11.42,3260]: successful
# chroot /mnt /bin/ls /
Segmentation fault

or by executing another binary which actually use another libraries :

# chroot /mnt /usr/bin/find /tmp
Illegal instruction

It seems, execution fails getting libraries into cache in one shot.

In fact, if I strace execution I find out that crashes are happening
unpredictably. Also, I can get various errors : Segmentation fault,
Bad address, Illegal instruction ...

Then, I discover that the problem doesn't appear when running
statically built binaries, I've re-built ls from sources but
statically and get NO problem.

That's why I've tried the following :

# export LD_LIBRARY_PATH=/mnt/lib:/mnt/usr/lib
# export LD_DEBUG=files
# ls
...
        1735:     calling init: /mnt/lib/libpthread.so.0
        1735:     calling init: /mnt/lib/libc.so.6
        1735:     calling init: /mnt/lib/libattr.so.1
        1735:     calling init: /mnt/lib/libdl.so.2
        1735:     calling init: /mnt/lib/libgcc_s.so.1
        1735:     calling init: /mnt/lib/libacl.so.1
        1735:     calling init: /mnt/lib/libselinux.so.1
        1735:     calling init: /mnt/lib/librt.so.1
        1735:     initialize program: ls
        1735:     transferring control: ls
bin  boot  chroot.sh  core  dchroot.conf  dev  etc  flash  home  lib
media  mnt  opt  proc  root  sbin  selinux  setup.sh  srv  sys  tmp
usr  var

Libraries are loaded from iSCSI mount point without any problem.
It confirms the issue only appears under chrooted environment.


Note that the chroot test is passing without any problem if I mount
the same rootfs but via other device types : NFS is okay, NAND
mtdblock device is okay, it even works over a MooseFS share. It seems
like only iSCSI is disturbing my chrooted environment.


Also, I did network stress testing. I made readings, writings,
mmapings, copies of huge files located on my iSCSI target through the
mounted block device. I couldn't highlight any problem of this kind.

Well I'm sure there's something to do with iscsi and chroot but now,
I'm running out of testing ideas.


Does anyone can help me resolving this issue ?


Regards,

Pierre-O

-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to open-iscsi@googlegroups.com.
To unsubscribe from this group, send email to 
open-iscsi+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/open-iscsi?hl=en.

Reply via email to