#topicpath
 *Install FuguIta into HDD [#i69da8dd]
 
 #contents
 
 To install FuguIta on HDD,
 also ''usbfadm'' utility can be used.
 
 Here is a instruction about it;
 
 **Step 0 - Installing FuguIta on a HDD. [#ge308ba3]
 On normal FuguIta LiveCD/LiveUSB, invoke usbfadm utility.
  # usbfadm
  
  Welcome to usbfadm.
  USB flash drive maintenance tool for FuguIta
  
       Boot mode: manual
  
  Type ? for help.
  
  ? : ? --> newdrive
  
  Please make sure the device inserted.
  Then press ENTER -> 
  
  ==== FYI: sd[0-9] on syslog ================================
  sd0 at scsibus2 targ 1 lun 0: <Generic, USB CF Reader, 0.00>
  sd1 at scsibus2 targ 1 lun 1: <Generic, USB SD Reader, 0.00>
  sd2 at scsibus2 targ 1 lun 2: <Generic, Mini SD Reader, 0.00>
  sd3 at scsibus2 targ 1 lun 3: <Generic, USB MS Reader, 0.00>
  sd4 at scsibus2 targ 1 lun 4: <Generic, USB SM Reader, 0.00>
  ============================================================
  Enter the name of device which FuguIta will be installed --> wd0
 HDD drives such as wd0 will not be prompted, but it can be accepted as normal input.
  Disk: wd0       geometry: 2434/255/63 [39102336 Sectors]
  Offset: 0       Signature: 0xAA55
              Starting         Ending         LBA Info:
   #: id      C   H   S -      C   H   S [       start:        size ]
  -------------------------------------------------------------------------------
  *0: A5      0   1   1 -   2434   1  63 [          63:    39102273 ] FreeBSD     
   1: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
   2: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
   3: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
  
  This disk seems to have been partitioned already.
  Continue anyway? [y/N] -> y
  
  Do you make this USB flash drive bootable? [y/n] -> y
  
  Enter size for saving User Data in MB (18392MB free).
  '*' implies all --> 8192
 Caution: usbfadm will erase *ALL DATA* on specified HDD.
  ***THIS IS THE LAST CHANCE***
  If you type 'Y' now, all the data on wd0 will be lost.
  Are you sure to initialize wd0? [y/N] -> y
  
  ========================================
  = Clearing MBR and BSD disklabel
  =
  1+0 records in
  1+0 records out
  1048576 bytes transferred in 0.103 secs (10087020 bytes/sec)
  
  (snip)
  
  ========================================
  = Checking filesystem consistency
  =
  ** /dev/rwd0a
  ** File system is already clean
  ** Last Mounted on /mnt
  ** Phase 1 - Check Blocks and Sizes
  ** Phase 2 - Check Pathnames
  ** Phase 3 - Check Connectivity
  ** Phase 4 - Check Reference Counts
  ** Phase 5 - Check Cyl groups
  10 files, 356188 used, 5171 free (11 frags, 645 blocks, 0.0% fragmentation)
  ** /dev/rwd0d
  ** File system is already clean
  ** Last Mounted on /mnt
  ** Phase 1 - Check Blocks and Sizes
  ** Phase 2 - Check Pathnames
  ** Phase 3 - Check Connectivity
  ** Phase 4 - Check Reference Counts
  ** Phase 5 - Check Cyl groups
  3 files, 3 used, 14645075 free (19 frags, 1830632 blocks, 0.0% fragmentation)
  
  wd0d : ? --> quit
  
  Bye bye...
  #
 Now, you've got a new "LiveHDD" system. ~
 The operation of this "FuguIta LiveHDD" is almost identical to "FuguIta LiveCD/LiveUSB" system, then;
 -You have to enter any parameters at boot time.
 -All files modified after boot will be lost (unless you will do backup by usbfadm).
 -Maximum size of writable partition is about 1GB.
 
 **Step 1 - Make non-interactive at boot time (optional) [#k9e6c26d]
 Note: Before this step, Step 0 have to be performed ever.
 
 By this step, you will not prompted any input at boot time.
 
 To activate non-interactive mode, edit /noasks file on wd0d;
  # mount /dev/wd0d /mnt
  # vi /mnt/noasks
 Uncomment all parameters as follows; ~
 noask_umem must be less than physical memory size and 1024MB.
  # cat /mnt/noasks
  #
  # noasks - parameter settings for non-interactive boot
  #
  # Make statements uncommented
  # to activate settings
  #
  #
  # FuguIta system device
  noask_rdev='wd0a'
  #
  # mfs size in MB
  noask_umem='1023'
  #
  # boot mode
  noask_setup_rw_mode='3'
  #
  # data set name in USB flash drive
  noask_confdir='test.localnet'
 Then unmount it
  # umount /dev/wd0d
 
 **Step 2 - Make users' data persistent (optional) [#ba06ba38]
 Note: Before this step, Step 0 to 1 have to be performed ever.
 
 At this step;
 -Make swap partition active - you can run big application process.
 -Persistent directory will appear.
 
 ***Prepare swap and data partitions [#mc667116]
 Modify fdisk partition table for OpenBSD-only use
  # fdisk -e wd0
  Enter 'help' for information
  fdisk: 1> p
  Disk: wd0       geometry: 2434/255/63 [39102336 Sectors]
  Offset: 0       Signature: 0xAA55
              Starting         Ending         LBA Info:
   #: id      C   H   S -      C   H   S [       start:        size ]
  -------------------------------------------------------------------------------
   0: 06   1133 146  38 -   2434   1  63 [    18210880:    20891456 ] DOS > 32MB  
   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 -   1133 146  37 [          64:    18210816 ] OpenBSD     
  fdisk: 1> e 0
              Starting         Ending         LBA Info:
   #: id      C   H   S -      C   H   S [       start:        size ]
  -------------------------------------------------------------------------------
   0: 06   1133 146  38 -   2434   1  63 [    18210880:    20891456 ] DOS > 32MB  
  Partition id ('0' to disable)  [0 - FF]: [6] (? for help) 0
  Partition 0 is disabled.
  fdisk:*1> e 3
              Starting         Ending         LBA Info:
   #: id      C   H   S -      C   H   S [       start:        size ]
  -------------------------------------------------------------------------------
  *3: A6      0   1   2 -   1133 146  37 [          64:    18210816 ] OpenBSD     
  Partition id ('0' to disable)  [0 - FF]: [A6] (? for help) 
  Do you wish to edit in CHS mode? [n] 
  offset: [64] 
  size: [18210816] *
  fdisk:*1> p
  Disk: wd0       geometry: 2434/255/63 [39102336 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 -   2434   1  63 [          64:    39102272 ] OpenBSD     
  fdisk:*1> w
  Writing MBR at offset 0.
  fdisk: 1> q
 
 ***Make swap (wd0b) and data (wd0e) partition [#m18f09ef]
  # disklabel -E wd0
  Label editor (enter '?' for help at any prompt)
  > p
  OpenBSD area: 64-39102336; size: 39102272; free: 0
  #                size           offset  fstype [fsize bsize  cpg]
    a:          1445760               64  4.2BSD   2048 16384    1 
    c:         39102336                0  unused                   
    d:         16765056          1445824  4.2BSD    512  4096    1 
    i:         20891456         18210880   MSDOS                   
  > d i
  > b
  Starting sector: [64] 
  Size ('*' for entire disk): [39102272] *
  > a b
  offset: [18210880] 
  size: [20891456] 1G
  Rounding size to cylinder (16065 sectors): 2095280
  FS type: [swap] 
  > a e
  offset: [20306160] 
  size: [18796176] 
  FS type: [4.2BSD] 
  Rounding offset to bsize (32 sectors): 20306176
  Rounding size to bsize (32 sectors): 18796160
  > p g
  OpenBSD area: 64-39102336; size: 18.6G; free: 0.0G
  #                size           offset  fstype [fsize bsize  cpg]
    a:             0.7G               64  4.2BSD   2048 16384    1 
    b:             1.0G         18210880    swap                   
    c:            18.6G                0  unused                   
    d:             8.0G          1445824  4.2BSD    512  4096    1 
    e:             9.0G         20306176  4.2BSD   2048 16384    1 
  > q
  Write new label?: [y] y
  # newfs /dev/rwd0e
  /dev/rwd0e: 9177.8MB in 18796160 sectors of 512 bytes
  46 cylinder groups of 202.47MB, 12958 blocks, 25984 inodes each
  super-block backups (for fsck -b #) at:
   32, 414688, 829344, 1244000, 1658656, 2073312, 2487968, 2902624, 3317280,
   3731936, 4146592, 4561248, 4975904, 5390560, 5805216, 6219872, 6634528,
   7049184, 7463840, 7878496, 8293152, 8707808, 9122464, 9537120, 9951776,
   10366432, 10781088, 11195744, 11610400, 12025056, 12439712, 12854368,
   13269024, 13683680, 14098336, 14512992, 14927648, 15342304, 15756960,
   16171616, 16586272, 17000928, 17415584, 17830240, 18244896, 18659552,
  # cd /etc
  # vi rc.local
 
 ***Edit and save /etc files [#e3ebed8f]
 Edit /etc/rc.local as follows;
  # cat rc.local
  #	$OpenBSD: rc.local,v 1.44 2011/04/22 06:08:14 ajacoutot Exp $
  
  # Site-specific startup actions, daemons, and other things which
  # can be done AFTER your system goes into securemode.  For actions
  # which should be done BEFORE your system has gone into securemode
  # please see /etc/rc.securelevel.
  
  swapctl -a /dev/wd0b
  
  mkdir /opt
  if mount -o softdep /dev/wd0e /opt
  then
      :
  else
      fsck -fy /dev/rwd0e && mount -o softdep /dev/wd0e /opt
  fi
  ldconfig -m /usr/local/lib
  
  # vi rc.shutdown
 Edit /etc/rc.shutdown as follows;
  # cat /etc/rc.shutdown                                                         
  #       $OpenBSD: rc.shutdown,v 1.12 2011/04/22 06:08:14 ajacoutot Exp $
  #
  # If it exists, this script is run at system-shutdown by reboot(8),
  # halt(8).  If the architecture supports keyboard requested halting,
  # it is also run by init(8) when such an event happens.
  #
  
  powerdown=NO    # set to YES for powerdown
  
  # Add your local shutdown actions here.
  
  export PATH=$PATH:/usr/local/bin:/usr/local/sbin
  /usr/fuguita/sbin/usbfadm << EOF
  sync
  y
  q
  EOF
  
  # === to unmount /mfs safely ===
  #
  umount -f /mfs
  # 
 Save these modifications to wd0d
  # usbfadm
  
  Welcome to usbfadm.
  USB flash drive maintenance tool for FuguIta
  
       Boot mode: manual
  
  Type ? for help.
  
  ? : ? --> target 
  
  Searching USB flash drives
  Please make sure the device inserted.
  Then press ENTER -> 
  
  +wd0d wd1 sd0 sd1 sd2 sd3 sd4 
  target device --> wd0d
  
  wd0d : ? --> saveas 
  Name of saved data --> test.localnet
  
  Your data will be saved as ``test.localnet''.
  
  wd0d : test.localnet --> sync
  
  Sync current mfs as ``test.localnet'' , OK? [y/N] -> y
  
  sending incremental file list
  created directory /mnt/livecd-config/test.localnet
  ./
  altroot/
  etc/
  ....(snip)...
  var/yp/Makefile.yp.dist
  var/yp/README
  
  sent 13647266 bytes  received 152253 bytes  484193.65 bytes/sec
  total size is 12765903  speedup is 0.93
  
  wd0d : test.localnet --> quit
  
  Bye bye...
 
 **Step 3 - Move files to persistent partition (optional) [#m310f73a]
 Note: Before this step, Step 0 to 2 have to be performed ever.
 
 First, booting from FuguIta-installed HDD device. ~
 Then login as root.
 
 Make sure that /dev/wd0e (persistent device) is mounted.
  # mount
  /dev/rd0a on / type ffs (local)
  /dev/wd0a on /sysmedia type ffs (local, read-only)
  /dev/vnd5a on /fuguita type ffs (local, read-only)
  mfs:5883 on /mfs type mfs (local, size=2095104 512-blocks)
  /dev/wd0e on /opt type ffs (local, softdep)
  # df -h
  Filesystem     Size    Used   Avail Capacity  Mounted on
  /dev/rd0a      1.6M    1.1M    407K    74%    /
  /dev/wd0a      706M    696M   10.1M    99%    /sysmedia
  /dev/vnd5a     676M    640M   35.4M    95%    /fuguita
  mfs:5883      1009M   81.2M    877M     8%    /mfs
  /dev/wd0e     15.7G    2.0K   14.9G     0%    /opt
 For example, move /usr/local (actually /mfs/usr/local) under /opt/ext/usr .
  # mkdir -p /opt/ext/usr
  # cd /mfs/usr
  # ls -l
  total 44
  drwxr-xr-x   7 root  wheel   512 Sep 16 20:00 X11R6
  drwxr-xr-x   2 root  wheel  6144 Sep 16 20:00 bin
  drwxr-xr-x  10 root  wheel   512 Sep 16 20:00 fuguita
  drwxr-xr-x   2 root  wheel  1024 Sep 16 20:00 games
  drwxr-xr-x  34 root  wheel  3072 Sep 16 20:00 include
  drwxr-xr-x   6 root  wheel  1536 Sep 16 20:00 lib
  drwxr-xr-x   6 root  wheel   512 Sep 16 20:00 libdata
  drwxr-xr-x   8 root  wheel  1536 Sep 16 20:00 libexec
  drwxr-xr-x   2 root  wheel   512 May  1 16:19 lkm
  drwxr-xr-x  12 root  wheel   512 Sep 16 20:00 local
  drwxr-xr-x   2 root  wheel   512 Sep 16 20:00 mdec
  drwxr-xr-x   2 root  wheel   512 May  1 16:19 obj
  drwxr-xr-x   2 root  wheel  4096 Sep 16 20:00 sbin
  drwxr-xr-x  19 root  wheel   512 Sep 16 20:00 share
  drwxr-xr-x   2 root  wheel   512 May  1 16:20 src
  drwxr-xr-x   2 root  wheel   512 May  1 16:20 xobj
  # pax -rwvpe local /opt/ext/usr/
  /opt/ext/usr/local
  /opt/ext/usr/local/bin
  /opt/ext/usr/local/bin/anthy-agent
  (snip)
  /opt/ext/usr/local/share/xml
  /opt/ext/usr/local/share/xml/libglade
  /opt/ext/usr/local/share/xml/libglade/glade-2.0.dtd
  # mv local local.xxx
  # ln -s /opt/ext/usr/local .
  # ls -l
  total 44
  drwxr-xr-x   7 root  wheel   512 Sep 16 20:00 X11R6
  drwxr-xr-x   2 root  wheel  6144 Sep 16 20:00 bin
  drwxr-xr-x  10 root  wheel   512 Sep 16 20:00 fuguita
  drwxr-xr-x   2 root  wheel  1024 Sep 16 20:00 games
  drwxr-xr-x  34 root  wheel  3072 Sep 16 20:00 include
  drwxr-xr-x   6 root  wheel  1536 Sep 16 20:00 lib
  drwxr-xr-x   6 root  wheel   512 Sep 16 20:00 libdata
  drwxr-xr-x   8 root  wheel  1536 Sep 16 20:00 libexec
  drwxr-xr-x   2 root  wheel   512 May  1 16:19 lkm
  lrwxr-xr-x   1 root  wheel    18 Sep 16 20:39 local -> /opt/ext/usr/local
  drwxr-xr-x  12 root  wheel   512 Sep 16 20:00 local.xxx
  drwxr-xr-x   2 root  wheel   512 Sep 16 20:00 mdec
  drwxr-xr-x   2 root  wheel   512 May  1 16:19 obj
  drwxr-xr-x   2 root  wheel  4096 Sep 16 20:00 sbin
  drwxr-xr-x  19 root  wheel   512 Sep 16 20:00 share
  drwxr-xr-x   2 root  wheel   512 May  1 16:20 src
  drwxr-xr-x   2 root  wheel   512 May  1 16:20 xobj
  # rm -rf local.xxx
 For 2nd example, move /home (actually /mfs/home) under /opt/ext .
  # cd /mfs
  # ls -l
  total 12
  drwxr-xr-x   2 root  wheel   512 Mar 27 05:55 altroot
  drwxr-xr-x  31 root  wheel  2560 Sep 16 20:25 etc
  drwxr-xr-x   2 root  wheel   512 Mar 27 05:55 home
  drwx------  12 root  wheel  1024 Sep 16 20:39 root
  drwxrwxrwt   5 root  wheel   512 Sep 16 20:28 tmp
  drwxr-xr-x  17 root  wheel   512 Sep 16 20:39 usr
  drwxr-xr-x  23 root  wheel   512 Sep 16 20:00 var
  # mkdir -p /opt/ext/
  # pax -rwvpe home /opt/ext
  /opt/ext/home
  # mv home home.xxx
  # ln -s /opt/ext/home .
  # ls -l
  total 12
  drwxr-xr-x   2 root  wheel   512 Mar 27 05:55 altroot
  drwxr-xr-x  31 root  wheel  2560 Sep 16 20:25 etc
  lrwxr-xr-x   1 root  wheel    13 Sep 16 20:40 home -> /opt/ext/home
  drwxr-xr-x   2 root  wheel   512 Mar 27 05:55 home.xxx
  drwx------  12 root  wheel  1024 Sep 16 20:39 root
  drwxrwxrwt   5 root  wheel   512 Sep 16 20:28 tmp
  drwxr-xr-x  17 root  wheel   512 Sep 16 20:39 usr
  drwxr-xr-x  23 root  wheel   512 Sep 16 20:00 var
  # rm -rf home.xxx
 Save all modifications to wd0d;
  # usbfadm
  
  Welcome to usbfadm.
  USB flash drive maintenance tool for FuguIta
  
       Boot mode: usbflash
  Data stored in: /dev/wd0d
   Data Saved as: test.local
  
  Type ? for help.
  
  wd0d : test.local --> sync
  
  Sync current mfs as ``test.local'' , OK? [y/N] -> y
  
  sending incremental file list
  ./
  home -> /opt/ext/home
  etc/
  deleting etc/nologin
  etc/fstab
  tmp/
  usr/
  deleting usr/local/share/xml/libglade/glade-2.0.dtd
  deleting usr/local/share/xml/libglade/
  (snip)
  var/run/rc.d/sshd
  var/run/rc.d/syslogd
  var/tmp/
  var/www/dev/
  
  sent 24589083 bytes  received 93984 bytes  836714.14 bytes/sec
  total size is 34602836  speedup is 1.40
  
  wd0d : test.local --> quit
  
  Bye bye...
  # 
 That's all.
 
 ----
 #topicpath
 
Reload  New Edit Diff Attach Copy Rename  Top Index Search Recent Backups  Help  RSS