The online racing simulator
Booting from USB SATA enclosure
(21 posts, started )
Booting from USB SATA enclosure
Hey guys I just got myself a USB SATA enclosure for my other notebook HDD since I don't want to swap in and out if I want to get some files. I just tried to boot from it but it won't work. Is there any way that I can make my laptop boot from the USB enclosure? I'd like to access my OSes from there from time to time but don't want to swap it physically from my laptop HDD bay. Thanks.
Is your laptop capable of booting from USB?
Quote from Bose321 :Is your laptop capable of booting from USB?

Yes definitely. I installed Ubuntu releases using my pendrive all the time. But when I choose to boot from the enclosure, all I see is a black screen with a blinking underscore line and I don't see any activity from the enclosure itself.
What OS is installed on the pendrive? Windows have problems booting from USB devices and require couple of hacks to work like that.
No it's not a pendrive I'm talking about now. It's a SATA 2.5" internal HDD inside a USB enclosure. I installed Windows XP, Windows 7 and Ubuntu 10.10 in it and it's using GRUB as it's boot loader. Would be cool if you could share which tweaks/hacks you're talking about.
SATA disk or a real USB pendrive doesn't really make a difference as long a as it's connected to USB. Can you get to the GRUB boot menu? If it's the GRUB2 that comes with Ubuntu, you need to hold the SHIFT key during boot.
If you cannot get even the GRUB menu, then I guess GRUB is not properly installed on the MBR or the partition is not flagged as bootable.
If you can get GRUB but nothing else, it's probably the disk's ID (the hd(n,m) )that has changed so GRUB is looking for OS on a wrong device.
Do you mean holding SHIFT after I've chosen to boot from the USB drive?

P.S. I just tried that but nothing happened. Still that same blank screen with the flashing underscore line. I guess it's not seen as bootable. Any ways to make it bootable?
Can you boot off Ubuntu LiveCD? If you can, do so and plug the external disk in. Make sure the drive IS NOT mounted before you continue. Open terminal and type "sudo cfdisk /dev/sdX". Now check that ALL partitions you've installed an OS to have the bootable flag and add it if necessary. Write the changes and try again.

Also, can you post the /boot/grub/grub.cfg file that should be located on the disk?
LiveCD shouldn't be a problem at all. But how do I know the device node number lol? I'm a Linux noob. :P

P.S. I booted into the LiveCD and clicked on Try Ubuntu. Then I connected my enclosure and then followed by opening up Terminal and firing up the command up there. But it says "FATAL ERROR: Cannot open disk drive
Press any key to exit cfdisk"
So I don't know what to do now.

Here's the CFG:
Quote :#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi

function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}

function recordfail {
set recordfail=1
if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}

function load_video {
insmod vbe
insmod vga
}

insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set b3953060-5022-4a74-926d-45ca8169cfc8
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=1366x768
load_video
insmod gfxterm
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set b3953060-5022-4a74-926d-45ca8169cfc8
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
if [ "${recordfail}" = 1 ]; then
set timeout=-1
else
set timeout=5
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set b3953060-5022-4a74-926d-45ca8169cfc8
insmod jpeg
if background_image /boot/grub/hammer+sickle.jpg ; then
set color_normal=white/black
set color_highlight=yellow/black
else
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_os-prober_proxy ###
menuentry "Windows 7 (loader) (on /dev/sda1)" {
insmod part_msdos
insmod ntfs
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set 6864cea064ce6ffc
chainloader +1
}
### END /etc/grub.d/10_os-prober_proxy ###

### BEGIN /etc/grub.d/20_linux_proxy ###
menuentry "Ubuntu, with Linux 2.6.35-28-generic" --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set b3953060-5022-4a74-926d-45ca8169cfc8
linux /boot/vmlinuz-2.6.35-28-generic root=UUID=b3953060-5022-4a74-926d-45ca8169cfc8 ro quiet splash
initrd /boot/initrd.img-2.6.35-28-generic
}
### END /etc/grub.d/20_linux_proxy ###

