impossible to chroot /mnt/linux from pxe booted sysresccd

Questions related to network booting via PXE
JLChafardet
Posts: 1
Joined: 13 Jun 2012, 16:08

impossible to chroot /mnt/linux from pxe booted sysresccd

Postby JLChafardet » 13 Jun 2012, 16:30

Hello fellas! thanks for taking the time to read this.

A friend of mine, somehow, he still doesn't want to tell me, deleted his /boot partition, then formated it, and its freaking empty!

as you can imagine, is not booting!, his provider has a sysresccd pxe boot tool, that allows trying to fix issues on servers.

the OS the server has is Debian 4


[email protected] /mnt/linux % cat etc/debian_version
4.0
[email protected] /mnt/linux %

if i do fsarchiver

[email protected] /mnt/linux % fsarchiver probe detailed
[======DISK======] [=============NAME==============] [====SIZE====] [MAJ] [MIN]
[sda ] [WDC WD2500JS-75N ] [ 232.83 GB] [ 8] [ 0]

[=====DEVICE=====] [==FILESYS==] [======LABEL======] [====SIZE====] [MAJ] [MIN] [==============LONGNAME==============] [=================UUID=================]
[loop0 ] [squashfs ] [<unknown> ] [ 265.55 MB] [ 7] [ 0] [/dev/loop0 ] [<unknown> ]
[sda1 ] [ext2 ] [<unknown> ] [ 243.14 MB] [ 8] [ 1] [/dev/sda1 ] [da0df22b-ce4c-49f9-be93-37796f59737b ]
[sda5 ] [LVM2_member] [<unknown> ] [ 232.59 GB] [ 8] [ 5] [/dev/sda5 ] [XUbFjn-0b1O-NJKo-yP9t-7FGz-1DfX-U2MzpX]
[dm-0 ] [ext3 ] [<unknown> ] [ 230.00 GB] [253] [ 0] [/dev/mapper/srv1.somedomain.com-root ] [c91cf104-3a6b-4c15-8e60-0669a57464c3 ]
[dm-1 ] [swap ] [<unknown> ] [ 2.59 GB] [253] [ 1] [/dev/mapper/srv1.somedomain.com-swap_1] [<unknown> ]
[email protected] /mnt/linux %

indeed, as expected, /dev/sda1 is whats suposed to hold the /boot partition, tho is freaking empty


[email protected] /mnt % mkdir boot
[email protected] /mnt % mount /dev/sda1 /mnt/boot
[email protected] /mnt % ls -l /mnt/boot
total 1
drwxr-xr-x 2 root root 1024 Oct 20 04:54 grub
[email protected] /mnt % ls -l /mnt/boot/grub
total 195
-rw-r--r-- 1 root root 197 Oct 20 04:54 default
-rw-r--r-- 1 root root 30 Oct 20 04:54 device.map
-rw-r--r-- 1 root root 8764 Oct 20 04:54 e2fs_stage1_5
-rw-r--r-- 1 root root 7924 Oct 20 04:54 fat_stage1_5
-rw-r--r-- 1 root root 7176 Oct 20 04:54 ffs_stage1_5
-rw-r--r-- 1 root root 7180 Oct 20 04:54 iso9660_stage1_5
-rw-r--r-- 1 root root 8736 Oct 20 04:54 jfs_stage1_5
-rw-r--r-- 1 root root 7372 Oct 20 04:54 minix_stage1_5
-rw-r--r-- 1 root root 9752 Oct 20 04:54 reiserfs_stage1_5
-rw-r--r-- 1 root root 512 Oct 20 04:54 stage1
-rw-r--r-- 1 root root 107912 Oct 20 04:54 stage2
-rw-r--r-- 1 root root 7476 Oct 20 04:54 ufs2_stage1_5
-rw-r--r-- 1 root root 6796 Oct 20 04:54 vstafs_stage1_5
-rw-r--r-- 1 root root 9652 Oct 20 04:54 xfs_stage1_5
[email protected] /mnt %

at first, i thought was just a grub problem, so mounted the partition and did grub-install, which as you see, added that there.

now, i have n vmlinuz nor initrd, the ones on the root partition are symlinks to /boot.

im following the guide here: http://www.sysresccd.org/Sysresccd-Part ... maged-Grub

but when i reach the step of chrooting /mnt/linux, it just doesnt happen, no matter what I try

[email protected] /mnt % chroot /mnt/linux
chroot: failed to run command `/bin/zsh': No such file or directory
[email protected] /mnt %

[email protected] /mnt % chroot /mnt/linux /bin/bash
/bin/bash: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
[email protected] /mnt %

[email protected] /mnt % chroot /mnt/linux /bin/zsh
chroot: failed to run command `/bin/zsh': No such file or directory
[email protected] /mnt % locate zsh
/bin/zsh <- exists.

which well, led me here! to ask for your help.

so anything that you can provide me with, is greatly welcome.

gernot
Posts: 1127
Joined: 07 Apr 2010, 16:19

Re: impossible to chroot /mnt/linux from pxe booted sysrescc

Postby gernot » 13 Jun 2012, 17:56

As first option to boot the bad system try the "root=" option like described here
http://www.sysresccd.org/Sysresccd-manu ... ot_options

Second option:
copy the initrd and kernel to /dev/sda1
boot with supergrubdisk (in floppyimages) and edit the bootline manual.

Third option:
copy the initrd , kernel and create a extlinux.conf on /dev/sda1
install extlinux to /dev/sda1

Gernot
p.s. use a 64 bit kernel while chroot to a 64 bit system.


Return to “Network Boot via PXE”

Who is online

Users browsing this forum: No registered users and 1 guest