Booting Pogoplug From The Correct USB Disk

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

Booting Pogoplug From The Correct USB Disk

Postby grayman4hire » Mon Apr 01, 2013 7:26 pm

Hello,

I ran into Moustafa Hassan's Blog, "Booting Pogoplug From The Correct USB Disk" this weekend.
http://mouhassan.wordpress.com/2012/06/ ... -usb-disk/

I gave it a try but my flash drive ended up mounting as read only. From reading the comments, I added "rw" at the end of the fw_setenv usb_init line and now my pogoplug correctly mounted the flash drive as rw.

I didn't get to do any extensive testing, but it seems to work.

Getting ArchLinuxARM to boot consistently to the correct USB drive (when multiple USB drives are attached) on the PogoPlug E02 seem to be a common issue and regularly asked about. Can some of the more experienced users/mods comment on the solution?

Thanks

grayman4hire

Here is what I ended up executing:
$this->bbcode_second_pass_code('', '
#Give Distinct Label to The Partition Containing Root File
systeme2label /dev/sda1 ROOTFS

#modify the usb_init parameter to use ROOTFS label
#all one line, the rw at the end is important
fw_setenv usb_init "run usb_scan; setenv usb_root LABEL=ROOTFS rw"

#create the required initial ramdisk
pacman -Sy uboot-mkimage
mkinitcpio -v -g /boot/kernel.img
#all one line
mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initramfs -d /boot/kernel.img /boot/uInitrd
')
grayman4hire
 
Posts: 350
Joined: Sat Sep 29, 2012 12:03 am
Location: SF, CA

Re: Booting Pogoplug From The Correct USB Disk

Postby hydro » Tue Apr 02, 2013 7:05 am

VDR on DockStar / Pogoplug E02: http://linux.bplaced.net/
hydro
 
Posts: 210
Joined: Wed Jun 15, 2011 2:03 pm
Location: Germany

Re: Booting Pogoplug From The Correct USB Disk

Postby moonman » Tue Apr 02, 2013 8:07 am

I think the common solution is to use the bootom back usb port for booting as it should be initialized first. UUID solution is not universal as as soon as you swap the boot drive or format/reinstall it UUID will change as well. Also to avoid rootfs to be mounted ro you can add it to fstab. That way fsck will run in case it needs to and then remount rootfs rw, with rw kernel cmdline it won't run fsck.
Last edited by moonman on Tue Apr 02, 2013 10:49 pm, edited 1 time in total.
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3387
Joined: Sat Jan 15, 2011 3:36 am

Re: Booting Pogoplug From The Correct USB Disk

Postby grayman4hire » Tue Apr 02, 2013 5:20 pm

Thanks for the reply hydro and moonman.

From what I understand, using the bottom back USB port increases the probability of booting to the correct USB drive, but doesn't guarantee it, correct?

Using the UUID method seems a little complicated. To quote WarHeadsSE, "It's a complete pain in the *****, but it works."

Correct me if I'm wrong, but I see a few advantages to using Moustafa's partition label method.
- simple. Execute 5 command line
- does not require uboot modification if switching out USB drive or reformat/reinstallation. Just re-label the partition correctly.
- consistent with current installation/partitioning method (not using GPT)

Disadvantages:
- requires a ramdisk? Why is that even an issue?
- anything I'm not considering or missing?

Regarding fstab and fsck, thanks for the tip moonman. If I go the fstab route so that fsck runs when needed, should I remove the "rw" kernel cmdline or leave it (just in case)?
grayman4hire
 
Posts: 350
Joined: Sat Sep 29, 2012 12:03 am
Location: SF, CA

Re: Booting Pogoplug From The Correct USB Disk

Postby hydro » Tue Apr 02, 2013 7:59 pm

$this->bbcode_second_pass_quote('grayman4hire', '
')- requires a ramdisk? Why is that even an issue?

Usually you have to rebuild it manually after each kernel update, but I'm not sure if it is necessary if you don't need any modules (even if you don't modify /etc/mkinitcpio.conf only a few modules will be included).
VDR on DockStar / Pogoplug E02: http://linux.bplaced.net/
hydro
 
Posts: 210
Joined: Wed Jun 15, 2011 2:03 pm
Location: Germany

Re: Booting Pogoplug From The Correct USB Disk

Postby moonman » Tue Apr 02, 2013 10:46 pm

Back bottom usb port: There hasn't been any specific testing, but it worked for everyone so far.

ramdisk: that's what kernel uses as rootfs remporarily to load all the necessery modules (i.e. storage, software raid and to do fsck) before it mounts an actual rootfs. It has actually been discussed several times before and is usually only necesseray for GoFlex {Net, Home} when the device is being booted off of a USB but sata drive always gets init'ed first and is 'documented' here: viewtopic.php?f=18&t=3355

Usually initrd needs to be created with every kernel upgrade but since all the necessary modules are compiled into the kernel (instead of being built as modules) because the device range is very limited you don't have to rebuild it every time. You may exclude some hooks from initcpio to keep the size down.
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3387
Joined: Sat Jan 15, 2011 3:36 am

Re: Booting Pogoplug From The Correct USB Disk

Postby myballsitch » Tue Apr 02, 2013 10:51 pm

Even with the stick in the slot near the power plugin I'm having issues with it booting to the right drive again. I thought I had it fixed, but no, after many reboots that were fine it started again, it still likes to boot to the pogoplug internal flash at times requiring pulling the power cord for a cold boot to get it right.

I'm considering this fix, but does it leave you hung if your usb stick dies? You have to image a new stick on another linux machine with the proper label to get back up? As it is now at least if the stick died I could restore the dd image to another one via the pogo's original o/s. I don't have another linux machine, and often livecd's don't seem to like what I have to run them on.
myballsitch
 
Posts: 11
Joined: Sun Mar 24, 2013 8:43 pm

Re: Booting Pogoplug From The Correct USB Disk

Postby grayman4hire » Tue Apr 02, 2013 11:11 pm

@myballsitch, I don't think the topic of this thread has any relation to your issue - booting to the correct usb drive when multiple usb drives are attached versus booting to one usb drive with nothing else attached. You might try picking up a different usb drive for your issue.
grayman4hire
 
Posts: 350
Joined: Sat Sep 29, 2012 12:03 am
Location: SF, CA

Re: Booting Pogoplug From The Correct USB Disk

Postby myballsitch » Tue Apr 02, 2013 11:37 pm

$this->bbcode_second_pass_quote('grayman4hire', '@')myballsitch, I don't think the topic of this thread has any relation to your issue - booting to the correct usb drive when multiple usb drives are attached versus booting to one usb drive with nothing else attached. You might try picking up a different usb drive for your issue.


Oh ok. Damn...

Well I may try a linux boot partition on the hard drive I intend to share then, with the samba shared area on a separate NTFS partition so I can ditch using any usb stick and free up a port.

Any issues with that?

Maybe I wouldn't be able to plug the usb hard drive into a windows machine if it has a linux ext3 boot partition as well as an NTFS partition? I would hope a windows machine would ignore a partition it doesn't understand, but now that I think about it the darn thing might try to fix it automatically and screw it up. It's just for emergency purposes I'd want to be able to hook the drive to a windows machine. v 7 or 8.
myballsitch
 
Posts: 11
Joined: Sun Mar 24, 2013 8:43 pm


Return to Marvell Kirkwood

Who is online

Users browsing this forum: No registered users and 11 guests