Wed Dec 11 14:53:43 ICT 2013

Mount a file system image in FreeBSD

A filesystem have been saved in an image file, this image can be mounted in FreeBSD like any other filesystem.

More information is available in FreeBSD Handbook, in the section Network, Memory and File Backed File System.

  1. The first step is to configure and enable a memory disk associated to the image file; the memory disk has a device of the form /dev/md0 or /dev/md0s1c:
    # mdconfig -a -t vnode -f filename
    
  2. The device can now be mounted like any other device:
    # mount -t type memory-disk-device mount-point
    
  3. To have the list of available memory disks:
    # mdconfig -l
    
  4. After umounting the memory disk, you can remove it with:
    # mdconfig -d -u memory-disk-ID
    

Posted by Olivier | Permanent link | File under: administration, freebsd