OpenBSD Journal
Home : : Add Story : : Archives : : About : : Create Account : : Login :
New disklabel(8) templates make for a more flexible autoinstall
Contributed by pitrh on Tue May 5 12:30:15 2015 (GMT)
from the we slice, we dice, those platters dept.

In a this commit, a first in a series, Henning Brauer (henning@) made disk allocations during automatic installs much more flexible via the introduction of diskablel templates. The matching installer bits came along via this commit by Robert Peichaer (rpe@).

Quoting the updated disklabel(8) man page,

A template for the automatic allocation can be passed to disklabel using -T option.

But the more exciting news is the template format:

The template consists of one line per partition, with each line giving mountpoint, min-max size range, and percentage of disk, space-separated. Max can be unlimited by specifying '*'. If only mountpoint and min size are given, the partition is created with that exact size.

And here's an example of a working disklabel template (stolen from the man page):

/              250M
swap           80-256M 10%
/tmp           120M-4G 8%
/var           80M-4G  13%
/usr           900M-2G 5%
/usr/X11R6     512M-1G 3%
/usr/local     2G-10G  10%
/usr/src       1-2G    2%
/usr/obj       1.3G-2G 4%
/home          1G-*    45%

and here is a sample of output from an autoinstall session using the new feature:

Terminal type? [vt220] vt220
System hostname? (short form, e.g. 'foo') [autoinstalltest] autoinstalltest

Available network interfaces are: vio0 vlan0.
Which network interface do you wish to configure? (or 'done') [vio0] vio0
IPv4 address for vio0? (or 'dhcp' or 'none') [dhcp] dhcp
DHCPREQUEST on vio0 to 255.255.255.255
DHCPACK from 10.1.1.250 (00:15:17:20:bb:94)
bound to 10.1.1.178 -- renewal in 21600 seconds.
IPv6 address for vio0? (or 'rtsol' or 'none') [none] none
Available network interfaces are: vio0 vlan0.
Which network interface do you wish to configure? (or 'done') [done] done
Using DNS domainname bsws.de
Using DNS nameservers at 10.53.0.1 10.53.0.2

Password for root account? 
Public ssh key for root account? [none] no-port-forwarding,no-x11-forwarding ecdsa-sha2-nistp521 AAAAE....
Start sshd(8) by default? [yes] yes
Start ntpd(8) by default? [no] yes
NTP server? (hostname or 'default') [default] ntp.bsws.de
Do you expect to run the X Window System? [yes] no
Change the default console to com0? [yes] yes
Available speeds are: 9600 19200 38400 57600 115200.
Which speed should com0 use? (or 'done') [9600] 9600
Setup a user? (enter a lower-case loginname, or 'no') [no] no

Available disks are: sd0.
Which disk is the root disk? ('?' for details) [sd0] sd0
Use DUIDs rather than device names in fstab? [yes] yes
Disk: sd0	geometry: 6527/255/63 [104857600 Sectors]
Offset: 0	Signature: 0xAA55
            Starting         Ending         LBA Info:
 #: id      C   H   S -      C   H   S [       start:        size ]
-------------------------------------------------------------------------------
 0: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
 1: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
 2: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
