Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Installing Gentoo
  • Search

Booting an i686 «generic» gentoo from a portable drive

Having problems with the Gentoo Handbook? If you're still working your way through it, or just need some info before you start your install, this is the place. All other questions go elsewhere.
Post Reply
Advanced search
5 posts • Page 1 of 1
Author
Message
fargred
n00b
n00b
Posts: 67
Joined: Tue Oct 19, 2010 9:32 am

Booting an i686 «generic» gentoo from a portable drive

  • Quote

Post by fargred » Mon Mar 18, 2013 6:05 pm

I wanted to build an x86 gentoo I would run on (almost) every computer (or at least those ones I have) as a rescue and backup system. I’ve compiled the kernel, but for some reason, it refuses to run well.

First of all, the rescue system is placed on portable hard drive. It connects via USB-2.x. The hardware I testing this rescue system on is a PC (intel i5), with one internal hard drive usually available at boot time as sda (and our precious USB drive as sdb). No any RAIDs. I use grub-0.97 as a loader and tried to boot with or without initrd, both ways come to fail, but for some reason the way without initrd at least get me to the bash login prompt.

This is what enabled in the kernel – http://pastie.org/pastes/6606022/text

Code: Select all

title Rescue Gentoo Linux 3.7.5
root (hd0,0)
kernel /vmlinuz-3.7.5 rootwait root=/dev/sdb2
The lines above get me to the login prompt. But! Root FS stay mounted readonly and I type login name and pass without cursor. It appears only after the command

Code: Select all

mount -n -o remount,rw `sed -nr 's_(\S+)\s+/\s+.*_\1_p' /etc/mtab` /
Then the filesystem remount in rw mode and the cursor appears and starts to blinking normally. Any other options, like those specified in the second example will not allow to remount it well, though.

Code: Select all

title Gentoo Linux 3.7.5
root (hd0,0)
kernel /vmlinuz-3.7.5 rootwait root=/dev/ram0 real_root=LABEL=t_root rootflags=rw,data=journal,barrier=1,errors=remount-ro ipv6.disable=1
initrd /initramfs-genkernel-x86-3.7.5
attaching the external drive…

Code: Select all

[4.61…] scsi: 10:0:0:0: Direct_Access StoreJet Transcend SAJI PQ:0 ANSI: 2 CCS
…
[4.75…] sd 10:0:0:0: [sdb] Attached SCSI disk
…and just stops booting. No errors thrown. I waited some minutes then did SysRq+W and get

Code: Select all

task
swapper/0    D    c1e968f0    5316     1    0x00000000
I’ve tried to catch that moment during the ‘successful’ boot, and the next lines after ‘Attached SCSI’ were about swap too.

initrd was compiled by genkernel in the directory of the current (and the only present) kernel, but not at the same time as the kernel (kernel was build with old-fashion way via make && make modules…), but later, when I decided that I want to mount root fs by LABEL and, therefore, need initrd. Root filesystem is ext3.

Any thoughts?
Top
tuner23
Tux's lil' helper
Tux's lil' helper
Posts: 82
Joined: Thu May 18, 2006 5:42 pm

  • Quote

Post by tuner23 » Tue Mar 19, 2013 7:46 am

Hello,


hmm.. when exactly does the bootup fail? When starting init (right after starting up the kernel), or after that during boot?

If it fails during boot:
for booting without initram, i think
/etc/init.d/root
does the trick.
You have to start the service while booting with

Code: Select all

rc-update add root boot


If it fails right after loading the kernel, this could be (the second with initramfs look like this), it looks like the device is not found.

1. The problem with the attached disk can be a race-condition (which device is loaded first), so the devices are not statically assigned to sda/sdb. the order could change, if the conditions of the system (like attaching a usb-disk) changes.
2. Or, as it is a usb-disk, it also could take too much time for the kernel to identify/scan the usb-drives, so when the kernel tries to start the init-process the device isn't already there.

At least i think it is a problem with identifying the root-partition.


