You are not logged in.

#1 2014-06-09 18:28:41

Andy_Crowd
Member
From: 延雪平縣 Sweden
Registered: 2013-12-28
Posts: 119

[SOLVED]change Default mount options (VFAT / FAT / ISO)

Hi!

Now my guide about mount is in the Arch Linux wiki: Change default mount options in File Systems.category.

In kernel default config for mount is (in this case for FAT):

$zcat /proc/config.gz | grep -i fat
# DOS/FAT/NT Filesystems
CONFIG_FAT_FS=m
CONFIG_VFAT_FS=m
CONFIG_FAT_DEFAULT_CODEPAGE=437
CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"

But if create the /sbin/mount.vfat then when mount is used it will run the script for mount of e.g. VFAT :

$cat /sbin/mount.vfat
#!/bin/bash
#mount VFAT as rw for all users
/sbin/mount -i -t vfat -oumask=0000,iocharset=utf8 "$@"

It doesn't necessary to run mount.vfat, enough just to use mount as usually for mounting and settings, in this case for VFAT, will apply automatically.

As I understood mount.X scripts, where X is a name of the partition type, can be used to alter default mount options for almost any supported partition types by mount.

!!! More about file systems from >>>wikipedia <<< and documentation on >>>kernel.org<<<

This should show supported partitions by your kernel:

#Shows supported partitions 
zcat /proc/config.gz | grep  "_FS=" 
#Shows total number of supported partition types
zcat /proc/config.gz | grep  "_FS=" | wc -l

Here is for a more clean output:

$zcat /proc/config.gz | grep  "_FS=" | sed "s/^CONFIG_//m" | sed "s/.$//m" | sed "s/_FS=//m"
SCSI_PROC
USB_F
LUSTRE
EXT4
REISERFS
JFS
XFS
GFS2
OCFS2
BTRFS
NILFS2
AUTOFS4
FUSE
ISO9660
UDF
FAT
MSDOS
VFAT
NTFS
PROC
CONFIGFS
AFFS
ECRYPT
HFS
HFSPLUS
BEFS
JFFS2
UBIFS
MINIX
OMFS
UFS
EXOFS
F2FS
F2FS_STAT
F2FS_CHECK
EFIVAR
NFS
CEPH
NCP
CODA
AFS
9P
DEBUG

One more example for mounting of ISO images:

$cat /sbin/mount.iso9660
#!/bin/bash
mount -i -t iso9660 "$@"
#mount -oloop,ro,relatime,utf8 -i -t iso9660 "$@"

#mount -oloop,ro,relatime,utf8 -i -t iso9660 "$@"
#it works by adding "utf8" but getting errors when using "iso8859" for iocharset
#"utf8" is the same as "iocharset=utf8", you can use one of them

# or you can even use "fuseiso" then just comment "mount" and uncomment:
# fuseiso "$@"
# "mount" will run this script for mounting of "iso9660" images

# NOTE! To use "mount" you still need root rights (su/sudo) even if "fuseiso" is used in the script

Here is defaults of my kernel for ISO mount

$zcat /proc/config.gz | grep -i "_iso" | grep -vi "CONFIG_MEMORY_ISOLATION" | grep -iv "CONFIG_USB_SL811_HCD_ISO"
CONFIG_ISO9660_FS=m
CONFIG_NLS_ISO8859_8=m
CONFIG_NLS_ISO8859_1=m
CONFIG_NLS_ISO8859_2=m
CONFIG_NLS_ISO8859_3=m
CONFIG_NLS_ISO8859_4=m
CONFIG_NLS_ISO8859_5=m
CONFIG_NLS_ISO8859_6=m
CONFIG_NLS_ISO8859_7=m
CONFIG_NLS_ISO8859_9=m
CONFIG_NLS_ISO8859_13=m
CONFIG_NLS_ISO8859_14=m
CONFIG_NLS_ISO8859_15=m

Last edited by Andy_Crowd (2014-06-20 20:44:00)


Help to make Arora bug free!!
日不落 | Year 2081 | 笑傲江湖 | One more a really good book in my collection the Drystoll.

Offline

#2 2014-06-09 18:32:57

clfarron4
Member
From: London, UK
Registered: 2013-06-28
Posts: 2,163
Website

Re: [SOLVED]change Default mount options (VFAT / FAT / ISO)

Since all "executables" are in /usr/bin, I would place your script there (do you remember the bin,sbin,usr/sbin move to /usr/bin?).

As for VFAT vs FAT, I have no idea.


Claire is fine.
Problems? I have dysgraphia, so clear and concise please.
My public GPG key for package signing
My x86_64 package repository

Offline

#3 2014-06-09 18:41:24

Andy_Crowd
Member
From: 延雪平縣 Sweden
Registered: 2013-12-28
Posts: 119

Re: [SOLVED]change Default mount options (VFAT / FAT / ISO)

As I know type VFAT is using for all types of FAT partition by mount. And I know that /sbin is link to the /usr/bin but still it might be not for all Linux, I'm just using a description that I found in one of the forums and thought that it would be nice to have in wiki because I found nothing about it there or just missed in the search result.

Last edited by Andy_Crowd (2014-06-14 11:39:19)


Help to make Arora bug free!!
日不落 | Year 2081 | 笑傲江湖 | One more a really good book in my collection the Drystoll.

Offline

Board footer

Powered by FluxBB