Installing grub on /dev/sdb or /dev/sdc
When I install Ubuntu to /dev/sda, all works well. However, when I install Ubuntu to an SD card on /dev/sdb or a USB memory key on /dev/sdc, it still puts GRUB on /dev/sda. I didn't see any option to change that. What's really annoying is /dev/sda becomes unbootable unless /dev/sdb or /dev/sdc is present after that is done. I can fix /dev/sda. But it doesn't accomplish the real goal which is to make /dev/sdb and /dev/sdc independently bootable even when /dev/sda is wiped to binary zero (or otherwise corrupt, or contains something else like Windows).
So how can I get Ubuntu to (1) do NOT touch /dev/sda at all, even if it thinks it sees GRUB already there, and (2) install everything, including GRUB, onto the target device (/dev/sdb or /dev/sdc)? I know the details of how to do this, and could do it by manually copying data around, etc. I've done such things in Slackware. But I want to do this in Ubuntu AND use Ubuntu's installation tools exclusively. I know I can cheat, after the fact, but that's not what I'm looking for. |
Alright
The way I did this is I unhooked my hardrive from motherboard I booted up the ubuntu livecd at desktop I inserted clean ext3 4gb usb and opened nautilus as root sudo nautilus the usb automounted and I then created a boot/grub folders mkdir -p /media/disk/boot/grub and installed grub to usb, recognized as only hd by grub grub-install --root-directory=/media/disk /dev/sda it sees my usb as sda, with hd hooked up it would say sdb then, to make sure, get the grub prompt grub root (hd0,0) setup (hd0) quit yeah, now it's simmering:) that's it What's the Bonus of this little cheat?? Grub will always think it's booting the first hd thus even on a pc/lappy that won't boot from usb will be able to on most if you use plop bootmanager on pc's that boot from usb it will again be reconized first and booted 1st NOTE: when I did this on my HP PC, if I had my bios set to boot from floppy or cd before hd, I would get a grub error when booting usb if the bios was set to boot hd 1st, cdrom second, the usb boots right? so, but if that's cheating I'll do it:) |
Note that in an Ubuntu installation, in the very last screen before installation begins, there's a little button on the lower right, marked Advanced. It gives you the opportunity to install grub somewhere else (and probably to further configure it, I'm not sure.)
If you already knew that, I apologize, but looking at the first post, it seems as if you may have, as I did the first couple of times playing with it, overlooked it. |
If I unhook the harddrive, then the SD card will be sda, and if anything in the installation configured stuff to look for stuff in sda, then it won't be doing as intended. I want the SD card to work as sdb, and for everything that might be hard configured to the device node name to do so for sdb and not sda. That way I can put in the SD card and boot from it without accessing sda other than to see what's on it (and elsewhere, to defeat automounting it). Ideally, the only hard part is finding partitions to mount. That should be done by labels or UUID. Then everything else finds stuff by paths which will be as expected when the mounts are right.
|
OH, sorry for not re-iterating
once you hook the hd back up and rweboot the usb will be recognized by YOUR pc as sdb1, etc not sda you see, we're tricking grub, not the pc grub thinks it's 1st hd, doesn't matter sda, hda, etc example, right now I'm running from my usb on fedora 11 persistent and my pc sees the usb as sdb1 grub thinks it's first hd only problem you will have is if you try to boot 1st hd from usb you'll just reboot into the usb meaning the only limitation it has is that you will have issues trying to boot your hd from the sd card, which most people don't care about anyway just try it dude an you'll see I got 5 computers in all 3 won't boot from usb all will boot the ext3 usb with grub the 3 I have to use plop bootmanager cd, usb, or floppy look here's my menu.lst and otuput of fdisk -l for usb Code:
Disk /dev/sdb: 4045 MB, 4045930496 bytes Code:
title Xtras - Menu |
All times are GMT -5. The time now is 03:22 PM. |