[Solved] Can't get Hybrid MBR GPT to boot [GoFlex Home]

This forum is for Marvell Kirkwood devices such as the GoFlex Home/Net, PogoPlug v1/v2, SheevaPlug, and ZyXEL devices.

[Solved] Can't get Hybrid MBR GPT to boot [GoFlex Home]

Postby Ryexander » Tue May 27, 2014 4:24 am

I'm extremely frustrated right now. about 2 years ago I put Arch ARM on my goflex using a hybrid MBR to take advantage of the full 3T drive. worked wonderfully and it introduced me to Arch which I'm now in love with. I'm typing this form an Arch OS right now.

but about a few days ago I borked something, after an update, which thinking back I think included a new uboot, the GoFlex refused to boot. I've spent the last few days trying everything to get it back. after trying and failing to get any netconsole output I resorted to making a rescue USB which booted fine. I then pulled everything of import off the drive employing the considerable power of my octacore processor to compress about 300G of files with LZMA2 at 20MB/s Just to get it all to fit on the free space of my drives (Sorry had to include that little detail).

I tried again to get netconsole output by fixing the uboot environment, failed
I tried just reformatting and recreating the hybrid MBR
I Re-flashed U-boot using the script from http://archlinuxarm.org/os/armv5te/boot ... lexhome.sh
I've tried ext2-4 file systems
I tried labeling the partition everything from rootfs to uboot
I even tried "dd if=dev/zero"ing the beginning of the drive to completely clear the partition tables before recreating them
all a nogo

I finally got it to boot of SATA by resorting to a plain old MBR (though it can boot form ext4 now, woho I guess).

So either somethings changed and UBoot can no longer boot hybrid MBR, or I'm not setting up a hybrid MBR correctly (like hell i don't know how to set up a hybrid MBR)

any thoughts? you guys and your fancy new Main line Uboot... *grumble* *grumble*
Last edited by Ryexander on Thu May 29, 2014 11:48 pm, edited 1 time in total.
Ryexander
 
Posts: 9
Joined: Tue May 27, 2014 3:45 am

Re: Can't get Hybrid MBR GPT to boot [GoFlex Home]

Postby kmihelich » Tue May 27, 2014 4:43 am

Our "fancy new mainline U-Boot" does understand hybrid just fine. In fact, I just created a disk with a hybrid setup and it boots just fine. You should brush up on creating such a partition scheme. Here is a good reference for you: http://www.rodsbooks.com/gdisk/hybrid.html
Arch Linux ARM exists and continues to grow through community support, please donate today!
kmihelich
Developer
 
Posts: 1133
Joined: Tue Jul 20, 2010 6:55 am
Location: aka leming #archlinuxarm

Re: Can't get Hybrid MBR GPT to boot [GoFlex Home]

Postby Ryexander » Tue May 27, 2014 5:08 am

ok. then perhaps I am doing it wrong, I'll walk through the process and perhaps you can point out what I'm doing wrong. becasue I read through that and couldn't find falt with my setup/

