Monday, October 26, 2009

Using amd daemon to automount your external devices in FreeBSD  

We both know that all of the current Linux distribution can automatically mount all of the external hard drive such as usb flash drives, CDROM, usb disk and so on.... However, another bsd systems ware still necessary to manually mount all of the device no matter FreeBSD or openBSD, but in fact there is a way to let you mount external devices automatically when you insert a flash drive in your FreeBSD system. It is only need to modify a few files to achieve this goal. The emphasis is amd package. Amd is a automounter program that will make your external disk or CDROM to be mounted automatically well, but how to use it? You can refer to the following steps that will show you detailed information:

  • 1. Create your directory for CDROM or USB drive as follows

# mkdir /mnt/cdrom
# mkdir /mnt/disk


  • 2. Adding follow information in your /etc/rc.conf file

# vi /etc/rc.conf

portmap_enable=YES
portmap_flags=”-h 127.0.0.1″
amd_enable=YES
amd_flags=”-a /.amd_mnt -c 10 -w 2 -l syslog /host /etc/amd.map”

  • 3. Modify fstab file to be created mount point for your devices

# vi /etc/fstab

/dev/acd0 /mnt/cdrom cd9660 ro,noauto 0 0
/dev/da0s1 /mnt/disk msdosfs rw,noauto 0 0 (If you ware using ntfs type, please changed msdosfs to ntfs-3g)

  • 4. Adding follow information in amd.map file

# vi /etc/amd.map

localhost type:=auto;fs:=${map};pref:=${key}/

localhost/cdrom type:=program;fs:=/mnt/cdrom;
mount:=”/sbin/mount mount /mnt/cdrom”;
unmount:=”/sbin/umount umount /mnt/cdrom”

localhost/flash type:=program;fs:=/mnt/disk;
mount:=”/sbin/mount mount /mnt/disk”;
unmount:=”/sbin/umount umount /mnt/disk”

  • 5. Create .amd_mnt folder and soft link to link your cdrom and usb devices directories

# mkdir /.amd_mnt
# ln -s /host/localhost/cdrom /cdrom
# ln -s /host/localhost/disk /disk

Stumble Upon Toolbar Digg! diigo it

Related Posts by Categories



1 comments: to “ Using amd daemon to automount your external devices in FreeBSD


  •  

    Hello,
    My operating system is FreeBSD 6.1, I use the computer to the router. Unfortunately, in the manner described, I can not install flash automatically.
    Any ideas?