D
Deleted member 48958
Guest
Automounting on FreeBSD was always like a black magic for me , I tried to make it work
on FreeBSD 10.* several times, but had no luck... sysutils/hal always used to work for me
(it is possible to mount using UTF-8 locale with HAL also), but now it is very outdated
and required by only few ports, and almost all of them may be rebuilt without HAL support,
so hal may be safely removed...
To configure autofs on FreeBSD 11 system, you need to uncomment
in /etc/auto_master.
Then you need to add
to /etc/rc.conf
Then reboot
But, with these settings, from handbook, you won't be able to read file names with UTF-8 symbols, like unicode, arabic letters, etc.
(Even if your system locale is a *.UTF-8 locale.)
Also, it won't be possible to edit files on mounted with autofs file systems as a regular user, as root only…
To fix these issues, you need to edit /etc/auto_master again:
-m=770 — changes file permissions on auto mounted with autofs USB flash drives and adds
read-write-execute permissions to the wheel group. So your user should be in the wheel group
(execute # pw groupmod wheel -m yourusername and re-login).
-L=en_US.UTF-8 — adds UTF-8 support, so all file names are readable now.
Then you need to unmount all autofs devices and restart automount and automountd (or just reboot).
Also it is possible to configure automounting of your MTP device, like android phone, or some mp3 player.
Install sysutils/fusefs-simple-mtpfs, execute
to /etc/auto_master, also you need to add
to your /boot/loader.conf, no others configurations needed, all work fine. To load fuse.ko kernel module without reboot, execute
When your device will be connected, it will appear in /media or /mtp,
so add these dirs to your file manager bookmarks, when you'll try to open a directory with your device name,
your device will be mounted, `autofs_enable="YES"` loads autofs.ko kernel module and starts 3 services:
automount, automountd and autounmountd, so it will be also auto unmounted "after a period of inactivity".
To unmount all file systems mounted with autofs, execute
For now I know the only one way how to enable unmounting of FS-es mounted with autofs when using your file manager, like pcmanfm, as a regular user, or via umount command without sudo, execute
After system start, your
My phone and mp3 player are auto mounted with autofs, after accessing its mount points.
Do not forget to remove "hald_enable" from /etc/rc.conf.
This is how I use it. May be someone also has any suggestions?
UPDATE:
Thanks to tobik@, found that NTFS also can be mounted by autofs,
but sysutils/fusefs-ntfs should be installed.
Also it is possible to mount ext2, ext3, ext4 file systems with autofs,
but ext2fs.ko kernel module should be loaded, so add ext2fs_load="YES"
to /boot/loader.conf, or add ext2fs to kld_list in /etc/rc.conf.
exFAT FS is also supported, just install sysutils/fusefs-exfat:
No additional actions required. NTFS, ext2fs(5) and exFAT are supported by "media" map in /etc/auto_master,
that was described at the beginning of this post.
Note:
"-m=770,-L=en_US.UTF-8" flags are tested to work with msdosfs only, so it may or may not work with NTFS, ext2fs(5) and exFAT.
on FreeBSD 10.* several times, but had no luck... sysutils/hal always used to work for me
(it is possible to mount using UTF-8 locale with HAL also), but now it is very outdated
and required by only few ports, and almost all of them may be rebuilt without HAL support,
so hal may be safely removed...
To configure autofs on FreeBSD 11 system, you need to uncomment
Code:
/media -media -nosuid
Then you need to add
Code:
autofs_enable="YES"
Then reboot
But, with these settings, from handbook, you won't be able to read file names with UTF-8 symbols, like unicode, arabic letters, etc.
(Even if your system locale is a *.UTF-8 locale.)
Also, it won't be possible to edit files on mounted with autofs file systems as a regular user, as root only…
To fix these issues, you need to edit /etc/auto_master again:
Code:
/media -media -nosuid,-m=770,-L=en_US.UTF-8
read-write-execute permissions to the wheel group. So your user should be in the wheel group
(execute # pw groupmod wheel -m yourusername and re-login).
-L=en_US.UTF-8 — adds UTF-8 support, so all file names are readable now.
Then you need to unmount all autofs devices and restart automount and automountd (or just reboot).
Also it is possible to configure automounting of your MTP device, like android phone, or some mp3 player.
Install sysutils/fusefs-simple-mtpfs, execute
# mkdir /mtp
and add
Code:
/mtp -simple-mtpfs -allow_other
Code:
fuse_load="YES"
# kldload fuse
.When your device will be connected, it will appear in /media or /mtp,
so add these dirs to your file manager bookmarks, when you'll try to open a directory with your device name,
your device will be mounted, `autofs_enable="YES"` loads autofs.ko kernel module and starts 3 services:
automount, automountd and autounmountd, so it will be also auto unmounted "after a period of inactivity".
To unmount all file systems mounted with autofs, execute
# automount -fu
For now I know the only one way how to enable unmounting of FS-es mounted with autofs when using your file manager, like pcmanfm, as a regular user, or via umount command without sudo, execute
# chown root:operator /sbin/umount
and then # chmod 4554 /sbin/umount
, also your user should be in "operator" group (execute # pw groupmod operator -m yourusername and re-login), use at your own risk.After system start, your
% mount
output should be similarMy phone and mp3 player are auto mounted with autofs, after accessing its mount points.
Do not forget to remove "hald_enable" from /etc/rc.conf.
This is how I use it. May be someone also has any suggestions?
UPDATE:
Thanks to tobik@, found that NTFS also can be mounted by autofs,
but sysutils/fusefs-ntfs should be installed.
Also it is possible to mount ext2, ext3, ext4 file systems with autofs,
but ext2fs.ko kernel module should be loaded, so add ext2fs_load="YES"
to /boot/loader.conf, or add ext2fs to kld_list in /etc/rc.conf.
exFAT FS is also supported, just install sysutils/fusefs-exfat:
# cd /usr/ports/sysutils/fusefs-exfat/ && make install clean
No additional actions required. NTFS, ext2fs(5) and exFAT are supported by "media" map in /etc/auto_master,
that was described at the beginning of this post.
Note:
"-m=770,-L=en_US.UTF-8" flags are tested to work with msdosfs only, so it may or may not work with NTFS, ext2fs(5) and exFAT.
Last edited by a moderator: