Re: Booting from usb hard disk

From: Nenhum_de_Nos <matheus_at_eternamente.info>
Date: Sun, 5 Apr 2009 15:54:35 -0300 (BRT)
On Mon, March 30, 2009 03:10, Andrew Thompson wrote:
> On Tue, Mar 24, 2009 at 03:49:32AM -0500, Robert Noland wrote:
>> On Mon, 2009-03-23 at 19:40 -0300, Nenhum_de_Nos wrote:
>> > On Mon, March 23, 2009 07:36, Robert Noland wrote:
>> > > So I have my i386 install on a usb hard disk, which I can only boot
>> on
>> > > one machine now.  The one machine that I can make work has a bios
>> option
>> > > that reads "BIOS ehci handoff".  This used to work with the old usb
stack.  The machines that it doesn't work on, boot the kernel, but
>> fail
>> > > to mount root, giving me the forbidding mountroot> prompt, which is
immediately followed by the message saying that da0 is attached.
>> da0 is
>> > > however not listed in the available boot devices list.  I tried
>> playing
>> > > around with the timeout in vfs_mount.c, but that didn't seem to
have
>> any
>> > > impact.  It has been suggested that this may be a "geom" timeout,
>> but I
>> > > don't know anything about the boot system really.
>> >
>> > I had problem a while ago with via mini itx hardware, that was quite
close. If I try boot from usb (installed in usb hdd), I get to the
>> point
>> > of loader not finding my disk.
>> >
>> > I then used a small flash disk attached to the ata (44 pin ide)
>> channel
>> > and formatted /boot in there. this way I get to the point of mount
>> root
>> > you said, and da0 not being alive soon enough to mount root. list
>> disks
>> > also couldn't find da0 though.
>> >
>> > I tried current from that time, and no good.
>> >
>> > if this is solved, I'll be happy to try whatever patch to current.
(as
>> > long as I can install it from another box/or its ata channel, as it
>> can't
>> > boot vanilla 7.1R)
>> So, my solution was to set kern.cam.scsi_delay=10000
>> in /boot/loader.conf
>
> The following patch should work. It creates interleaving root hold
tokens from the CAM probe to disk_create and geom providor tasting. I
had to add a malloc type flag as sleeping isnt allowed at the point I
added the token alloc in CAM.
>
> http://people.freebsd.org/~thompsa/root_wait.diff
>
> It needs review by the various geom/cam ppls.
>
>
> Andrew

