Page 1 of 1

Embedded install doesn't create bootable stick

Posted: 01 May 2013 01:54
by new-at-nas
Hello everybody,

I'm stuck with my embedded NAS4Free 9.1.0.1.636 install on an HP DC7800 CMT.
N4F boots fine from CD and seems to recognize the HW. When I install it to embedded, it writes an image to my stick and reports success (something like "You can now safely remove the CD and reboot").
When I open a shell from the basic N4F menu, manually mount the stick and look at its contents, the stick looks OK, occupying 96 MB.
BUT: The machine won't boot from that stick. It seems to hang with blinking text cursor before any booting begins. It doesn't even give a "non-system disk" error.
The same PC does boot 64-bit Linux live CD ISOs from stick so USB booting can't be the problem.
The same stick doesn't boot on other machines, either. Of course I have tried different sticks, but to no avail.

So I think the image on the stick is the problem.

When I look at the stick on other systems, they see a 26 MB partition (not 96 MB!) on an otherwise empty stick. That partition can't be mounted, though:

Error mounting /dev/sdg at /media/theuser/disk:
Command-line `mount -t "ufs" -o
"uhelper=udisks2,nodev,nosuid" "/dev/sdg"
"/media/theuser/disk"' exited with non-zero
exit status 32: mount: wrong fs type,
bad option, bad superblock on /dev/sdg,
missing codepage or helper program, or other error

GNU Parted says the following about that stick (my translation from german):

(parted) select /dev/sdg
using /dev/sdg
(parted) print
error: invalid partition table - recursive partition on /dev/sdg.

Am I right that the stick's partitioning looks wrong?

To examine the strange partition from inside a running N4F, I mounted it on the shell after the N4F installer had written the image. "du -hs" shows the contents at 96 MB.

When I ask

geom disk list

I see the stick as "geom da0" but

gpart show da0

reports "No such geom: da0".

so I didn't really learn anything there. I don't get it.

Then I tried other things:

* wrote the NAS4Free-x64-LiveUSB-9.1.0.1.636.img file to the stick with imagewriter - won't boot.
* wrote the NAS4Free-x64-embedded-9.1.0.1.636.img to the stick with dd as alexej123 described in viewtopic.php?f=15&t=3106
- won't boot, but different message this time ("non-system disk or disk error").
* Booted the ISO inside a VirtualBox, installed to stick and moved that stick to the real machine - won't boot.
* used the older 9.1.0.1.573 ISO: same result.
* Wrote the live-CD iso file to the stick with Unetbootin. Interestingly, the stick booted but then the Unetbootin menu didn't contain an entry for the N4F iso.

All this makes me think there's something wrong with the image itself. Maybe it's somehow not marked as bootable.

But then I must be making an idiotic mistake because this is working so nicely for everybody else!

What can I do...?

Any help would be appreciated - thanks a lot!

Re: Embedded install doesn't create bootable stick

Posted: 01 May 2013 10:04
by raulfg3
Try to do a full install instead embeded, when install, you need to define size for boot partition.

Try this time to boot, If still do not boot, check size of boot partition ,must be the same You define previously.

Re: Embedded install doesn't create bootable stick

Posted: 01 May 2013 11:04
by armandh
USB booting is not my Favorite way, I prefer IDE
one must have it connected to a USB port that the hardware will boot from.
later when hardware has booted from the new boot medium [USB stick or whatever]
one might install it to access another partition or [in my case] spin down a small Hdd.

just because one can write the OS to a new boot medium does NOT mean the hardware will boot from it
some hardware will only boot from a limited group of places.
some of the worst have early box builder supplied bios.
Blinking cursor also happens when the hardware polls usb ports looking for the boot but hangs on non boot storage
check the order of boot devices in the bios and re order usb attached devices such that the OS is first
on some hardware USB sticks 2Gb and over won't be recognized and won't boot by the hardware [more blinking cursor]
also be sure the USB stick is clean first [no "helpful" software or drivers]
on some hardware not all the USB ports would boot, only 2 on the back.
toggle the usb legacy support in the bios.
and if it still wont boot your USB stick.... there is nothing wrong with the live CD and a USB or floppy for the config.

an old Dell I have for a cold stand by will only boot from the primary IDE PATA cable, floppy, or Nic rom.
for its boot i am currently using [on the primary IDE line] a 2 Gb Toshiba Hdd salvaged from an even older xerographic printer .
the N4F I gave to my Daughter used an 8 Gb WD Hdd for the boot. another give away a 1.7 gb Fujitsu Hard drive
all these "old dog" Hdds are installed to spin down in 5 minutes

USB booting is great when it works and a PITA when it does not.
there seems to be very little conformity to any standard
so a failing USB boot can be just about any small thing
IDE just works [as it did for the live cd]
all 3 of my active N4F use IDE PATA or SATA flash.
http://www.logicsupply.com/categories/f ... sh_modules

Re: Embedded install doesn't create bootable stick

Posted: 01 May 2013 13:08
by RedAntz
Hi new-at-nas,

Assuming that you have set the BIOS to boot USB correctly (*note, some old motherboard will treat your USB stick as a USB-HDD ), it could just mean that either your usb stick is old and is just not capable of booting ( I have one of these in 1 GB size ).

However, since you mentioned that you have tried other usb sticks as well, I assume there is a step you are not aware of :- Did you extract the .img file ?

I wrote this guide a while ago (in Windows though):-
[HOWTO] Write NAS4Free Image file (.img) to USB stick / CF

Re: Embedded install doesn't create bootable stick

Posted: 01 May 2013 13:19
by armandh
RedAntz wrote:Hi new-at-nas,
However, since you mentioned that you have tried other usb sticks as well, I assume there is a step you are not aware of :- Did you extract the .img file ?
the OP went from CD to USB

Re: Embedded install doesn't create bootable stick

Posted: 05 May 2013 01:58
by new-at-nas
Hi all,

thank you very much for your very elaborated and thoughtful answers. I appreciate the time you put into them.

@raulfg3:
Try to do a full install instead embeded, when install, you need to define size for boot partition.
Good idea, I will try it as soon as I have time.

However, the following hint from arnandh was even quicker for me:
and if it still wont boot your USB stick.... there is nothing wrong with the live CD and a USB or floppy for the config.
Very simple, but I wasn't aware of that possibility. It works, boots within an acceptable 80 seconds and I don't need that fourth SATA port at the moment. Great!

As a side note: I configured the BIOS for WOL and will probably use fritz' acpimanage-scripts to put the NAS to sleep. But NAS always woke up after a few seconds.

It took me a while to figure out that in addition to WOL by magic packets my NIC also supports "WOL_MCAST" that reacts to arbitrary(?) network traffic. After some more research I was able to turn it off in the rc.conf. I was worried about rc.conf and the Live-CD's RAM-disk, but - somewhat surprising - editing the rc.conf via the WebGUI makes the changes persistent even in my Live-CD boot setup. That's really something.

Nice job, NAS4Free-team!

Again, thanks very much, especially to raulfg3 and arnandh, for helping so quickly!

Re: Embedded install doesn't create bootable stick

Posted: 06 May 2013 00:41
by armandh
here is what I use in 2 of my 3 active NAS as the boot medium
http://www.logicsupply.com/categories/f ... sh_modules
the other is 40 pin PATA
not shown is the 5VDC connection

Using live CD, changes to the config are stored on a floppy or usb storage.
I once used an 8 Mb camera flash and usb adapter for the config.
that the changes are persistent indicates there is some storage somewhere
and if not known, that is likely the reason the USB stick would not boot

if you are using a USB keyboard be sure there is no storage involved

Re: Embedded install doesn't create bootable stick

Posted: 06 May 2013 00:55
by RedAntz
armandh wrote:
RedAntz wrote:Hi new-at-nas,
However, since you mentioned that you have tried other usb sticks as well, I assume there is a step you are not aware of :- Did you extract the .img file ?
the OP went from CD to USB
Yes I am aware of that. The HOWTO is meant for writing .img file to USB stick, not CD.

Re: Embedded install doesn't create bootable stick

Posted: 06 May 2013 16:44
by new-at-nas
armandh wrote: Using live CD, changes to the config are stored on a floppy or usb storage.
As I said, I wasn't aware of that. It was very good advice.
armandh wrote: that the changes are persistent indicates there is some storage somewhere
and if not known, that is likely the reason the USB stick would not boot
No, there is no hidden storage area (that I'm aware of): Changes to rc.conf (when edited through "Advanced" in the N4F-GUI) are saved in the config.xml and then re-applied during the actual boot process before rc.conf is being parsed. That's what I applauded above.

I still don't understand about that 26MB-partition. Only now I don't have to...

Re: Embedded install doesn't create bootable stick

Posted: 07 May 2013 01:58
by armandh
OK
I am glad that it is working but I am a bit confused
if you are booting from the CD,
exactly what is your config storage on?
thanks
Armand

PS
FYI the config file is around 20 Kb

if there is a small FAT partition on a HDD
it may have hanging the USB boot.

Re: Embedded install doesn't create bootable stick

Posted: 15 May 2013 14:29
by new-at-nas
Sorry for not answering for a week.
armandh wrote: OK
I am glad that it is working but I am a bit confused
if you are booting from the CD,
exactly what is your config storage on?
It's on a USB stick. N4F will mount it and find the config.xml, but not boot from it.

Re: Embedded install doesn't create bootable stick

Posted: 15 May 2013 21:22
by armandh
OK I have the clear picture now

the Live CD has recorded the .xml config file on the USB memory. be sure to back this up to a client computer!
this is done at the web GUI, system tab drop-down > backup/restore

but when the live CD is used to transfer the embedded OS to [another] USB stick and that stick will not boot,
[it will first wipe a standard stick] [step #9 on the CD N4F menu] there is usually one of two reasons for this non-boot.
1) the hardware will not boot from that USB port. mobo issues, bios setting issues, polling order issues.
2) the USB stick was not clean to begin with, many come pre loaded with driver or other boot blocking stuff.

But live CD with config storage works and once the embedded OS is loaded into memory,
there is no difference in operation from booting the embedded OS from USB or IDE flash

enjoy
armand

Re: Embedded install doesn't create bootable stick

Posted: 16 May 2013 18:04
by Lee Sharp
Note that on a USB embedded install, you need to boot from the CD with no flash installed. (If you boot the CD with the flash drive inserted, the CD will use it to save the config.) After fully booted, install the flash and install to it. Then reboot, making sure that when you removed the USB CD-Rom, your BIOS did not reshuffle everything back to boot from the SATA drive. :)

Also, you can use Linux to burn the image directly as well with zcat and dd.

Re: Embedded install doesn't create bootable stick

Posted: 25 Jun 2013 21:12
by new-at-nas
raulfg3 wrote:Try to do a full install instead embeded, when install, you need to define size for boot partition.

Try this time to boot, If still do not boot, check size of boot partition ,must be the same You define previously.
I tried it, and it works: The PC boots fine from a full install on the stick. and much faster than it booted from CD. The config is on an extra stick as it used to be.

Thanks again for everybody's quick and thoughtful help.

I only need to figure out how to update the system - updating works a little differently for a full install, as I remember, but since I haven't done much to the system, I might as well just overwrite it with a new full install (right?). Using the old config.xml of course.

Re: Embedded install doesn't create bootable stick

Posted: 26 Jun 2013 13:15
by armandh
a "FULL" install where the OS is not loaded into memory is not recommended for USB or any simple flash memory.
the write wear without any flash write wear leveling will soon cause failure. this may NOT be what you are using.

"Live" USB the equivalent of the CD on a usb stick [shows step 9 on the console display]
is an embedded OS load and will work with a second usb stick to store the configuration.
this arrangement will not overly wear the flash memory. [read once at each boot]

assuming separate OS and data storage, changing the OS version does not require starting over
often simply restoring the configuration will do. or importing the pool.