![]() |
[SOLVED] How to boot from USB HD
Hey all hacker-types,
I have created an ext3 partition on my USB HDD, and I cloned my Diablo to it. I then tried to boot from this partition, but my bootmenu just says N/A beside that option. Is it because the USB drive doesn't mount right away? Is there something I have to add to the initfs / bootmenu to get the drive to mount? just for your info, it is /sys/block/sda/sda2 I have several working bootable partitions on my SD cards, I just wanted to try an actual HD and see what the speed difference is... Thanks in advance! EDIT: Got it working! See this post for the how-to. |
Re: How to boot from USB HD?
I notice that older versions of fanoush's bootmenu had a USB HD menu choice. Can someone post the details for that menu item here? fanoush? qwerty12?
This is what I have: Code:
USB_HDD="sda" |
Re: How to boot from USB HD?
Quote:
Anyway, this is the entries I took from bootmenu.sh: Quote:
Quote:
Quote:
|
Re: How to boot from USB HD?
I added the line
Code:
MENU_5_USBMODE=host Still no luck. Is there something else I can try (maybe I'm using the wrong device name? maybe I have to force-mount the partition?), or is there just no support for booting from a second partition on an external drive (sda2)? |
Re: How to boot from USB HD?
MENU_5_USBMODE=host
will let set_usb_mode() to set the IT in host mode but I still don't know at what time we have /sys/block/sda/sda2 .... MENU_5_MODULES="mbcache ext3" MENU_5_FSTYPE="ext3" Don't you need jbd in MENU_5_MODULES ? |
Re: How to boot from USB HD?
Quote:
Most probably there are two issues left (did not try) 1. there may be missing /dev/sda2 device node in initfs 2. there is timing problem, usb storage device discovery is slow 1 can be solved by creating it by hand (in initfs_flasher/initfs/dev) from another shell while initfs_flasher is waiting for dropbear/bootmenu.conf answer 2 can be solved by hacking end of bootmenu.sh, there is case for special ids so you may need to add similar one to the end after line that sets usb mode to host. Simple sleep should be enough. |
Re: How to boot from USB HD?
Quote:
|
Re: How to boot from USB HD?
nhanquy: Yes, I noticed the missing jbd. Thanks for pointing it out. Still no luck.
Benson: I did try booting it, no luck, and I have an OTG adapter so shouldn't that force host mode? fanoush: You've suggested some very interesting things, but your "x can be solved" lines are way too vague and over my head. Can you give me more detailed instructions? Something I can edit in the /initfs_flasher folder before flashing? Lines I can paste into bootmenu.conf? Quote:
Quote:
|
Re: How to boot from USB HD?
Quote:
|
Re: How to boot from USB HD?
Quote:
Quote:
Can I copy the file from /mnt/initfs/dev and drop it into the initfs_flasher folder somewhere and get it to copy over when I flash the initfs? EDIT: AAHHH I think I get it. When the initfs_flasher process gets to the part where it is waiting for an answer from the user about dropbear, I open a second terminal window and "touch .../initfs_flasher/dev/sda2" ? Or maybe "cp .../initfs_flasher/dev/sda1 .../initfs_flasher/dev/sda2"? Then carry on with the install in the first window. Theoretically, this file will get copied over to the initfs. |
Re: How to boot from USB HD?
Ok, connected my HD, opened two terminals, and then when the flasher was waiting at the dropbear prompt, I went to the second terminal (as root, in the directory above my initfs_flasher dir) and did:
Code:
cp /dev/sda2 initfs_flasher/initfs/dev/sda2 |
Re: How to boot from USB HD?
Quote:
Either copy the one from the root filesystem (and maybe chmod to match the others in the initfs?) or use mknod. |
Re: How to boot from USB HD?
Quote:
Also, the major and minor numbers of sda, sda1 and sda2 look correct; sda: 8, 0 sda1: 8, 1 sda2: 8, 2 I would love some guidance on fanoush's second idea... Quote:
|
Re: How to boot from USB HD?
OK. So, I set the permissions after copying sda2 (chmod g-r initfs_flasher/initfs/dev/sda2) and I added a new section "usb2)" (which matches my current MENU_5_ID) to the special cases at the bottom of the bootmenu.sh file:
Code:
case "$default_root" in Is there any kind of diagnostic message I can print on the screen to see exactly what part of the boot attempt is failing? The vague failure message, so typical of this device, is extremely unhelpful... EDIT: Hmmm, I wonder if I put the special usb2 case at the very end... I think that's what fanoush meant... okay trying again... EDIT2: Still no dice... interesting note, the HD shows no activity during the boot process, but after the boot failure, there is some activity as OS2008 mounts it. |
Re: How to boot from USB HD?
you got it, so maybe the sleep timeout is still too short? you can boot system, as root run 'cat /proc/kmsg' and measure time between switching to host mode or attaching cable and final message with disk partitions detected
I'll try it this evening, usb card reader with my regular bootable card should be enough for such test. |
Re: How to boot from USB HD?
OK, got it to boot. There is one more gotcha. The host mode is not enabled until any usb client (!!) module is inserted. So you need to add e.g. 'g_ether' to list of modules. Also for me the device scan took more than 5 seconds. Worked with sleep 7.
The bug/feature of host mode not working with no gadget driver loaded is known, I was already bitten by this in OS2007 days. |
Re: How to boot from USB HD?
Quote:
TIA, bun |
Re: How to boot from USB HD?
C'mon, bun, you know me. When I figure it out, I'll post a how-to.
|
Re: How to boot from USB HD?
OK, got it booting.
First: it was a disappointment. Not really any noticeable speed difference, and difficult to use because your entire system is running over a wiggly little USB cable connected to the HD. Perhaps an advantage to this is being able to load your system up with huge apps. But who does that anyway? If you really needs lots of system space, just get a 16GB flash card instead. Perhaps another advantage is being able to boot any computer from a single drive; you can install boot partitions for linux, Mac, Windows, NIT etc.... Hmm, still dubious. After I've said all that, here's what I did (thanks fanoush, Benson et al!) to get it working. This of course assumes that you've got multiboot, and you've got an external usb storage device that mounts as "sda" on the tablet (you can determine this by looking at /media/usb when you plug in the device). This device could be a USB key or a flash card inserted in a supported flash reader instead of an HD, of course. 1. Use a partitioning app to create a second partition on your HD, formatted as ext2 or ext3 (I used ext3, so the howto assumes this). I used Debian QTParted to shrink my fat32 partition and create a new ext3 partition. It is just not a good idea to make the first partition of any removable device into a linux partition. Windows computers will have difficulty mounting it, and the tablet will do weird things, too, if you boot to it. http://farm4.static.flickr.com/3014/...714792.jpg?v=0 2. I cloned my OS2008 to my new partition. First I mounted my my new HD partition as /opt. As root: Code:
insmod /mnt/initfs/lib/modules/2.6.21-omap1/mbcache.ko ...and then I used Milhouse's nupgrade.sh script (steps 2-4) to do the cloning. 3. I edited my initfs_flasher/bootmenu.conf file to have the following entry: Code:
MENU_5_USBMODE=host Code:
case "$default_root" in 5b. ...I opened a second terminal window. I gained root in the second terminal and, in the directory above the initfs_flasher dir (in my case, this is /root), I made sure that the drive was plugged in and working and then issued the following commands: Code:
cp /dev/sda2 initfs_flasher/initfs/dev DONE. When the system reboots, your tablet should be able to boot to partition 2 on the external usb storage device. So, fanoush, any possibility of adding some stuff to your initfs_flasher package to eliminate the need to do those hacks? |
Re: How to boot from USB HD?
Quote:
I need a boot menu setup like this internal flash external mmc card partition 2 ext 2 And the one you made for USB2 ! Hope u can help . Thank you Compuerfreek |
Re: How to boot from USB HD?
you also need to copy sda2 device node to initfs as explained previously, it won't boot without it
|
Re: How to boot from USB HD?
Quote:
# bootmenu customisation file # # included from bootmenu.sh after default menu is defined # you can change some items or redefine menu completely # timeout for automatic selection when no key is pressed # set to -1 for no timeout (not recommended, can drain battery when device reboots unatteded) MENU_TIMEOUT=30 # IP address for USB networking USB_IP=192.168.2.103 # dim screen when in menu #/usr/sbin/dsmetest -l 1 # menu items MENU_MIN=1 # first item index #no need to redefine #MENU_1_NAME="Internal flash" #MENU_1_ID="flash" MENU_2_NAME="Internal MMC, partition 2, ext2" MENU_2_ID="mmc2" MENU_2_DEVICE="mmcblk1p2" MENU_2_MODULES="mbcache ext2" MENU_2_FSTYPE="ext2" MENU_2_FSOPTIONS="noatime" MENU_3_NAME="External MMC card, partition 2, ext3" MENU_3_ID="mmc12" MENU_3_DEVICE="mmcblk0p2" MENU_3_MODULES="mbcache jbd ext3" MENU_3_FSTYPE="ext3" MENU_3_FSOPTIONS="noatime" #",data=writeback" MENU_4_NAME="Power off (when not on charger)" MENU_4_ID="off" MENU_5_USBMODE=host MENU_5_NAME="External USB HDD" MENU_5_ID="usb2" MENU_5_DEVICE="sda2" MENU_5_MODULES="g_ether mbcache jbd ext3" MENU_5_FSTYPE="ext3" MENU_5_FSOPTIONS="noatime" #last item index, change if you add/remove items MENU_MAX=5 cp bootmenu.conf.n8x0.example bootmenu.conf Thanks computerfreek |
Re: How to boot from USB HD?
1.did you have ext2 or ext3 on the usb drive?
Change /Add if you have ext2: MENU_5_USBMODE=host MENU_5_NAME="External USB HDD" MENU_5_ID="usb2" MENU_5_DEVICE="sda2" MENU_5_MODULES="g_ether mbcache jbd ext2" MENU_5_FSTYPE="ext2" MENU_5_FSOPTIONS="noatime" 2. did you change bootmenu.sh with sleep 7? |
Re: How to boot from USB HD?
Quote:
bootmenu.conf.n8x0.example is messing me up as if i use this + add the new "USB hard drive "host" menu 5 to the menu . I then can not BOOT to my mmc card on my n810. Can some one look over my menu and see why after useing the bootmenu.conf.n8x0.example or my own menu i can not boot to mmc it fails . but if I flash with defaults and no bootmenu.conf i can boot just fine to my mmc. At this pont i just need someone to give me a menu in this order Intarnal flash mmc2 ? n810 partition 2 of my mmc card USB harddrive "host mode" And have it auto boot after time out to mmc card . Thank for you help and geting back to me on this.. Computerfreek |
Re: How to boot from USB HD?
what you used to edit the file? you need plain text editor like vi,mcedit,leafpad and line endings should be unix (so no notepad or wordpad on Windows)
|
Re: How to boot from USB HD?
I used VI to edit all files . The menu is fine .. it just will not boot to my mmc card where the default menu is fine .
|
Re: How to boot from USB HD?
2 Attachment(s)
Quote:
You need to download a newer version of initfs_flasher. Mine look like these: |
Re: How to boot from USB HD?
I downloaded it from here http://fanoush.wz.cz/maemo/ So i am gessing it is upto date here.
I will redownload and start over from step 1 and see if it works using the menu's you have here . Thanks for your help computerfreek |
Re: How to boot from USB HD?
UPDATE !! It works now !!
I started over from Step 1 and deleted all initfs_flasher stuff then i redownloaded it and untar it. 2 I used the boot menu's you sent "thanks" 3 reflashed with new boot menu's 4 Stoped at SSH install .. and copy over sda2 4 chmod the sda2 that i copy over 5 let init_flash go the rest of the way.. 6 very happy it booted from usb !! ext3 Thanks Guys for all your help this is great way of playing around as i have meny drive images of my mmc card .. with older os on it. Thank you !! computerfreek |
All times are GMT. The time now is 15:09. |
vBulletin® Version 3.8.8