*3: A6      0   1   2 -   6526 254  63 [          64:   104856191 ] OpenBSD     
Use (W)hole disk, use the (O)penBSD area, or (E)dit the MBR? [OpenBSD] OpenBSD
URL to autopartitioning template for disklabel? [none] http://10.1.1.251/autodisklabel
Fetching http://10.1.1.251/autodisklabel
/dev/rsd0a: 250.0MB in 512000 sectors of 512 bytes
4 cylinder groups of 62.50MB, 4000 blocks, 8064 inodes each
/dev/rsd0g: 1024.0MB in 2097152 sectors of 512 bytes
6 cylinder groups of 202.47MB, 12958 blocks, 25984 inodes each
/dev/rsd0d: 5120.0MB in 10485760 sectors of 512 bytes
26 cylinder groups of 202.47MB, 12958 blocks, 25984 inodes each
/dev/rsd0e: 1024.0MB in 2097152 sectors of 512 bytes
6 cylinder groups of 202.47MB, 12958 blocks, 25984 inodes each
/dev/rsd0f: 2048.0MB in 4194304 sectors of 512 bytes
11 cylinder groups of 202.47MB, 12958 blocks, 25984 inodes each
/dev/sd0a (dc964774ade6fd9f.a) on /mnt type ffs (rw, asynchronous, local)
/dev/sd0g (dc964774ade6fd9f.g) on /mnt/home type ffs (rw, asynchronous, local, nodev, nosuid)
/dev/sd0d (dc964774ade6fd9f.d) on /mnt/usr type ffs (rw, asynchronous, local, nodev)
/dev/sd0e (dc964774ade6fd9f.e) on /mnt/var type ffs (rw, asynchronous, local, nodev, nosuid)
/dev/sd0f (dc964774ade6fd9f.f) on /mnt/var/log type ffs (rw, asynchronous, local, nodev, nosuid)

