a5cd NanoBSD with gpart - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Non-i386 / amd64 > Embedded

Embedded Having questions related to ARM/MIPS devices which are not desktops and which usually serve a single purpose such as routers, switches, PDAs, etc?

Reply
 
Thread Tools Display Modes
  #1  
Old October 7th, 2010, 09:29
schmurfy schmurfy is offline
Junior Member
 
Join Date: Apr 2010
Posts: 49
Thanks: 5
Thanked 0 Times in 0 Posts
Default NanoBSD with gpart

Hello,
I have a somewhat silly problem but I cannot find the answer alone

I tried to upload a new firmware to a nanobsd box (with freebsd FreeBSD 8) but running:
$ boot0cfg -s 3 -m 6 ad0

completely messes with the running system, most read/write operation will fail with errors and even with "reboot", it is pretty scary so I did some search and found out that boot0cfg was more or less deprecated in favor of gpart, is that correct?

I found what I think to be the equivalent of my boot0cfg line with gpart to be:
Code:
gpart bootcode -b /boot/mbr ad0
$ gpart bootcode -b /boot/boot ad0s3
$ gpart set -a active -i 3 ad0
but after a reboot the system boots the second partition (which was the partition it was running on) xD

Here is the gpart show ad0 output: (partition 1 is unused and can be ignored, partition 2 is the one the system runs on)
Code:
=>     63  7372449  ad0  MBR  (3.5G)
       63      945    1  freebsd  (473K)
     1008   306432    2  freebsd  (150M)
   307440   306432    3  freebsd  [active]  (150M)
   613872     4032    4  freebsd  (2.0M)
   617904  6754608       - free -  (3.2G)

=>  0  945  ad0s1  BSD  (473K)
    0   16         - free -  (8.0K)
   16  929      1  !0  (465K)

=>     0  306432  ad0s2  BSD  (150M)
       0      16         - free -  (8.0K)
      16  306416      1  !0  (150M)

=>     0  306432  ad0s3  BSD  (150M)
       0      16         - free -  (8.0K)
      16  306416      1  !0  (150M)

=>   0  4032  ad0s4  BSD  (2.0M)
     0    16         - free -  (8.0K)
    16  4016      1  !0  (2.0M)
I did an fsck on the 3rd partition which shown no error I just cannot manage to make freebsd FreeBSD boot it

PS: boot0cfg still seems to work after managing to force a reboot (init 6) but I would prefer avoiding it considering the errors it causes.

Last edited by DutchDaemon; October 7th, 2010 at 13:24. Reason: It's "FreeBSD', pal.
Reply With Quote
  #2  
Old October 9th, 2010, 18:21
aragon aragon is offline
Giant Locked
 
Join Date: Nov 2008
Location: Cape Town, South Africa
Posts: 2,031
Thanks: 68
Thanked 253 Times in 203 Posts
Default

You can't just change which partition the boot loader chains to. You also need to update fstab.

You should also not use /boot/mbr as your boot manager because that will prevent you from manually falling back to the previous system via the serial console. Use boot0 rather - it follows the active partition flag too.

You can find my update script at misc/145961.
Reply With Quote
The Following User Says Thank You to aragon For This Useful Post:
schmurfy (October 22nd, 2010)
  #3  
Old October 22nd, 2010, 16:31
schmurfy schmurfy is offline
Junior Member
 
Join Date: Apr 2010
Posts: 49
Thanks: 5
Thanked 0 Times in 0 Posts
Default

Thanks for your answer, I did not think about not being able to use the serial port console. I will check your script.

Last edited by DutchDaemon; October 22nd, 2010 at 16:57.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
gpart GPT boot loader problem Paul-LKW Installing & Upgrading 1 May 2nd, 2010 01:22
Nanobsd Problems embeddedbob Embedded 9 April 24th, 2010 04:18
[Solved] gpart: No such geom henker Installing & Upgrading 3 April 9th, 2010 22:33
gpart -t freebsd-swap Erratus Installing & Upgrading 1 March 16th, 2010 01:17
gpt or gpart in sysinstall juedan Installing & Upgrading 1 December 5th, 2009 22:50


All times are GMT +1. The time now is 01:17.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0