[colug-432] Fwd: Fstab Questions

Chris Punches punches.chris at gmail.com
Fri Mar 8 19:10:42 EST 2019


Yes, really.  It's in the mount manpage.  Sorry to RTFM but if you do
you'll find a reference to the kernel source directory for documentation on
filesystem options:

*Documentation/filesystems.*

*In his case, section 3 of:*

*https://www.kernel.org/doc/Documentation/filesystems/ext4.txt
<https://www.kernel.org/doc/Documentation/filesystems/ext4.txt>*

There are commonalities between the filesystem options but they're
ultimately defined in each filesystem's drivers
<https://github.com/torvalds/linux/tree/master/fs/ext4> and don't
necessarily overlap (and often don't for low level tweak options).

If you are interested in playing with alternative filesystems like in the
case of removable media so you dont have to worry about uid mismatch
between different systems using the media, the FAT, VFAT, and EXFAT (as
well as NTFS/NTFS-3G if you dare) filesystems all support a umask option
for portability.  That option is one that is filesystem-specific.

Example for VFAT in the same documentation directory:
https://www.kernel.org/doc/Documentation/filesystems/vfat.txt

I went ahead and checked to see if there might have been an undocumented
uid or gid masking option in the ext4 filesystem source code and found
these but it looks like that one was  omitted.  That could be by design.

*.../kernel-src/current/fs/ext4/super.c:*
1446 static const match_table_t tokens = {
1447         {Opt_bsd_df, "bsddf"},
1448         {Opt_minix_df, "minixdf"},
1449         {Opt_grpid, "grpid"},
1450         {Opt_grpid, "bsdgroups"},
1451         {Opt_nogrpid, "nogrpid"},
1452         {Opt_nogrpid, "sysvgroups"},
1453         {Opt_resgid, "resgid=%u"},
1454         {Opt_resuid, "resuid=%u"},
1455         {Opt_sb, "sb=%u"},
1456         {Opt_err_cont, "errors=continue"},
1457         {Opt_err_panic, "errors=panic"},
1458         {Opt_err_ro, "errors=remount-ro"},
1459         {Opt_nouid32, "nouid32"},
1460         {Opt_debug, "debug"},
1461         {Opt_removed, "oldalloc"},
1462         {Opt_removed, "orlov"},
1463         {Opt_user_xattr, "user_xattr"},
1464         {Opt_nouser_xattr, "nouser_xattr"},
1465         {Opt_acl, "acl"},
1466         {Opt_noacl, "noacl"},
1467         {Opt_noload, "norecovery"},
1468         {Opt_noload, "noload"},
1469         {Opt_removed, "nobh"},
1470         {Opt_removed, "bh"},
1471         {Opt_commit, "commit=%u"},
1472         {Opt_min_batch_time, "min_batch_time=%u"},
1473         {Opt_max_batch_time, "max_batch_time=%u"},
1474         {Opt_journal_dev, "journal_dev=%u"},
1475         {Opt_journal_path, "journal_path=%s"},
1476         {Opt_journal_checksum, "journal_checksum"},
1477         {Opt_nojournal_checksum, "nojournal_checksum"},
1478         {Opt_journal_async_commit, "journal_async_commit"},
1479         {Opt_abort, "abort"},
1480         {Opt_data_journal, "data=journal"},
1481         {Opt_data_ordered, "data=ordered"},
1482         {Opt_data_writeback, "data=writeback"},
1483         {Opt_data_err_abort, "data_err=abort"},
1484         {Opt_data_err_ignore, "data_err=ignore"},
1485         {Opt_offusrjquota, "usrjquota="},
1486         {Opt_usrjquota, "usrjquota=%s"},
1487         {Opt_offgrpjquota, "grpjquota="},
1488         {Opt_grpjquota, "grpjquota=%s"},
1489         {Opt_jqfmt_vfsold, "jqfmt=vfsold"},
1490         {Opt_jqfmt_vfsv0, "jqfmt=vfsv0"},
1491         {Opt_jqfmt_vfsv1, "jqfmt=vfsv1"},
1492         {Opt_grpquota, "grpquota"},
1493         {Opt_noquota, "noquota"},
1494         {Opt_quota, "quota"},
1495         {Opt_usrquota, "usrquota"},
1496         {Opt_prjquota, "prjquota"},
1497         {Opt_barrier, "barrier=%u"},
1498         {Opt_barrier, "barrier"},
1499         {Opt_nobarrier, "nobarrier"},
1500         {Opt_i_version, "i_version"},
1501         {Opt_dax, "dax"},
1502         {Opt_stripe, "stripe=%u"},
1503         {Opt_delalloc, "delalloc"},
1504         {Opt_warn_on_error, "warn_on_error"},
1505         {Opt_nowarn_on_error, "nowarn_on_error"},
1506         {Opt_lazytime, "lazytime"},
1507         {Opt_nolazytime, "nolazytime"},
1508         {Opt_debug_want_extra_isize, "debug_want_extra_isize=%u"},
1509         {Opt_nodelalloc, "nodelalloc"},
1510         {Opt_removed, "mblk_io_submit"},
1511         {Opt_removed, "nomblk_io_submit"},
1512         {Opt_block_validity, "block_validity"},
1513         {Opt_noblock_validity, "noblock_validity"},
1514         {Opt_inode_readahead_blks, "inode_readahead_blks=%u"},
1515         {Opt_journal_ioprio, "journal_ioprio=%u"},
1516         {Opt_auto_da_alloc, "auto_da_alloc=%u"},
1517         {Opt_auto_da_alloc, "auto_da_alloc"},
1518         {Opt_noauto_da_alloc, "noauto_da_alloc"},
1519         {Opt_dioread_nolock, "dioread_nolock"},
1520         {Opt_dioread_lock, "dioread_lock"},
1521         {Opt_discard, "discard"},
1522         {Opt_nodiscard, "nodiscard"},
1523         {Opt_init_itable, "init_itable=%u"},
1524         {Opt_init_itable, "init_itable"},
1525         {Opt_noinit_itable, "noinit_itable"},
1526         {Opt_max_dir_size_kb, "max_dir_size_kb=%u"},
1527         {Opt_test_dummy_encryption, "test_dummy_encryption"},
1528         {Opt_nombcache, "nombcache"},
1529         {Opt_nombcache, "no_mbcache"},  /* for backward compatibility
*/
1530         {Opt_removed, "check=none"},    /* mount option from ext2/3 */
1531         {Opt_removed, "nocheck"},       /* mount option from ext2/3 */
1532         {Opt_removed, "reservation"},   /* mount option from ext2/3 */
1533         {Opt_removed, "noreservation"}, /* mount option from ext2/3 */
1534         {Opt_removed, "journal=%u"},    /* mount option from ext2/3 */
1535         {Opt_err, NULL},
1536 };

I'll also say that I agree with Rick's suggestion to just use filesystem
permissions on the mounted filesystem itself if you're stuck on ext4, but,
other people might have other use cases and need to know how to do this.

I feel like the omission of a umask option is a bug but the filesystem
designers disagree.

There is also bindfs which can remount with a uid masking option for
filesystems that do not support it but it's a workaround, it's a userspace
filesystem driver so there -will- be performance impacts:
https://help.ubuntu.com/community/Bindfs-SharedDirectoryLocalUsers


-C

On Wed, Mar 6, 2019 at 8:31 PM Rick Hornsby <richardjhornsby at gmail.com>
wrote:

>
> On Mar 6, 2019, at 12:23, Chris Punches <punches.chris at gmail.com> wrote:
>
> Perms options are file system specific you'll need to research the options
> for your file system type
>
>
> Not really? Unless you’re diving into selinux or ACLs. Maybe there’s a
> filesystem out there that doesn’t support the user/group ownership and
> octal user/group/other permissions of typical *nix, but that would mean a
> huge mess of stuff would be different, not just those two things. In any
> case, I don’t think that would apply here.
> ...
> _______________________________________________
> colug-432 mailing list
> colug-432 at colug.net
> http://lists.colug.net/mailman/listinfo/colug-432
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.colug.net/pipermail/colug-432/attachments/20190308/72688e3e/attachment.html 


More information about the colug-432 mailing list