Tips:FreeBSD vnode samba

From Wiki

Jump to: navigation, search
TIPS edit

FreeBSD vnode SambaHPing3 (patch)Fetchmail (POP3s)NetBSD pkgsrc under OSXSimple Bash Ad-hoc file sharing256 colors in Urxvt


Contents

Problematic

Having a Network access server (NAS) which only provide Samba doesn't allow one to choose files permissions (e.g : chown, chmod) which are required to make ports working. Here's a trick to fix this problem.


Requirements

  • FreeBSD >= 5
  • Samba-compliant Kernel :
options 	SMBFS
options 	NETSMB
options 	LIBMCHAIN
options 	LIBICONV

Configuration

RAW disk

  • Create a 10G empty file.

Nb : in this example, the Samba NAS is mounted on /nas

dd if=/dev/zero of=/nas/ports.img bs=1024k count=10000
cd /nas
ls -lah
#-rwxr-xr-x  1 root  wheel   9.8G Feb  8  2031 ports.img

Device creation

  • You must now create a device which will be used as a physical drive.

Nb : in thie sample : /dev/md0 (-u 0)

mdconfig -a -t vnode -f /nas/ports.img -u 0

Disk formatting and file system creation

  • We will create only one partition, no slices.
disklabel -r -w md0 auto
newfs md0a

Mounting the disk

mount /dev/md0a /usr/ports
df -h
#/dev/md0a                        9.5G    330M    8.4G     4%    /usr/ports

Conclusion

The 10G Samba file on NAS is know using UFS.
Be aware that performances won't be really good.

Personal tools