# nanobsd not booting



## manefesto (Oct 26, 2010)

After creating nanobsd image with default config and install to flash drive:

```
cd /usr/src/tools/tools/nanobsd
sh nanobsd
dd if=/usr/obj/nanobsd.full/_.disk.full of=/dev/da0 bs=64k
```

This flash drive with nanobsd is not booting. What am I not doing correctly?

PS: in BIOS set boot from usb, tested on 3 notebooks and 1 laptop.


----------



## mousaka (Oct 26, 2010)

At which step the boot process hangs? What sort of hardware do you use?

mousaka


----------



## manefesto (Oct 26, 2010)

Building nanobsd on 8.1 i386. Booting not starting. After turning on the laptop I choose to boot from usb, but no boot on usb flash. Maybe boot loader not have on usb? 

Flash has slice


> da0s1
> da0s2
> da0s3



But not have loader.

*dd of=....* wrote loader or not?

Attempting booting on 





> amd neo II k125
> intel atom 270
> core 2 duo


----------



## SirDice (Oct 26, 2010)

I've never played with nanobsd but if the stick has multiple slices you may need to mark the slice it boots from 'active'. I have, on several occasions, forgotten to do this with 'regular' harddrives and the system simply refused to boot from it.


----------



## aragon (Oct 26, 2010)

NanoBSD builds its images with MBR partition tables written in a way that might be incompatible with USB flash drive booting...


----------



## manefesto (Oct 27, 2010)

How manualy write mbr on flash drive?
To use different drives, Kingston 1 GB and transÑend 2GB, but none of them are not loaded


----------



## mousaka (Oct 27, 2010)

NanoBSD uses the serial console as output per default. Try to set NANO_BOOTLOADER to boot/boot0 for VGA output.

Edit: 

Which device node is assigned to your usb drive?
Can you mount the usb drive on a running system?
mousaka


----------



## manefesto (Oct 27, 2010)

Booting does not occur. Skip booting from usb and start booting from hard drive(windows).


----------



## mousaka (Oct 27, 2010)

I assume you can successfully boot from other USB devices. E.g. try the memstick Image from FreeBSD with the same flash drive.

The dd command should write the correct MBR as well.

Did you set NANO_BOOTLOADER to boot/boot0 or have a serial connection established during boot?
Else you won't see receive any information before your windows installation starts.

Try to load your flash drive with the NanoBSD image as memory device to check the image is written right to the drive.


----------



## aragon (Oct 27, 2010)

manefesto said:
			
		

> How manualy write mbr on flash drive?


You can modify the MBR in the disk image by creating an MD device of it:


```
mdconfig -a -t vnode -f /path/to/image/file
```

The above command will output the MD device node, eg. md0.  From there you can edit the MBR with fdisk(8), gpart(8), etc. by referencing /dev/md0.

When you're done:


```
mdconfig -d -u 0
```

(-u 0 assumes the MD device is md0)


----------



## manefesto (Nov 3, 2010)

aragon said:
			
		

> You can modify the MBR in the disk image by creating an MD device of it:
> 
> 
> ```
> ...



Im do that. I'm doing that. NanoBSD boot,[ ]but no is not working. trying Trying [to] boot from hard drive, [did] not create md volume. Maybe [I'll] try install[ing] freebsd FreeBSD on flash.


----------



## mousaka (Nov 3, 2010)

manefesto said:
			
		

> NanoBSD boot,but no working.


What is not working?


			
				manefesto said:
			
		

> trying boot from hard drive, not create md volume.


The memory device (md) can only be used within a running system, not as boot device. This give you only the possibility to edit the image (/usr/obj/nanobsd.full/_.disk.full) before writing it to the flash disk (before dd command).

mousaka


----------

