l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
Page last updated:
2005 Jan 01 12:46

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] Getting new Linux box to boot
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] Getting new Linux box to boot

On Fri, 31 Dec 2004, Richard S. Crawford wrote:

> On Friday 31 December 2004 11:07, Peter Jay Salzman wrote:
> >    1a. cd into your *real* root filesystem, /mnt
> >    1b. Use chroot.  This makes /mnt temporarily "look" like /.
> >    1c. Run lilo and reboot.
> I remounted lumix to /mnt/lmx via:
> # mount /dev/hda1 /mnt/lmx -t ext2 -o exec
> Then I executed mount and got this:
> # mount
> .
> .
> .
> /dev/hda1 on /mnt/lmx type ext2 (rw)
> which seems like the exec flag is not being set.

That looks about like what the output of mount is on my
(working) system.  I think you are misinterpreting the (rw).

> Also, when I tried chroot:
> # chroot /mnt/lmx /bin/sh
> I got:
> illegal instruction
> I double checked and made sure that sh is really in /mnt/lmx/bin/sh
> All I can figure is that for some reason the exec flag is not really being set 
> when I execute the mount command, and this is causing the chroot command to 
> fail.

I run chroot something like this:

# mount -t ext3 /dev/hda3 /mnt/hda3
# cd /mnt/hda3
# chroot .

This avoids the issue that your current directory is outside the "view" of
the chroot environment when the chroot command returns control to you.  I
am also depending on the default behavior to start a shell in the chroot

What you have to keep in mind when using chroot, is that all the processes
you spawn from that point forward from that shell will load libraries,
refer to configuration files, and look for executables from the
perspective that /mnt/hda3 is the root.  Therefore, if the fstab on the
disk you are trying to resuscitate looks something like this [1]:

/dev/hda1   /boot  ext3  defaults   0 1
/dev/hda2   none   swap  sw         0 0
/dev/hda3   /      ext3  defaults   0 1

then you will want to premount the /boot partition in the appropriate
place before running lilo/grub:

# mount -t ext3 /dev/hda3 /mnt/hda3
# mount -t ext3 /dev/hda1 /mnt/hda3/boot
# cd /mnt/hda3
# chroot .

Thus, all the files are in place before you switch your perspective to the
simulated "normal" root partition.

Given your error, I would want to confirm that your "/lib" or "/bin" are
available and mounted properly.... even though putting such directories in
different partitions would be very strange.  "/usr" should not have to be
available at this point. I have not actually encountered your error yet,
though, so I don't know what the problem is in this case.

I don't recall what your rescue disk is, but if it has strace on it, you
might try that to see about where it barfs.  Knowing which libraries and
files it just loaded when it dies could provide some clues as to what is
going on.


[1] On older hardware, having your kernel reside in a smallish (100mb?)
boot partition near the front of the disk may be wise, since the bios may
not be smart enough to see your whole hard disk and if the kernel were
stored toward the end of it then LILO or GRUB might not be able to load

Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil@dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k

vox-tech mailing list

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
EDGE Tech Corp.
For donating some give-aways for our meetings.