.\" $NetBSD: sgivol.8,v 1.10 2017/02/17 22:30:28 christos Exp $
.\"
.\" Copyright (c) 2006 Stephen M. Rumble
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. The name of the author may not be used to endorse or promote products
.\" derived from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd February 17, 2017
.Dt SGIVOL 8 sgimips
.Os
.Sh NAME
.Nm /usr/mdec/sgivol
.Nd configure SGI Volume Header
.Sh SYNOPSIS
.Nm
.Op Fl fq
.Ar device
.Nm
.Op Fl fq
.Fl i
.Op Fl h Ar vhsize
.Ar device
.Nm
.Op Fl fq
.Fl r
.Ar vhfilename
.Ar diskfilename
.Ar device
.Nm
.Op Fl fq
.Fl w
.Ar vhfilename
.Ar diskfilename
.Ar device
.Nm
.Op Fl fq
.Fl d
.Ar vhfilename
.Ar device
.Nm
.Op Fl fq
.Fl m
.Ar vhfilename
.Ar vhfilename
.Ar device
.Nm
.Op Fl fq
.Fl p
.Ar partno
.Ar partfirst
.Ar partblocks
.Ar parttype
.Ar device
.Sh DESCRIPTION
The
.Nm
program prepares an SGI Volume Header to be used to boot
.Nx .
The
.Tn SGI
PROM is able to load executables within the header, which in turn are used
to load the kernel from another file system.
.Sh OPTIONS
The following options are available:
.Bl -tag -width 123456
.It Fl f
Force the operation.
Do not ask the user before proceeding.
.It Fl h
Set the size of the newly initialized volume header in blocks.
One block is 512 bytes.
The default volume header size is 3135 blocks (1.53MB).
.It Fl q
Suppress output.
.El
.Sh PARTITION TYPES
The numerical partition types for the volume header include:
.Bd -unfilled -offset indent
0: Volume Header
1: Replicated Tracks
2: Replicated Sectors
3: Raw
4: BSD4.2 file system
5: SysV file system
6: Entire Volume (all disk blocks)
7: EFS
8: Logical Volume
9: Raw Logical Volume
10: XFS
11: XFS Log
12: XLV Volume
13: XVM Volume
.Ed
.Sh EXAMPLES
To display the existing volume header and partition table on disk
.Dq sd0 :
.Dl Ic sgivol sd0
.Pp
To initialize a new volume header 42 512-byte blocks large on disk
.Dq sd0 :
.Dl Ic sgivol -i -h 42 sd0
.Pp
To copy a file
.Pa boot
from the volume header to local file
.Pa /tmp/boot
on disk
.Dq sd0 :
.Dl Ic sgivol -r boot /tmp/boot sd0
.Pp
To copy a local file
.Pa /usr/mdec/ip2xboot
to the volume header as
.Pa boot
on disk
.Dq sd0 :
.Dl Ic sgivol -w boot /usr/mdec/ip2xboot sd0
.Pp
To delete the existing file
.Pa boot
from the volume header on disk
.Dq sd0 :
.Dl Ic sgivol -d boot sd0
.Pp
To move (rename) an existing file
.Pa file1
to
.Pa file2
in the volume header on disk
.Dq sd0 :
.Dl Ic sgivol -m file1 file2 sd0
.Pp
To change partition 0 to type 4 (BSD4.2) beginning at block offset 3200
and continue for 28000 blocks on disk
.Dq sd0 :
.Dl Ic sgivol -p 0 3200 28000 4 sd0
.Sh SEE ALSO
.Xr sgimips/boot 8