# making bootable USB

## Joseph_sys

I've 4GB USB and trying to make bootable to instal Gentoo, but for some reason or another it doesn't work.

My setup:

```
df -h

/dev/sda1       3.8G  190M  3.6G   5% /run/media/joseph/4GB_ysa

/dev/sda1 *     2048   7864319 3931136   b W95 FAT32
```

I downloaded the latest minimal bootable ISO and mounted:

```
mount -o loop,ro -t iso9660 /home/joseph/download/install-amd64-minimal-20140828.iso /mnt/cdrom
```

while usb not mounted:

```
dd if=/usr/share/syslinux/mbr.bin of=/dev/sda

0+1 records in

0+1 records out

440 bytes (440 B) copied, 0.00121707 s, 362 kB/s

```

While usb mounted:

```
cp -r /mnt/cdrom/* /run/media/joseph/4GB_ysa

mv /run/media/joseph/4GB_ysa/isolinux/* /run/media/joseph/4GB_ysa

mv /run/media/joseph/4GB_ysa/isolinux.cfg /run/media/joseph/4GB_ysa/syslinux.cfg

rm -rf /run/media/joseph/4GB_ysa/isolinux*

mv /run/media/joseph/4GB_ysa/memtest86 /run/media/joseph/4GB_ysa/memtest

sed -i -e "s:cdroot:cdroot slowusb:" -e "s:kernel memtest86:kernel memtest:" /run/media/joseph/4GB_ysa/syslinux.cfg

umount /run/media/joseph/4GB_ysa

syslinux /dev/sda1
```

Does the "dd if=/usr/share/syslinux/mbr.bin of=/dev/sda"

has to be run when USB is mounted or unmounted?

----------

## NeddySeagoon

Joseph_sys,

The dd must be done with the USB not mounted.

As you have plenty of space, like the thing your mother gave you but you don't know what its for[1], make a bootable USB of SystemRescueCD.

SystemRescueCD provides a script for this.

Unlike a USB bootable Gentoo minimal, you can continue to use the free space on a  bootable USB of SystemRescueCD in the normal way.

----------

## Joseph_sys

The SystemRescueCD is for x86 only. They don't have amd64 architecture

http://www.sysresccd.org/Download

My small ATOM-330 box doesn't have a CD so I have to install from USB.

----------

## Jaglover

SystemRescueCd is universal, it will boot 64 bit if your hardware is 64 bit.

----------

## NeddySeagoon

Joseph_sys,

They provide both 64 bit and 32 bit kernels.  Provided you boot one of the 64 bit kernel, it works for 64 bit installs.

The default if you just let it boot, is 32 bit.

x86 means Intel/AMD i686 and newer.

----------

## Joseph_sys

Yes, running their bash script: 

```
cd /tmp/cdrom

bash ./usb_inst.sh
```

I was able to install it on a USB why couldn't I do it using Gentoo guide from:

https://wiki.gentoo.org/wiki/LiveUSB/HOWTO

----------

## NeddySeagoon

Joseph_sys,

Its been a long time since I used the Gentoo *.ISO for installing.

----------

## puchu

you can also use grub2 to chainload the iso directly

http://wiki.gentoo.org/wiki/GRUB2#Chainloading

----------

## Joseph_sys

 *puchu wrote:*   

> you can also use grub2 to chainload the iso directly
> 
> http://wiki.gentoo.org/wiki/GRUB2#Chainloading

 

This would be practical when you have a bootable disk. My HD failed and I'm getting a new SSD 480GB: Intel Pro 2500 SSDSC2BF480H501 to replace it.  I think I'll be looking for information how to partition it and align sectors on my SSD

----------

## Joseph_sys

 *NeddySeagoon wrote:*   

> Joseph_sys,
> 
> Its been a long time since I used the Gentoo *.ISO for installing.

 

If you don't use ISO what do you use, if I may ask.

----------

## Jaglover

Joseph_sys,

when I made my very first Gentoo install in 2004 I used Knoppix because I had it handy. I do not remember ever downloading Gentoo ISO. Have used GRML and SysRescueCd since then.

----------

## fernan82

 *Joseph_sys wrote:*   

> 
> 
> If you don't use ISO what do you use, if I may ask.

 

I use an Arch USB drive to install Gentoo. The 1st time I installed Gentoo I had a hard time getting it to boot from USB so I used Arch with a Gentoo tarball and I've been doing it ever since. The only time I've used the gentoo ISO is to install is on a 486 where Arch won't boot.

Now I use Unetbootin to create multi-boot USB sticks and it works with every distro I've tried, it's not a multiboot tool but if you backup the syslinux config files and install another distro in the strick you can merge the syslinux files manually and get a multiboot stick.

----------

## Joseph_sys

 *fernan82 wrote:*   

