Alexander Hall wrote:
[EMAIL PROTECTED] wrote:
I'm trying to export an mfs filesystem, but it seems not to work.

fstab reads

/dev/wd0b  /tmp     mfs     rw,nosuid,-s=524288 0 0

exports reads

/tmp                    -maproot=root -alldirs clientname

The client can mount but any I/O results in

# mkdir /tmp/shared
# mount -t nfs 192.168.1.10:/tmp /tmp/shared
# ls /tmp/shared
ls: /tmp/shared: Input/output error

If I try to export a subdirectory, and mount that, I get a file protection
error on the mount attempt.

Is this possible, or is there simply no solution?

I've also failed doing this and no, and I don't think its expected to work. I pretty sure similar issues exists for exporting other types of filesystems too (e.g. msdos).

Came up with a somewhat hack-like solution to this issue though:

1. Create an mfs somewhere.
2. Create an empty file filling the entire mfs
3. Configure a vnd device to use the image file
4. Initialize the vnd "disk" (fdisk + disklabel) and create an
   ordinary ffs filesystem.
5. newfs the filesystem
6. mount the filesystem
7. export the filesystem

(Test output below)

Worked for me! :-)

What did _not_work for me was using a file with holes (eg using dd with seek=...) but I suspect that is a limitation or feature of vnd rather than an nfs related issue.

/Alexander

- - - - - - - - - - - - - - - - - -

$ cd /tmp
$ mkdir mfs
$ sudo mount_mfs -s 40960 swap /tmp/mfs
$ cd /tmp/mfs/
$ dd if=/dev/zero of=image bs=64k

/tmp/mfs: write failed, file system is full
dd: image: No space left on device
294+0 records in
293+0 records out
19202048 bytes transferred in 0.058 secs (330414661 bytes/sec)
$ sudo vnconfig /dev/vnd0c image
$ cd ..
$ mkdir mfs.ffs
$ sudo fdisk -yi /dev/rvnd0c

        -----------------------------------------------------
        ------ ATTENTION - UPDATING MASTER BOOT RECORD ------
        -----------------------------------------------------
Warning CHS values out of bounds only saving LBA values
$ echo 'a\na\n\n\n\nw\nq\n' | sudo disklabel -E /dev/rvnd0c
# Inside MBR partition 3: type A6 start 100 size 37400
Treating sectors 100-37500 as the OpenBSD portion of the disk.
You can use the 'b' command to change this.

Initial label editor (enter '?' for help at any prompt)
> partition: [a] offset: [100] size: [37400] FS type: [4.2BSD] > > No label changes.
$ sudo newfs /dev/rvnd0a
newfs: reduced number of fragments per cylinder group from 2336 to 2320 to enlarge last cylinder group
/dev/rvnd0a: 18.3MB in 37400 sectors of 512 bytes
5 cylinder groups of 4.53MB, 290 blocks, 640 inodes each
super-block backups (for fsck -b #) at:
 32, 9312, 18592, 27872, 37152,
$ sudo mount /dev/vnd0a mfs.ffs
$ cd mfs.ffs
$ sudo touch testfile
$
I-search:
$ sudo mount /dev/vnd0a mfs.ffs
$ sudo vi /etc/exports
$ sudo pkill -HUP mountd

Reply via email to