TEXT   81
do setup vdisk
Guest on 26th August 2023 12:10:33 PM


  1. do_setup_vdisk() {
  2.  
  3.   # write labels + bootsector
  4.   bsdlabel -B -R /dev/${MD} ${LABELTMP}
  5.  
  6.   # create filesystem
  7.   newfs /dev/${MD_ROOT}
  8.   newfs /dev/${MD_TMP}
  9.   newfs /dev/${MD_VAR}
  10.   newfs /dev/${MD_USR}
  11.  
  12.   # enable softupdates
  13.   tunefs -n enable /dev/${MD_ROOT}
  14.   tunefs -n enable /dev/${MD_TMP}
  15.   tunefs -n enable /dev/${MD_VAR}
  16.   tunefs -n enable /dev/${MD_USR}
  17.  
  18.   # create mount point for virtual disk device, and mount
  19.   mkdir -p ${VDMNT}  
  20.   mount -o noatime /dev/${MD_ROOT} ${VDMNT}
  21.  
  22.   # create mount points
  23.   mkdir -m 0755 -p ${VDMNT}/var
  24.   mkdir -m 0755 -p ${VDMNT}/tmp
  25.   mkdir -m 0755 -p ${VDMNT}/usr
  26.  
  27.   # unmount and unload virtual disk device
  28.   umount /dev/${MD_ROOT}
  29. }

Raw Paste

Login or Register to edit or fork this paste. It's free.