NetBSD-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
gpt partitition booting
Many questions about booting from gpt partitions... I can't make
sense out of what happens nor does it appear to agree with the man
pages for boot and boot.cfg.
Background - I wanted to make a raid array using two identical
drives. After weeks of trial and error, I decided my 8 yr old
motherboard down't support EFI booting as NetBSD expects. If there
is a gpt partition identified as efi, the bios attempts to boot
from it regardless of bios settings or what I select at bios boot
nor can it find anything to boot from when set up per NetBSD efi
specs.
Emmanuel D. went to great lengths to help me get it booting straight
from an ffs partition bring up raid0. Unfortunately, right after
I got it working, one of the (new) drives in the raid array began
to fail (raidctl can't recover it). So I picked up a remanufactured
Hitachi drive and went about setting it up to boot directly and
then optionally mount the raid array from there, giving up on the
raid array for now.
However, the only way I can boot the Hitachi drive (wd0) is to drop
to the boot prompt, type 'boot -a' and select dk2 as the root
device. Note that wd0:dk0 has "biosboot" and wd0:dk2 has "bootme"
attributes set (see below). Neither of the raid disks have any
attributes set. boot(8) says:
boot [device:][filename] [-1234abcdmqsvxz]
The default device will be set to the disk from which the boot
loader was loaded. The partition is set to the first match in
this list:
1. The first gpt(8) partition with the bootme attribute set.
2. The partition from which the boot loader was loaded from,
if that can be detected.
3. The first partition with a file system that could be
bootable.
4. The first partition.
dk2 - Label: root_h1 is the only partition with the "bootme" attribute
dk2, dk5, dk8 and dk9(raid0) are all 'bootable'
The bios appears to select wd0 as the bootloader drive (first in
line and supposedly am also selecting it). I have different boot.cfg
files in all of the boot and root partitions and the menu that
appears comes from dk2:boot.cfg (from the menu text), yet dmesg
(below) names dk9 as the boot device. Which partition is the
bootloader actually booting from?
So I try to determine how to set boot.cfg to boot dk2 - NAME=root_h1
Nothing works, I drop down to the boot prompt and try as boot(8)
suggests:
To boot from an alternate disk, the full name of the device
should be given at the prompt. device is of the form
NAME=partition_label when booting from a gpt(8) partitioned
disk.
> boot NAME=root_h1 says no such (something) is found.
> boot dk2 says no such (something) is found.
> boot wd0:dk2 says no such (something) is found.
> boot NAME=raid0 says no such (something) is found.
> boot results in root partition dk9 (raid0)
I can only specify a gpt partition by using boot -a
and specifying which gpt partition to use. If wd1 and wd2 are
unplugged, I still have to use boot -a to bring up dk2 as root.
Appears there is some magic in booting a raid drive not used for
other gpt partitions.
Why doesn't it work as per boot(8) ?
BTW, /etc/fstab uses the NAME=root_h1, NAME=raid0 labels just fine.
Thanks
----------------------------------------
$ gpt show -la wd0
start size index contents
0 1 PMBR
1 1 Pri GPT header
2 32 Pri GPT table
34 30 Unused
64 2097152 1 GPT part - NetBSD FFSv1/FFSv2
Type: ffs
TypeID: 49f48d5a-b10e-11dc-b99b-0019d1879648
GUID: d29145df-8bc6-4c4d-8db9-62ab066523f1
Size: 1024 M
Label: boot_h1
Attributes: biosboot
2097216 8388608 2 GPT part - NetBSD swap
Type: swap
TypeID: 49f48d32-b10e-11dc-b99b-0019d1879648
GUID: 8d30ed7a-96bf-485c-9aed-5750b651db73
Size: 4096 M
Label: swap_h1
Attributes: None
10485824 7803550936 3 GPT part - NetBSD FFSv1/FFSv2
Type: ffs
TypeID: 49f48d5a-b10e-11dc-b99b-0019d1879648
GUID: d5854277-283b-42a6-bd6e-12522479439e
Size: 3721 G
Label: root_h1
Attributes: bootme
7814036760 375 Unused
7814037135 32 Sec GPT table
7814037167 1 Sec GPT header
$ gpt show -la wd1
start size index contents
0 1 PMBR
1 1 Pri GPT header
2 32 Pri GPT table
34 100000 1 GPT part - NetBSD FFSv1/FFSv2
Type: ffs
TypeID: 49f48d5a-b10e-11dc-b99b-0019d1879648
GUID: 293b61fd-8c49-4c2b-ac01-624998455074
Size: 50000 K
Label: boot0
Attributes: None
100034 10000000 2 GPT part - NetBSD swap
Type: swap
TypeID: 49f48d32-b10e-11dc-b99b-0019d1879648
GUID: 98954045-5d13-490e-9612-db08868100eb
Size: 4883 M
Label: swap0
Attributes: None
10100034 7803937101 3 GPT part - NetBSD RAIDFrame component
Type: raid
TypeID: 49f48daa-b10e-11dc-b99b-0019d1879648
GUID: bf41eb3c-ad89-4950-8e09-d38b13fa8ba8
Size: 3721 G
Label: raidw0
Attributes: None
7814037135 32 Sec GPT table
7814037167 1 Sec GPT header
(wd2 same as wd1 except labels)
(Using NetBSD -current)
--------------
wd0 at atabus3 drive 0
wd0: <Hitachi HUS724040ALE641>
wd0: drive supports 16-sector PIO transfers, LBA48 addressing
wd0: 3726 GB, 7752021 cyl, 16 head, 63 sec, 512 bytes/sect x 7814037168 sectors (0 bytes/physsect; first aligned sector: 8)
wd0: GPT GUID: dcac6a4f-5d57-4398-8f8f-3e16635a817d
dk0 at wd0: "boot_h1", 2097152 blocks at 64, type: ffs
dk1 at wd0: "swap_h1", 8388608 blocks at 2097216, type: swap
dk2 at wd0: "root_h1", 7803550936 blocks at 10485824, type: ffs
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 6 (Ultra/133), WRITE DMA FUA, NCQ (32 tags) w/PRIO
wd0(ahcisata1:0:0): using PIO mode 4, DMA mode 2, Ultra-DMA mode 6 (Ultra/133) (using DMA), NCQ (31 tags) w/PRIO
wd1 at atabus5 drive 0
wd1: <ST4000DM004-2CV104>
wd1: drive supports 16-sector PIO transfers, LBA48 addressing
wd1: 3726 GB, 7752021 cyl, 16 head, 63 sec, 512 bytes/sect x 7814037168 sectors (0 bytes/physsect; first aligned sector: 8)
wd1: GPT GUID: f10e8bb0-de35-4b54-b365-6571da54d265
dk3 at wd1: "boot0", 100000 blocks at 34, type: ffs
dk4 at wd1: "swap0", 10000000 blocks at 100034, type: swap
dk5 at wd1: "raidw0", 7803937101 blocks at 10100034, type: raidframe
wd1: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 6 (Ultra/133), WRITE DMA FUA, NCQ (32 tags)
wd1(ahcisata1:4:0): using PIO mode 4, DMA mode 2, Ultra-DMA mode 6 (Ultra/133) (using DMA), NCQ (31 tags)
wd2 at atabus6 drive 0
wd2: <ST4000DM004-2CV104>
wd2: drive supports 16-sector PIO transfers, LBA48 addressing
wd2: 3726 GB, 7752021 cyl, 16 head, 63 sec, 512 bytes/sect x 7814037168 sectors (0 bytes/physsect; first aligned sector: 8)
wd2: GPT GUID: b3d4301a-cbfe-414e-ac61-16571d17d548
dk6 at wd2: "boot1", 100000 blocks at 34, type: ffs
dk7 at wd2: "swap1", 10000000 blocks at 100034, type: swap
dk8 at wd2: "raidw1", 7803937101 blocks at 10100034, type: raidframe
wd2: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 6 (Ultra/133), WRITE DMA FUA, NCQ (32 tags)
wd2(ahcisata1:5:0): using PIO mode 4, DMA mode 2, Ultra-DMA mode 6 (Ultra/133) (using DMA), NCQ (31 tags)
raid0: RAID Level 1
raid0: Components: /dev/dk5[**FAILED**] /dev/dk8
raid0: Total Sectors: 7803937024 (3810516 MB)
raid0: GPT GUID: d49c78d1-c669-4e6b-a51b-19d9d3c26320
dk9 at raid0: "ffs@raid0", 7803936957 blocks at 34, type: ffs
WARNING: 1 error while detecting hardware; check system log.
boot device: dk9
root device (default dk9): dk2
dump device: dk1
file system (default generic):
dumps on dk1
root file system type: ffs
-------------------
Home |
Main Index |
Thread Index |
Old Index