phoenix# patch < ../root_wait.diff
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: kern/vfs_mount.c
|=================================================================== |---
kern/vfs_mount.c	(revision 190540)
|+++ kern/vfs_mount.c	(working copy)
--------------------------
Patching file kern/vfs_mount.c using Plan A...
Reversed (or previously applied) patch detected!  Assume -R? [y]
Hunk #1 succeeded at 1353.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: cam/cam_xpt.c
|=================================================================== |---
cam/cam_xpt.c	(revision 190540)
|+++ cam/cam_xpt.c	(working copy)
--------------------------
Patching file cam/cam_xpt.c using Plan A...
Reversed (or previously applied) patch detected!  Assume -R? [y]
Hunk #1 succeeded at 5139.
Hunk #2 succeeded at 5201.
Hunk #3 succeeded at 5232.
Hunk #4 succeeded at 5240.
Hunk #5 succeeded at 5353.
Hunk #6 succeeded at 5372.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: dev/pccbb/pccbb_pci.c
|=================================================================== |---
dev/pccbb/pccbb_pci.c	(revision 190540)
|+++ dev/pccbb/pccbb_pci.c	(working copy)
--------------------------
Patching file dev/pccbb/pccbb_pci.c using Plan A...
Reversed (or previously applied) patch detected!  Assume -R? [y]
Hunk #1 succeeded at 439.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: dev/usb/controller/usb_controller.c
|=================================================================== |---
dev/usb/controller/usb_controller.c	(revision 190540)
|+++ dev/usb/controller/usb_controller.c	(working copy)
--------------------------
Patching file dev/usb/controller/usb_controller.c using Plan A...
Reversed (or previously applied) patch detected!  Assume -R? [y]
Hunk #1 succeeded at 115.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: geom/mirror/g_mirror.c
|=================================================================== |---
geom/mirror/g_mirror.c	(revision 190540)
|+++ geom/mirror/g_mirror.c	(working copy)
--------------------------
Patching file geom/mirror/g_mirror.c using Plan A...
Reversed (or previously applied) patch detected!  Assume -R? [y]
Hunk #1 succeeded at 2907.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: geom/geom_disk.c
|=================================================================== |---
geom/geom_disk.c	(revision 190540)
|+++ geom/geom_disk.c	(working copy)
--------------------------
Patching file geom/geom_disk.c using Plan A...
Reversed (or previously applied) patch detected!  Assume -R? [y]
Hunk #1 succeeded at 381.
Hunk #2 succeeded at 467.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: geom/geom_disk.h
|=================================================================== |---
geom/geom_disk.h	(revision 190540)
|+++ geom/geom_disk.h	(working copy)
--------------------------
Patching file geom/geom_disk.h using Plan A...
Reversed (or previously applied) patch detected!  Assume -R? [y]
Hunk #1 succeeded at 88.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: geom/raid3/g_raid3.c
|=================================================================== |---
geom/raid3/g_raid3.c	(revision 190540)
|+++ geom/raid3/g_raid3.c	(working copy)
--------------------------
Patching file geom/raid3/g_raid3.c using Plan A...
Reversed (or previously applied) patch detected!  Assume -R? [y]
Hunk #1 succeeded at 3193.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: geom/geom_subr.c
|=================================================================== |---
geom/geom_subr.c	(revision 190540)
|+++ geom/geom_subr.c	(working copy)
--------------------------
Patching file geom/geom_subr.c using Plan A...
Reversed (or previously applied) patch detected!  Assume -R? [y]
Hunk #1 succeeded at 545.
Hunk #2 succeeded at 581.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: geom/part/g_part.c
|=================================================================== |---
geom/part/g_part.c	(revision 190540)
|+++ geom/part/g_part.c	(working copy)
--------------------------
Patching file geom/part/g_part.c using Plan A...
Reversed (or previously applied) patch detected!  Assume -R? [y]
Hunk #1 succeeded at 1474.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: geom/journal/g_journal.c
|=================================================================== |---
geom/journal/g_journal.c	(revision 190540)
|+++ geom/journal/g_journal.c	(working copy)
--------------------------
Patching file geom/journal/g_journal.c using Plan A...
Reversed (or previously applied) patch detected!  Assume -R? [y]
Hunk #1 succeeded at 2310.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: geom/geom.h
|=================================================================== |---
geom/geom.h	(revision 190540)
|+++ geom/geom.h	(working copy)
--------------------------
Patching file geom/geom.h using Plan A...
Reversed (or previously applied) patch detected!  Assume -R? [y]
Hunk #1 succeeded at 193.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
|=================================================================== |---
cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c	(revision 190540)
|+++ cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c	(working copy)
--------------------------
Patching file cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c using
Plan A...
Reversed (or previously applied) patch detected!  Assume -R? [y]
Hunk #1 succeeded at 3087.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: sys/systm.h
|=================================================================== |---
sys/systm.h	(revision 190540)
|+++ sys/systm.h	(working copy)
--------------------------
Patching file sys/systm.h using Plan A...
Reversed (or previously applied) patch detected!  Assume -R? [y]
Hunk #1 succeeded at 325.
done
phoenix#

done.

and then I got to boot. (thanks, three months to get here !)