Let's install the sets!
Location of sets? (cd0 disk http or 'done') [http] http
HTTP proxy URL? (e.g. 'http://proxy:8080', or 'none') [none] none
HTTP Server? (hostname, list#, 'done' or '?') [pkg.bsws.de] pkg.bsws.de
Server directory? [pub/OpenBSD/snapshots/amd64] pub/OpenBSD/snapshots/amd64

Select sets by entering a set name, a file name pattern or 'all'. De-select
sets by prepending a '-' to the set name, file name pattern or 'all'. Selected
sets are labelled '[X]'.
    [X] bsd           [X] base57.tgz    [X] game57.tgz    [X] xfont57.tgz
    [X] bsd.rd        [X] comp57.tgz    [X] xbase57.tgz   [X] xserv57.tgz
    [X] bsd.mp        [X] man57.tgz     [X] xshare57.tgz  [ ] site57.tgz
Set name(s)? (or 'abort' or 'done') [done] -all bsd* base* etc* man* site*
    [X] bsd           [X] base57.tgz    [ ] game57.tgz    [ ] xfont57.tgz
    [X] bsd.rd        [ ] comp57.tgz    [ ] xbase57.tgz   [ ] xserv57.tgz
    [X] bsd.mp        [X] man57.tgz     [ ] xshare57.tgz  [X] site57.tgz
Set name(s)? (or 'abort' or 'done') [done] done
Get/Verify SHA256.sig   100% |**************************|  1889       00:00    
Signature Verified
Get/Verify bsd          100% |**************************|  9708 KB    00:00    
Get/Verify bsd.rd       100% |**************************|  7429 KB    00:00    
Get/Verify bsd.mp       100% |**************************|  9748 KB    00:00    
Get/Verify base57.tgz   100% |**************************| 54679 KB    00:04    
Get/Verify man57.tgz    100% |**************************|  8769 KB    00:00    
Get/Verify site57.tgz   100% |**************************| 98142       00:00    
Checksum test for site57.tgz failed. Continue anyway? [no] yes
Unverified sets: site57.tgz. Continue without verification? [no] yes
Installing bsd          100% |**************************|  9708 KB    00:00    
Installing bsd.rd       100% |**************************|  7429 KB    00:00    
Installing bsd.mp       100% |**************************|  9748 KB    00:00    
Installing base57.tgz   100% |**************************| 54679 KB    00:06    
Extracting etc.tgz      100% |**************************|   109 KB    00:00    
Installing man57.tgz    100% |**************************|  8769 KB    00:00    
Installing site57.tgz   100% |**************************| 98142       00:00    
Location of sets? (cd0 disk http or 'done') [done] done

What timezone are you in? ('?' for list) [Europe/Berlin] Europe/Berlin
Saving configuration files...done.
Making all device nodes...done.
Multiprocessor machine; using bsd.mp instead of bsd.

CONGRATULATIONS! Your OpenBSD install has been successfully completed!
To boot the new system, enter 'reboot' at the command prompt.
When you login to your new system the first time, please read your mail
using the 'mail' command.

This will turn up in a snapshot on a mirror near you soon, testing and feedback is most welcome.

[topicopenbsd]

<< OpenBSD 5.7 Released | Reply | Flattened | Expanded | OpenBSD 5.7 Shipping, First Pre-orders Arriving >>

Threshold: Help

Related Links
more by pitrh


  Re: New disklabel(8) templates make for a more flexible autoinstall (mod 5/81)
by Anonymous Coward (2601:6:5182:4595:d5d:12fa:8dc2:f311) on Tue May 5 14:01:12 2015 (GMT)
 
Excellent! Thank-you!

The disk allocation was the part of the install I liked the least. This feature will allow me sail through that part of the install.
  [ Show thread ] [ Reply to this comment ] [ Mod Up ] [ Mod Down ]

  Re: New disklabel(8) templates make for a more flexible autoinstall (mod 1/73)
by TOOGAM (TOOGAM) (toogmedu@bespin.org) on Wed May 6 01:07:06 2015 (GMT)
http://toogam.com and http://cyberpillar.com
  > feedback is most welcome.

I see:
> URL to autopartitioning template for disklabel? [none] http://10.1.1.251/autodisklabel

Then, later, I see:

> HTTP proxy URL? (e.g. 'http://proxy:8080', or 'none') [none] none
> HTTP Server? (hostname, list#, 'done' or '?') [pkg.bsws.de] pkg.bsws.de

If I was using a proxy, I believe I'd like to input that proxy server detail before the installer tries to use the URL to the autopartitioning template.

If I specify a directory that I don't want created as a separate partition (maybe with a maximum size of zero or negative one), and then use -A (auto allocate), will the installer be able to use the template for any specified mount points, and use automatic allocation for the other standard mount points, but leave off the unwanted one that I specified? (Presumably the specified directory would then be created under its parent, instead of mounted as a mount point.)
  [ Show thread ] [ Reply to this comment ] [ Mod Up ] [ Mod Down ]

  Re: New disklabel(8) templates make for a more flexible autoinstall (mod -4/74)
by Just Another OpenBSD User (95.42.212.65) on Sat May 16 06:50:14 2015 (GMT)
  (yeah) ...it Keeps getting better, each and every day...

One step closer to the OpenBSD adoption in the remote computing centers for mere mortals on their behalf, what could possibly go wrong there.

Well appreciated work as always, much desired by all working with mass deployments after the installation / upgrade templates got in.

Once again showing the rest of the developer groups how it's done elegantly. An installer can't be that hard yet they keep getting it wrong for decades. Practically we're all drawn to OpenBSD as if by a tractor beam with each release.

Thanks, Henning! And all developers excercising brainhours on OpenBSD.

Now how about throwing a nickel, corporation dude?
  [ Show thread ] [ Reply to this comment ] [ Mod Up ] [ Mod Down ]

  Re: New disklabel(8) templates make for a more flexible autoinstall (mod -3/31)
by mxffiles (218.11.246.179) on Tue Feb 7 06:54:11 2017 (GMT)
  This is a very good post which I really enjoy reading. It is not every day that I have the possibility to see something like this. Software mxf Software mxf converter free download to convert HD camcorder files. ts converter convert ts video files to avi, mp4, wmv, mov mts to avi mp4 mov mkv iMovie, FCP/FCE with mts converter, so to convert mts files for your PC and mobiles. mod converter and convert tod files just free download mod video converter. m2ts
  [ Show thread ] [ Reply to this comment ] [ Mod Up ] [ Mod Down ]

[ Home | Add Story | Archives | Polls | About ]

Copyright © 2004-2008 Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to April 2nd 2004 as well as images and HTML templates were copied from the fabulous original deadly.org with Jose's and Jim's kind permission. Some icons from slashdot.org used with permission from Kathleen. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. Search engine is ht://Dig. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]