You're referring to the "/dev/sdX"? You can do "ls /dev | grep sd" to list all HDD's (removable or not) that are connected, then connect the SATA disk and run the command again, the new device is your SATA disk. Also the last few lines in "dmesg" should tell you the same thing.
You should still check if the partitions and their sizes reported by cfdisk match.

BTW, you don't want to run something like "sudo cfdisk /dev/sdb1" but rather "sudo sfdisk /dev/sdb" 'cause the "1" represents a partition, whereas "sdb" represents the whole device.
Okay I'll see what I can do. Anyways look above for the grub.cfg.
I'm not sure about Ubuntu, as Linux is totally out of my ballpark. But I can say for Windows, well XP anyways [hopefully this is still applicable], that during boot up, Windows supposedly reinitializes the USB driver. The problem is that you are running off USB. What may happen is that you are half way between boot up and you suddenly get a blue screen, or something. You may still get on using safe-mode, and it doesn't really re-load all the drivers, but.. who really wants to run their PC on safe-mode?

I can speak for XP, is that you may need to repack the drivers. You basically go into you installation disk, extract the various drivers, and slightly modify them. Once you are done, you basically create a new installation, image of the disk, and re-burn. You should check online for Windows 7.

But truly, I'd go and check out some tutorials before posting. IMO, you'll learn a lot faster that way.

I kinda just finished writing this, and saw MadCat's comment. Yes, that is true. Just go online and type something like "WIndows 7 on External HD", or something. Good luck
MadCatX: Now that I determined my external drive is sdb, here is what it showed when I fired up the command again.
"FATAL ERROR: Bad primary partition 2: Partition ends in the final partial cylind
Press any key to exit cfdisk"

GenesisX: I already have 3 OSes in that enclosure. So you meant I have to reinstall everything? Modding drivers seems way out of my league here... I'm thinking of simpler ways to do it without ruining anything.
Few things I noticed.
1) There is obviously something wrong with the drive, you can try "fdisk -l /dev/sdb" and post the results here, you might have a better luck getting some info like that.
2) GRUB is trying to look for OSes on the primary master HDD, you can tell that by the "set root=(hd0,....)" entries in grub.cfg. This is most likely wrong as I assume you have an internal HDD in your laptop. You can change every occurrence of hd0 to hd1 and see what happens. BACKUP the grub.cfg file first!
3) Although the GRUB manual doesn't say so, it's been my experience that sometimes one of the SHIFT keys just doesn't work, so you might try using left or right SHIFT and see if any of those gets you to the boot menu. Just select the USB drive in the BIOS boot menu and press and hold SHIFT immediately after that.
Quote from MadCatX :Few things I noticed.
1) There is obviously something wrong with the drive, you can try "fdisk -l /dev/sdb" and post the results here, you might have a better luck getting some info like that.
2) GRUB is trying to look for OSes on the primary master HDD, you can tell that by the "set root=(hd0,....)" entries in grub.cfg. This is most likely wrong as I assume you have an internal HDD in your laptop. You can change every occurrence of hd0 to hd1 and see what happens. BACKUP the grub.cfg file first!
3) Although the GRUB manual doesn't say so, it's been my experience that sometimes one of the SHIFT keys just doesn't work, so you might try using left or right SHIFT and see if any of those gets you to the boot menu. Just select the USB drive in the BIOS boot menu and press and hold SHIFT immediately after that.