but then more info. I can't boot from usb in here, this itx has a small
32MB flash in ide I use to boot from. I put there /boot and some files
from kernel (32MB is can't keep all files). now it can't boot by itself,
it fails when mounting root, but da0s1a is there and simple:

ufs:da0s1a

does the job.

dmesg attached. I'll try to find out how to make it boot by itself now :)
thanks to all :D

matheus

phoenix# dmesg
Copyright (c) 1992-2009 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
	The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 8.0-CURRENT #0: Sun Apr  5 02:39:15 BRT 2009
    root_at_phoenix.apartnet:/usr/obj/usr/src/sys/Phoenix8
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: Transmeta(tm) Crusoe(tm) Processor TM5700 (798.13-MHz 586-class CPU)
  Origin = "GenuineTMx86"  Id = 0x543  Stepping = 3
  Features=0x84893f<FPU,VME,DE,PSE,TSC,MSR,CX8,SEP,CMOV,PN,MMX>
real memory  = 270532608 (258 MB)
avail memory = 231632896 (220 MB)
kbd1 at kbdmux0
pcib0: <Host to PCI bridge> pcibus 0 on motherboard
pir0: <PCI Interrupt Routing Table: 5 Entries> on motherboard
pci0: <PCI bus> on pcib0
pci0: <memory, RAM> at device 0.1 (no driver attached)
pci0: <memory, RAM> at device 0.2 (no driver attached)
pci0: <memory, RAM> at device 0.3 (no driver attached)
uhci0: <VIA 83C572 USB controller> port 0xe000-0xe01f irq 15 at device 9.0
on pci0
uhci0: [ITHREAD]
uhci0: LegSup = 0x201a
usbus0: <VIA 83C572 USB controller> on uhci0
uhci1: <VIA 83C572 USB controller> port 0xe100-0xe11f irq 5 at device 9.1
on pci0
uhci1: [ITHREAD]
uhci1: LegSup = 0x2010
usbus1: <VIA 83C572 USB controller> on uhci1
ehci0: <VIA VT6202 USB 2.0 controller> mem 0xe8131000-0xe81310ff irq 10 at
device 9.2 on pci0
ehci0: [ITHREAD]
usbus2: EHCI version 1.0
usbus2: <VIA VT6202 USB 2.0 controller> on ehci0
vgapci0: <VGA-compatible display> port 0xe200-0xe2ff mem
0xe0000000-0xe7ffffff,0xe8120000-0xe812ffff irq 11 at device 13.0 on pci0
isab0: <PCI-ISA bridge> at device 17.0 on pci0
isa0: <ISA bus> on isab0
atapci0: <VIA 8231 UDMA100 controller> port
0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xe300-0xe30f at device 17.1 on pci0
ata0: <ATA channel 0> on atapci0
ata0: [ITHREAD]
ata1: <ATA channel 1> on atapci0
ata1: [ITHREAD]
pci0: <bridge> at device 17.4 (no driver attached)
vr0: <VIA VT6102 Rhine II 10/100BaseTX> port 0xe600-0xe6ff mem
0xe8130000-0xe81300ff irq 15 at device 18.0 on pci0
vr0: Quirks: 0x0
vr0: Revision: 0x51
miibus0: <MII bus> on vr0
ukphy0: <Generic IEEE 802.3u media interface> PHY 1 on miibus0
ukphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
vr0: Ethernet address: 00:11:85:e3:2a:17
vr0: [ITHREAD]
cpu0 on motherboard
pmtimer0 on isa0
atrtc0: <AT realtime clock> at port 0x70-0x71 irq 8 pnpid PNP0b00 on isa0
atkbdc0: <Keyboard controller (i8042)> at port 0x60,0x64 irq 1 pnpid
PNP0303 on isa0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
atkbd0: [ITHREAD]
unknown: <PNP0c01> can't assign resources (memory)
orm0: <ISA Option ROMs> at iomem 0xc0000-0xc8fff,0xcc000-0xd5fff pnpid
ORM0000 on isa0
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
ppc0: parallel port not found.
unknown: <PNP0c01> can't assign resources (memory)
Timecounter "TSC" frequency 798130362 Hz quality 800
Timecounters tick every 1.000 msec
usbus0: 12Mbps Full Speed USB v1.0
usbus1: 12Mbps Full Speed USB v1.0
usbus2: 480Mbps High Speed USB v2.0
ugen0.1: <VIA> at usbus0
uhub0: <VIA UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus0
ugen1.1: <VIA> at usbus1
uhub1: <VIA UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus1
ugen2.1: <VIA> at usbus2
uhub2: <VIA EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus2
ad0: 30MB <32MB ATA Flash Disk ADBA217H> at ata0-master PIO4
GEOM_LABEL: Label for provider ad0 is ufsid/49adccdba5f8e304.
GEOM_LABEL: Label for provider ad0 is ufs/flash.
GEOM_LABEL: Label for provider ad0s1 is ufsid/49adce490693435d.
uhub0: 2 ports with 2 removable, self powered
Root mount waiting for: usbus2 usbus1
uhub1: 2 ports with 2 removable, self powered
Root mount waiting for: usbus2
uhub2: 4 ports with 4 removable, self powered
Root mount waiting for: usbus2
ugen2.2: <Genesys Logic> at usbus2
umass0: <Genesys Logic USB TO IDE, class 0/0, rev 2.00/0.02, addr 2> on
usbus2
umass0:  SCSI over Bulk-Only; quirks = 0x408c
Root mount waiting for: usbus2
umass0:0:0:-1: Attached to scbus0
da0 at umass-sim0 bus 0 target 0 lun 0
da0: <SAMSUNG SV0643D 0811> Fixed Direct Access SCSI-0 device
da0: 40.000MB/s transfers
da0: 6149MB (12594960 512 byte sectors: 255H 63S/T 784C)
GEOM_LABEL: Label for provider da0s1a is ufsid/49d77edb683149d9.
GEOM_LABEL: Label for provider da0s1d is ufsid/49d77eddb6efc899.
GEOM_LABEL: Label for provider da0s1e is ufsid/49d77edcee1ceb99.
GEOM_LABEL: Label for provider da0s1f is ufsid/49d77edc7a6dba2b.
Root mount waiting for: usbus2
ugen2.3: <Genesys Logic> at usbus2
umass1: <Genesys Logic USB TO IDE, class 0/0, rev 2.00/0.33, addr 3> on
usbus2
umass1:  8070i (ATAPI) over Bulk-Only; quirks = 0x008c
Root mount waiting for: usbus2
umass1:1:1:-1: Attached to scbus1
(probe0:umass-sim1:1:0:0): TEST UNIT READY. CDB: 0 0 0 0 0 0
(probe0:umass-sim1:1:0:0): CAM Status: SCSI Status Error
(probe0:umass-sim1:1:0:0): SCSI Status: Check Condition
(probe0:umass-sim1:1:0:0): NOT READY asc:3a,0
(probe0:umass-sim1:1:0:0): Medium not present
(probe0:umass-sim1:1:0:0): Unretryable error

Manual root filesystem specification:
  <fstype>:<device>  Mount <device> using cd0 at umass-sim1 bus 1 target 0
lun 0
cd0: <HL-DT-ST DVDRAM GSA-4160B A302> Removable CD-ROM SCSI-0 device
cd0: 40.000MB/s transfers
cd0: Attempt to query device size failed: NOT READY, Medium not present
filesystem <fstype>
                       eg. ufs:da0s1a
  ?                  List valid disk boot devices
  <empty line>       Abort manual input

mountroot> ufs:da0s1a
Trying to mount root from ufs:da0s1a
GEOM_LABEL: Label ufsid/49d77edb683149d9 removed.
GEOM_LABEL: Label for provider da0s1a is ufsid/49d77edb683149d9.
GEOM_LABEL: Label ufsid/49d77edcee1ceb99 removed.
GEOM_LABEL: Label for provider da0s1e is ufsid/49d77edcee1ceb99.
GEOM_LABEL: Label ufsid/49d77edc7a6dba2b removed.
GEOM_LABEL: Label for provider da0s1f is ufsid/49d77edc7a6dba2b.
GEOM_LABEL: Label ufsid/49d77eddb6efc899 removed.
GEOM_LABEL: Label for provider da0s1d is ufsid/49d77eddb6efc899.
GEOM_LABEL: Label ufsid/49d77edb683149d9 removed.
GEOM_LABEL: Label ufsid/49d77edcee1ceb99 removed.
GEOM_LABEL: Label ufsid/49d77edc7a6dba2b removed.
GEOM_LABEL: Label ufsid/49d77eddb6efc899 removed.



-- 
We will call you cygnus,
The God of balance you shall be
Received on Mon Apr 06 2009 - 05:57:34 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:45 UTC