sysinstall(8) && bsdlabel a new disk

Devin Teske dteske at vicor.com
Mon Nov 1 16:04:19 UTC 2010


On Sun, 2010-10-31 at 21:02 +0100, Matthias Apitz wrote:
> Hello,
> 
> I installed a 9-CURRENT from an USB key to a hard disk of a laptop and
> encountered a strange problem: I booted the USB key to normal
> multiuser mode and wanted to wipe out the Windows on the disk, create
> one slice ad4s1 and partitions in it for /, /usr, /var, ... 
> 
> I thought the simplest way would be just run sysinstall(8) and use the
> FDISK and BSDLABEL from the post-install dialog. FDISK went fine and in
> the BSDLABEL dialog I just used 'A' (auto defaults). On 'W' (write to
> disk) the sysinstall(8) complained about 'unable to open /dev/ad4s1a

sysinstall probes hardware when it starts. Therefore, after making
changes (specifically after writing) to the disk in the FDISK partition
editor, you need to Ctrl-C and Abort-out and relaunch sysinstall so that
it probes the new disk devices (ad4s1, ad4s2, etc.) before you can start
adding BSD disklabels (ad4s1a, ad4s1b, etc.) to the slice (aka
partition).

This has been an age-old problem (hmmm, perhaps get could some mad karma
for fixing it).

I imagine that sade has this problem too. Though, what annoys me about
sade is that the Ctrl-C menu doesn't work -- the "Restart" option does
nothing and though "Continue" works, I'm seething over the lack of an
"Abort" option (hmmm, perhaps should file a PR on that one).


>  and
> so on for all the created partitions a...f. And also in the dev fs
> there were no entries created for /dev/ad4s1[a-f]. They apeared after a
> reboot of the system from the USB key.

Reboot should not be required. Just exit sysinstall(8) and go back into
it.

I've made it a habit to (when using sysinstall(8) as a userland utility
to format disks):

1. Launch sysinstall(8) (as root)
2. Main Menu
3. Custom
4. Partition
5. (if more than one disk is present in the system you'll be prompted to
select the disk... use spacebar to select disk, then TAB over to OK and
hit ENTER)
6. partition the disk in whatever manner required
7. Press `W' to write out the changes
8. (select which boot manager or None)
9. Press Ctrl-C after partition table is successfully written
10. Select `Abort' and hit ENTER

then

1. Relaunch sysinstall(8) (as root)
2. Main Menu
3. Custom
4. Partition
5. (if more than one disk is present in the system, use spacebar to
select disk, then TAB over to OK and hit ENTER)
NOTE: This is required to select which disk to operate on within the
disklabel editor
6. Press `Q' to quit-out of the FDISK partition editor (this time, we
don't want to make any changes, we just needed to indicate that this is
the disk that we're going to operate on within the disklabel editor)
7. (select which boot manager or None)
NOTE: This time around, since we're not going to write the partition
table again, it really doesn't matter what you select here
NOTE: you're now back at the custom menu from step 3/4.
8. Label
9. Now use the FreeBSD Disklabel Editor to allocate FreeBSD partitions
from the BIOS partition ad0s1 (or whatever your partition was named)
10. When finished, press `W' to write out changes, perform newfs
actions, and mount the devices as necessary

> 
> How this is supposed to work using sysinstall(8)
> or should one use only bsdlabel(8) directly in such a case?
> 

I'll be the first to admit that sysinstall(8) could be a little easier
to use in the userland. It should be noted that sade(8) (System
Administrator's Disk Editor) is no different -- sade, at this point at
least, is nothing more than the `Partition' and `Label' menus ripped
straight from sysinstall(8)'s `Custom' menu (with some minor other
differences, like the fact that the Ctrl-C menu doesn't work whereas it
does in sysinstall(8) -- really ought to file a PR on that one).


> Thanks
> 
> 	matthias
-- 
Cheers,
Devin Teske

-> CONTACT INFORMATION <-
Business Solutions Consultant II
FIS - fisglobal.com
510-735-5650 Mobile
510-621-2038 Office
510-621-2020 Office Fax
909-477-4578 Home/Fax
devin.teske at fisglobal.com

-> LEGAL DISCLAIMER <-
This message  contains confidential  and proprietary  information
of the sender,  and is intended only for the person(s) to whom it
is addressed. Any use, distribution, copying or disclosure by any
other person  is strictly prohibited.  If you have  received this
message in error,  please notify  the e-mail sender  immediately,
and delete the original message without making a copy.

-> END TRANSMISSION <-



More information about the freebsd-questions mailing list