1) All it says is "Cannot open /dev/sdb"
2) I'll hold that till I have time to fiddle with it. I'm almost going to bed now so I don't want to risk my boot files.
3) Trying this now. I'll report back if that's the case. (Nope both SHIFT keys still don't get me to the boot menu for GRUB2)

All I can tell is the lack of any sort of activity from the external enclosure after choosing to boot from it is a dead giveaway there's a problem. SHIFT-key is definitely out. I'll see about the GRUB cfg file later on.
If you're sure that /dev/sdb is your drive and even fdisk cannot read it, it's possible the drive itself is somehow faulty. If you plug the drive in, can you mount it and read the data from it? Did you try connecting it to a different USB port?
WinSetupFromUSB can create a pendrive which can be used to install WinXP onto a external HDD.
You'll need ver 1.0 beta 7 for that - in main menu, click Advanced Options, and check "Prepare Windows XP/2003 to be installed on USB", and "Remove disk space requirements from txtsetup.sif" (cause it cannot properly detect free space on USB disks).

Btw, for all 7200rpm 2.5" HDDs and for some 5400rpm 2.5" ones, you'll need a miniUSB to TWO USB cable, not to 1 USB. They look like this:


Otherwise it'll fail to spin up (doesn't applies to enclosures with external (AC) power supply).
Quote from MadCatX :If you're sure that /dev/sdb is your drive and even fdisk cannot read it, it's possible the drive itself is somehow faulty. If you plug the drive in, can you mount it and read the data from it? Did you try connecting it to a different USB port?

Yeah I'm very sure it's sdb since I used that command to list all HDDs. And yes, I can mount and access all my files. Not yet about switching USB ports, I'll try it another day when I'm free.

Quote from E.Reiljans :WinSetupFromUSB can create a pendrive which can be used to install WinXP onto a external HDD.
You'll need ver 1.0 beta 7 for that - in main menu, click Advanced Options, and check "Prepare Windows XP/2003 to be installed on USB", and "Remove disk space requirements from txtsetup.sif" (cause it cannot properly detect free space on USB disks).

Btw, for all 7200rpm 2.5" HDDs and for some 5400rpm 2.5" ones, you'll need a miniUSB to TWO USB cable, not to 1 USB. They look like this:


Otherwise it'll fail to spin up (doesn't applies to enclosures with external (AC) power supply).

I don't think I'm thinking of reinstalling all the OSes I have in there so that's out. Yes it's the same that I got though I only connected the one labelled POWER+DATA since I find it sufficient to access all my files. I've already tried with both connected but doesn't work either. I'll try again though.
Unless somehow you have achieved to install the 3 OS into one big FAT32 partition, you can just format those Windows partitions of which OS you want to install. Installing Windows takes like 10 Minutes =S. YOu won't lose your other ones. If you would just go on Google and search for like 0.0001s, you would find this... http://wiki.eeeuser.com/howto:installxp

Go to the bottom and have the program do the modifications for you. Just have the files extracted from the CD. Then have the direct the program to the dir of your files.

You may want to double check WinSetupFromUSB. I'm not 100% sure, but I think that only puts the installation files onto a USB stick for installation (for people who do not have a CD/DVD Drive).
Quote from GenesisX :You may want to double check WinSetupFromUSB. I'm not 100% sure, but I think that only puts the installation files onto a USB stick for installation (for people who do not have a CD/DVD Drive).

>check "Prepare Windows XP/2003 to be installed on USB"
It looks like I made a small mistake yesterday, the command you should run is actually "sudo fdisk -l /dev/sdb". (running it without sudo causes the "Cannot read" error). Once you do that, you'll see a table like this:

Device Boot Start End Blocks Id System
/dev/sdb1 * 2048 206847 102400 7 HPFS/NTFS/exFAT
/dev/sdb2 206848 184322047 92057600 7 HPFS/NTFS/exFAT
/dev/sdb3 184322048 625137344 220407648+ 83 Linux

Then you can type "sudo fdisk /dev/sdb" and use command "a" toggle bootable flag on partitions you need. Pressing "a" and "3" would add bootable flag to /dev/sdb3.

If the whole GRUB is damaged or missing, Ubuntu help has this nice guide how to recover it.

Booting from USB SATA enclosure
(21 posts, started )
FGED GREDG RDFGDR GSFDG