>  *Joseph_sys wrote:*   
> 
> If you don't use ISO what do you use, if I may ask. 
> 
> I use an Arch USB drive to install Gentoo. The 1st time I installed Gentoo I had a hard time getting it to boot from USB so I used Arch with a Gentoo tarball and I've been doing it ever since. The only time I've used the gentoo ISO is to install is on a 486 where Arch won't boot.
> ...

 

Interesting.  

I just have a HD failure (first one) and I've noticed that I forgot to backup kernel ".config" file form the failed machine.  So I'll be going through kernel configuration file again during installation instead of making simple 'make oldconfig'

Just a reminder to those who didn't do it, like me.

I usually keep backup of all "/etc" directory tree form each machine and keep the copy distributed (backuped) to other machine but I forgot about kernel ".config"

What other files are important, besides /home directory ?

----------

## Joseph_sys

 *fernan82 wrote:*   

>  *Joseph_sys wrote:*   
> 
> If you don't use ISO what do you use, if I may ask. 
> 
> I use an Arch USB drive to install Gentoo. The 1st time I installed Gentoo I had a hard time getting it to boot from USB so I used Arch with a Gentoo tarball and I've been doing it ever since. The only time I've used the gentoo ISO is to install is on a 486 where Arch won't boot.
> ...

 

I've tried to use "unetbootin" for the current image I downloaded:

install-amd64-minimal-20140828.iso

the process completes OK on 1GB USB but the USB sticks fails to boot.

----------

## Jaglover

What is your goal.

To install Gentoo or get the Gentoo ISO to boot from USB?

----------

## The Doctor

 *Joseph_sys wrote:*   

> I usually keep backup of all "/etc" directory tree form each machine and keep the copy distributed (backuped) to other machine but I forgot about kernel ".config"
> 
> What other files are important, besides /home directory ?

 I'd say 'everything' to some degree. /var/lib/portage/world is another file you will probably miss. You probably would also want /boot to keep your working kernels around. They are not too big.

You might this interesting. It describes how to do an incremental backup so that in the case of an HD failure restoring is as simple as resyncing.

----------

## Joseph_sys

 *Jaglover wrote:*   

> What is your goal.
> 
> To install Gentoo or get the Gentoo ISO to boot from USB?

 

Yes, I'm trying to install current Gentoo minimal ISO to USB stick (as my box doesn't have CD)

install-amd64-minimal-20140828.iso

I've tried 

```
isohybrid  install-amd64-minimal-20140828.iso

dd if=/home/joseph/Downloads/install-amd64-minimal-20140828.iso of=/dev/sda bs=4096

sync
```

but it still doesn't work.

SystemresueCD can generate bootable USB stick nothing else can; so I'm puzzled.

----------

## Jaglover

Alright, let me refine my question.

Are you trying to install Gentoo to your box or to a USB stick?

If your goal is to install Gentoo into your box why are you trying to put Gentoo install ISO to USB stick?

----------

## Joseph_sys

The box I have is an ATOM-330 (small box), the only way I can boot is from USB stick.  So I'm trying to convert Gentoo minimal ISO image and make a bootable USB stick so I can install Gentoo on a new HD.

----------

## fernan82

 *Joseph_sys wrote:*   

> I've tried to use "unetbootin" for the current image I downloaded:
> 
> install-amd64-minimal-20140828.iso
> 
> the process completes OK on 1GB USB but the USB sticks fails to boot.

 

Does it gets to the boot menu? If so you may have to fix the syslinux.cfg file for some distros. Admittedly I haven't tried it with Gentoo. Knoppix will work without modification.

If you have any linux bootable stick you can use it to install Gentoo or if you're trying to install to a new HD and you already have Linux on your current drive you can do the installation from it.

----------

## Jaglover

So what's the problem? You said you can put SytemRescueCd to this USB stick. What denies you to install Gentoo?

----------

## Joseph_sys

 *Jaglover wrote:*   

> So what's the problem? You said you can put SytemRescueCd to this USB stick. What denies you to install Gentoo?

 

I was trying to put gentoo minimal ISO on this USB and I'm not able to do so I'm puzzled by it.

----------

## Jaglover

Hmmm ... you have been here for ten years. 

You want to install Gentoo from USB.

You said you can put SysRescueCd on USB stick.

I'm puzzled now. Why don't you boot from SysRescueCd USB and install Gentoo?

----------

## Joseph_sys

 *Jaglover wrote:*   

> Hmmm ... you have been here for ten years. 
> 
> You want to install Gentoo from USB.
> 
> You said you can put SysRescueCd on USB stick.
> ...

 

I think this will be the case.  However, my new SSD drive hasn't arrive yet, so I have time to play around.

----------

## szatox

easy mode: download Slax as a zip archive

extrct to usb drive

run install script

----------

## NeddySeagoon

Joseph_sys,

For x86 (32 and 64 bit) I use SystemRescueCD.  As it doesn't stop me using the memory stick for other things and its small, its installed on most of my memory sticks.

----------

