LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   How to make bootable partion on USB drive to install GRUB... (https://www.linuxquestions.org/questions/linux-from-scratch-13/how-to-make-bootable-partion-on-usb-drive-to-install-grub-794150/)

psmurthy 03-09-2010 03:20 AM

How to make bootable partion on USB drive to install GRUB...
 
Hi,
I made a partion on USB drive using Gpart utiliy and installed GRUB on it.
USB doesn't have any thing else
When i change my BIOS settings to boot from USB, nothing is comming..
Do we need to do anything to make one partion bootable...
Appreciate any help on this one...

giammy 03-09-2010 03:33 AM

Quote:

Originally Posted by psmurthy (Post 3891218)
Hi,
I made a partion on USB drive using Gpart utiliy and installed GRUB on it.
USB doesn't have any thing else
When i change my BIOS settings to boot from USB, nothing is comming..
Do we need to do anything to make one partion bootable...
Appreciate any help on this one...

Hi,

to make a bootable usb drive, I use Unetbootin
http://unetbootin.sourceforge.net/

bye
giammy

psmurthy 03-12-2010 01:09 PM

Things i did to achieve my goal
 
I have 300 GB USB drive and I did following things to boot GRUB from this.
1. Using gparted prtitioned USB into 3
Frist Partition - 1GB
Second Partition - 101GB
Third Partition - 195GB
All are ext3 partitions
2. "fdsik -l" output
====================================================================
Disk /dev/sda: 250.0 GB, 250000000000 bytes
255 heads, 63 sectors/track, 30394 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xa586a586
[/COLOR]
Device Boot Start End Blocks Id System
/dev/sda1 * 1 30021 241143651 83 Linux
/dev/sda2 30022 30394 2996122+ 5 Extended
/dev/sda5 30022 30394 2996091 82 Linux swap / Solaris

Disk /dev/sdc: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00066f97

Device Boot Start End Blocks Id System
/dev/sdc1 1 131 1052226 83 Linux
/dev/sdc2 132 13417 106719795 83 Linux
/dev/sdc3 13418 38913 204796620 83 Linux

===================================================================
3. Created directory with name "boot" on partition 1. In boot directory another directory with name "grub" is created.
4. Copied grub files from booted os to grub directory.

Files copied are

1.stage1
2.stage2
3.device.map
4.default
5.e2fs_stage1_5
6.jfs_stage1_5
7.minix_stage1_5
8.fat_stage1_5
9.menu.lst
10.reiserfs_stage1_5
11.xfs_stage1_5
12.installed-version
(other partitions have no data or any OS, I just want to try from scratch and started with aim of booting GRUB)
5. device.map file has following contents
(hd0) /dev/sda
(hd1) /dev/sdb
6. make the grub bootable using following process
grub>root (hd0,0)
grub>setup (hd0,0)
grub>quit

7. Now i reload the PC(disconnected main sata hard disk),stop BIOS<F12>, select to boot from USB.

Here i am expecting boot GRUB from USB drive with giving message something like
booting GRUB...
But its not happening in my case and stopped after quit from BIOS.

Can someone please help me in understanding basics.

crts 03-12-2010 04:03 PM

Hi,

have you ever booted from a USB partition? I recall, that I once had a PC which just would not boot from USB, even though this option was supported according to BIOS. So maybe your PC just might not support this option.

Quote:

3. Created directory with name "boot" on partition 1. In boot directory another directory with name "grub" is created.
On your USB-drive I guess?
Quote:

6. make the grub bootable using following process
grub>root (hd0,0)
grub>setup (hd0,0)
grub>quit
Aren't you setting up a boot partition on your primary drive with this commands? If you want to make your USB-partition bootable I would suspect that you might have to do something like
Code:

grub>root (hd2,0)
grub>setup (hd2,0)
grub>quit

I. e., if your USB-drive is sdc.

psmurthy 03-13-2010 03:30 AM

Hi Crts,

First of all Thanks for your reply.
1. I created boot and grub partition on USB drive.
2. You suggested following steps
grub>root (hd2,0)
grub>setup (hd2,0)
grub>quit

But i dont have hd2 disk . i have hd0(main hard disk), hd1(USB drive)
But why i used hd0 is after reboot i am disconnecting main sata hard disk.
So then USB will become hd0. This is just my understanding.

Appreciate all your help.

crts 03-13-2010 08:54 AM

Quote:

Originally Posted by psmurthy (Post 3896577)
Hi Crts,

First of all Thanks for your reply.
1. I created boot and grub partition on USB drive.
2. You suggested following steps
grub>root (hd2,0)
grub>setup (hd2,0)
grub>quit

But i dont have hd2 disk . i have hd0(main hard disk), hd1(USB drive)
But why i used hd0 is after reboot i am disconnecting main sata hard disk.
So then USB will become hd0. This is just my understanding.

Appreciate all your help.

OK,

but when you run grub your sata-disk is still hd0 and your usb-drive is at that point hd1. Since your listing in previous post listed only sda and sdc as hdd-devices, I thought your usb is hd2. So if this is not the case you might want to try to run grub with (hd1,0).

BTW, I do not understand why you disconnect your sata. If you set your USB-drive as primary boot device in your BIOS this should not be necessary.

psmurthy 03-14-2010 08:04 AM

Thanks a lot. Its working for me.
The reason for disconnecting my sata hard disk is my pc is not recognizing
both USB and stat device at the same time.

crts 03-14-2010 11:24 AM

Quote:

Originally Posted by psmurthy (Post 3897705)
Thanks a lot. Its working for me.
The reason for disconnecting my sata hard disk is my pc is not recognizing
both USB and stat device at the same time.

Hi,

if it is working now then please mark the thread as solved.


All times are GMT -5. The time now is 05:46 PM.