Step 1:
use gdisk to create 3 partitions 1 bootable ALARM, 2 swap, 3 rest of the drive
$this->bbcode_second_pass_code('', 'Number Start (sector) End (sector) Size Code Name
1 2048 31459327 15.0 GiB 8300 Linux filesystem
2 31459328 33556479 1024.0 MiB 8200 Linux swap
3 33556480 5860533134 2.7 TiB 8300 Linux filesystem')
Step 2:
use 'r' in gdisk to enter recovery/transform mode
'h' for hybrid
add partition 1 to the mbr as type 0x83, make it bootable
say no to putting the protective 0xEE partition first
Result
$this->bbcode_second_pass_code('', '
MBR partitions:
Number Boot Start Sector End Sector Status Code
1 * 2048 31459327 primary 0x83
2 1 2047 primary 0xEE
')
'm' to go back to the main menu, 'w' to write teh changed to the partition tables

at this point use mkfs to write ext file systems to sda1 and sda3
use
$this->bbcode_second_pass_code('', 'tune2fs -L rootfs /dev/sda1')
to label partition 1

mount sda1, untar the Arch ARM bundle
umount

reboot

and... nothing. seriously I'm at a loss here, hybrid fails strait MBR works fine
Ryexander
 
Posts: 9
Joined: Tue May 27, 2014 3:45 am

Re: Can't get Hybrid MBR GPT to boot [GoFlex Home]

Postby kmihelich » Tue May 27, 2014 5:12 am

Put the 0xEE partition first.
Arch Linux ARM exists and continues to grow through community support, please donate today!
kmihelich
Developer
 
Posts: 1133
Joined: Tue Jul 20, 2010 6:55 am
Location: aka leming #archlinuxarm

Re: Can't get Hybrid MBR GPT to boot [GoFlex Home]

Postby Ryexander » Tue May 27, 2014 5:25 am

redid everything but put the EE partition first

$this->bbcode_second_pass_code('', '
Number Boot Start Sector End Sector Status Code
1 1 2047 primary 0xEE
2 * 2048 31459327 primary 0x83
')

remade filesystems ext4
mount sda1
untar ALARM
umount
shut down, removed USB, power cycled

just sits there blinking green forever
Ryexander
 
Posts: 9
Joined: Tue May 27, 2014 3:45 am

Re: Can't get Hybrid MBR GPT to boot [GoFlex Home]

Postby kmihelich » Tue May 27, 2014 5:50 am

You need to get serial hooked up to find out what is really going on, and if you're actually using our new U-Boot.
Arch Linux ARM exists and continues to grow through community support, please donate today!
kmihelich
Developer
 
Posts: 1133
Joined: Tue Jul 20, 2010 6:55 am
Location: aka leming #archlinuxarm

Re: Can't get Hybrid MBR GPT to boot [GoFlex Home]

Postby Ryexander » Tue May 27, 2014 6:09 am

so... by serial.. you mean this? viewtopic.php?f=18&t=3397

that's... not possible for me, neither the parts, the tools, nor a respective port on my motherboard to get any output.
no other options? I sure I'm using your new UBoot I went ahead and installed it form the repos via my recovery usb after all else had failed. (sorry didn't mention that part)

I can even give a print out of the uboot env
$this->bbcode_second_pass_code('', '
[root@alarm ~]# ~/bin/fw_printenv
baudrate=115200
bootcmd=ide reset; usb start; setenv letter 9;for type in ide usb; do for disk in 0; do if ${type} part ${disk};then setexpr letter $letter + 1;run load;fi;done;done;
bootdelay=3
bootm=echo Booting from ${disk} ...; run setargs; bootm ${loadaddr};
bootz=echo Booting from ${disk} ...; run setargs; bootz ${loadaddr} - ${fdt_addr};
console=ttyS0
ethact=egiga0
fdt_addr=0x800000
fdt_file=/boot/dtbs/kirkwood-goflexnet.dtb
importbootenv=echo Importing environment (uEnv.txt)...; env import -t $loadaddr $filesize
load=echo Attempting to boot from ${type} ${disk}:1...;if run loadbootenv; then run importbootenv;fi;echo Checking if uenvcmd is set ...;if test -n $uenvcmd; then echo Running uenvcmd ...;run uenvcmd;fi;echo Running default loadzimage ...;if run loadzimage; then run loadfdt;run bootz;fi;echo Running default loaduimage ...;if run loaduimage; then run bootm;fi;
loadaddr=0x810000
loadbootenv=load ${type} ${disk}:1 ${loadaddr} /boot/uEnv.txt
loadfdt=load ${type} ${disk}:1 ${fdt_addr} ${fdt_file}
loaduimage=load ${type} ${disk}:1 ${loadaddr} ${uimage}
loadzimage=load ${type} ${disk}:1 ${loadaddr} ${zimage}
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:1M(u-boot),-(rootfs)
setargs=setenv bootargs console=${console},${baudrate} ${optargs} root=/dev/sd${letter}1 rw rootwait ${mtdparts}
uimage=/boot/uImage
zimage=/boot/zImage
ethaddr=00:10:75:2A:F1:CF

')

which from what I can tell is exactly the environment from the repos https://github.com/archlinuxarm/u-boot/wiki/GoFlex-Home
Ryexander
 
Posts: 9
Joined: Tue May 27, 2014 3:45 am

Re: Can't get Hybrid MBR GPT to boot [GoFlex Home]

Postby Ryexander » Tue May 27, 2014 11:58 pm

I FINALLY connected to the net console, I almost bricked the dam thing in the process too.

What I had to do
Boot into the rescue USB and use fw_setenv to do the following

$this->bbcode_second_pass_code('', '
fw_setenv ncip 192.168.1.10 #the static IP of my computer
fw_setenv ipaddr 192.168.1.99 #the static IP I want to use for the box
fw_setenv stdout nc #redirect stdout to the networkconsole
fw_setenv stdin nc #redirect stdin to the networkconsole
')

for some godforsaken reason even though all these IPs are set up perfectly in my locla network, reserved for the MAC address and everything. nothing was coming through. sadly setting this environment was also completely preventing it form booting unless it COULD find these IP's and send output to them. this is what almost bricked it.

so I connected it directly to my computer and used wireshark to see the traffic, after starting it booting one to bring up the link and then quickly power cycling it to restart the boot before the link could drop I was able to see arp requests form 192.168.1.99 for "who has 192.168.1.10?"
at this point I quickly ran
$this->bbcode_second_pass_code('', 'sudo ip addr add 192.168.1.10/24 broadcast 192.168.1.255 dev eth0')
on my machine to set the address so it could respond tot eh arp with my mac (trying to set it earlier didn't keep)

at this point I had
$this->bbcode_second_pass_code('', '
nc -lu 6666 &
nc -u 192.168.1.99 6666
')
running in a terminal but was still picking up nothing I ended up having to use socat insted of net cat
$this->bbcode_second_pass_code('', '
socat STDIO UDP-LISTEN:6666
')

and FINALLY I was able to see the UBoot output.

so, I took out the USB to get it to boot form the Hard drive, and had to go through that same power cyceling trick to get the output again. Here the UBoot out put form the failing Hybrid MBR boot.

$this->bbcode_second_pass_code('', '
Reset IDE: Bus 0: OK Bus 1: not available
Device 0: Model: ST33000651AS Firm: CC43 Ser#: 9XK0BLKL
Type: Hard Disk
Supports 48-bit addressing
Capacity: 764436.4 MB = 746.5 GB (1565565872 x 512)
(Re)start USB...
USB0: USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found

Partition Map for IDE device 0 -- Partition Type: EFI

GPT: last_usable_lba incorrect: 15D50A38E > 5D50A3B0
print_part_efi: *** ERROR: Invalid GPT ***
Attempting to boot from ide 0:1...
GPT: last_usable_lba incorrect: 15D50A38E > 5D50A3B0
get_partition_info_efi: *** ERROR: Invalid GPT ***
** Invalid partition 1 **
Checking if uenvcmd is set ...
Running default loadzimage ...
GPT: last_usable_lba incorrect: 15D50A38E > 5D50A3B0
get_partition_info_efi: *** ERROR: Invalid GPT ***
** Invalid partition 1 **
Running default loaduimage ...
GPT: last_usable_lba incorrect: 15D50A38E > 5D50A3B0
get_partition_info_efi: *** ERROR: Invalid GPT ***
** Invalid partition 1 **

no USB devices available
GoFlexHome>
')

the console doesn't work cause of the so cat command I'm using I guess, I just get a
$this->bbcode_second_pass_code('', '2014/05/27 17:42:19 socat[10659] E write(3, 0x24b7c40, 9): Invalid argument')
error if I try

So apparently my GPT table isn't getting read correctly by Uboot, any thoughts?

EDIT: turns out I can comunicate with the console if I open another terminal and use
$this->bbcode_second_pass_code('', 'socat stdio udp-sendto:192.168.1.99:6666')
thing I type in that console get sent back to the box and I can see the output. it's acting a bit flakey though
Ryexander
 
Posts: 9
Joined: Tue May 27, 2014 3:45 am

Re: Can't get Hybrid MBR GPT to boot [GoFlex Home]

Postby WarheadsSE » Wed May 28, 2014 1:25 pm

Perhaps ensure that your u-boot is up to date, and possibly move to a 2014.X version as is available?
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: Can't get Hybrid MBR GPT to boot [GoFlex Home]

Postby Ryexander » Wed May 28, 2014 4:27 pm

I'm differently using an up to date version,I updated it 2 days ago using the Marvell Kirkwood Uboot package form the arch arm repositories
Ryexander
 
Posts: 9
Joined: Tue May 27, 2014 3:45 am

Next

Return to Marvell Kirkwood

Who is online

Users browsing this forum: No registered users and 32 guests