Hope that helps..

Antonios.
Top
fargred
n00b
n00b
Posts: 67
Joined: Tue Oct 19, 2010 9:32 am

  • Quote

Post by fargred » Tue Mar 19, 2013 5:17 pm

tuner23 wrote:hmm.. when exactly does the bootup fail? When starting init (right after starting up the kernel), or after that during boot?
It fails a bit before the init starts.
tuner23 wrote:for booting without initram, i think
/etc/init.d/root
does the trick.
ls -l /media/t_root/etc/runlevels/boot/root
lrwxrwxrwx 1 root root 16 Дек 13 09:47 /media/t_root/etc/runlevels/boot/root -> /etc/init.d/root
tuner23 wrote:If it fails right after loading the kernel, this could be (the second with initramfs look like this), it looks like the device is not found.

1. The problem with the attached disk can be a race-condition (which device is loaded first), so the devices are not statically assigned to sda/sdb. the order could change, if the conditions of the system (like attaching a usb-disk) changes.
I can say that sda is always internal and sdb — external drive.
tuner23 wrote:2. Or, as it is a usb-disk, it also could take too much time for the kernel to identify/scan the usb-drives, so when the kernel tries to start the init-process the device isn't already there.
I thought about that too, the rootwait option in the first grub section is for waiting the USB drive to appear. The kernel default timeout for waiting is 30 sec AFAIR. Though, I can’t say whether rootwait works during loading kernel to /dev/ram0 and after that, when it must mount the rootfs partition. I’ve read kernel documentation about rootwait option and usb-storage module, but haven’t found any clue.
Top
fargred
n00b
n00b
Posts: 67
Joined: Tue Oct 19, 2010 9:32 am

  • Quote

Post by fargred » Tue Mar 19, 2013 5:20 pm

fargred wrote:
tuner23 wrote:hmm.. when exactly does the bootup fail? When starting init (right after starting up the kernel), or after that during boot?
It fails a bit before the init starts. The kernel does not seem to be fully loaded, however, as you could notice, sysrq commands already work.
tuner23 wrote:for booting without initram, i think
/etc/init.d/root
does the trick.
ls -l /media/t_root/etc/runlevels/boot/root
lrwxrwxrwx 1 root root 16 Дек 13 09:47 /media/t_root/etc/runlevels/boot/root -> /etc/init.d/root
tuner23 wrote:If it fails right after loading the kernel, this could be (the second with initramfs look like this), it looks like the device is not found.

1. The problem with the attached disk can be a race-condition (which device is loaded first), so the devices are not statically assigned to sda/sdb. the order could change, if the conditions of the system (like attaching a usb-disk) changes.
I can say that sda is always internal and sdb — external drive.
tuner23 wrote:2. Or, as it is a usb-disk, it also could take too much time for the kernel to identify/scan the usb-drives, so when the kernel tries to start the init-process the device isn't already there.
I thought about that too, the rootwait option in the first grub section is for waiting the USB drive to appear. The kernel default timeout for waiting is 30 sec AFAIR. Though, I can’t say whether rootwait works during loading kernel to /dev/ram0 and after that, when it must mount the rootfs partition. I’ve read kernel documentation about rootwait option and usb-storage module, but haven’t found any clue.
Top
tuner23
Tux's lil' helper
Tux's lil' helper
Posts: 82
Joined: Thu May 18, 2006 5:42 pm

  • Quote

Post by tuner23 » Tue Mar 19, 2013 5:51 pm

Hy,

for my system i use sometimes a special init-script inside initramfs to see whats going on.

The trick is to use busybox and use shell-command.

something like:

Code: Select all

#!/bin/busybox sh

export PATH=/bin
umask 0077

mount -t proc none /proc
mount -t sysfs none /sys

sh

umount /proc
umount /sys
exec switch_root /rootfs /sbin/init
Maybe you can try this out..


Greets,
Antonis.
Top
Post Reply

5 posts • Page 1 of 1

Return to “Installing Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic