All pastes #613729 Raw Edit

Something

public text v1 · immutable
·published 2007-07-11 04:24 UTC
rendered paste body

 --- (ttyp6) root@sat.xisop # cat /usr/local/libexec/cgd_swap.sh  
#!/bin/sh
# Invoked early by /etc/rc.local

# http://cvs.pulsar-zone.net/cgi-bin/cvsweb.cgi/mmondor/tests/entropy/
ENTROPY_DISK='/usr/local/libexec/entropy_disk'
CGDCONFIG='/sbin/cgdconfig'
KILL='/bin/kill'
CAT='/bin/cat'
DISKLABEL='/sbin/disklabel'
SWAPON='/sbin/swapon'

swap_cgddevice='cgd0'
swap_device='/dev/wd0b'
swap_disklabel='/etc/cgd/wd0b.disklabel'

echo 'Attaching cgd(4) swap device'

$ENTROPY_DISK
$CGDCONFIG $swap_cgddevice $swap_device
$KILL $($CAT /var/run/entropy_disk.pid)

$DISKLABEL -R -r $swap_cgddevice $swap_disklabel
$SWAPON /dev/${swap_cgddevice}a

 --- (ttyp6) root@sat.xisop # cat /etc/cgd/wd0b                   
algorithm aes-cbc;
iv-method encblkno;
keylength 128;
verify_method none;
keygen randomkey;

 --- (ttyp6) root@sat.xisop # disklabel wd0
# /dev/rwd0d:
type: unknown
disk: sat
label: 
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 15
sectors/cylinder: 945
cylinders: 24944
total sectors: 23572080
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0 

16 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
 a:  12811365  10236240     4.2BSD   1024  8192 46760  # (Cyl.  10832 -  24388)
 b:    524475  23047605       swap                     # (Cyl.  24389 -  24943)
 c:  13335840  10236240     unused      0     0        # (Cyl.  10832 -  24943)
 d:  23572080         0     unused      0     0        # (Cyl.      0 -  24943)
 e:  10236177        63       NTFS                     # (Cyl.      0*-  10831)

 --- (ttyp6) root@sat.xisop # disklabel cgd0
# /dev/rcgd0d:
type: cgd
disk: cgd
label: fictitious
flags:
bytes/sector: 512
sectors/track: 2048
tracks/cylinder: 1
sectors/cylinder: 2048
cylinders: 256
total sectors: 524475
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0 

4 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
 a:    524412        63       swap                     # (Cyl.      0*-    256*)
 d:    524475         0     unused      0     0        # (Cyl.      0 -    256*)

 --- (ttyp6) root@sat.xisop # swapctl -l
Device      1M-blocks     Used    Avail Capacity  Priority
/dev/cgd0a        256      150      105    59%    0