Mounting flash disks with custom umask

Duncan 1i5t5.duncan at cox.net
Wed Mar 2 19:44:18 GMT 2011


Craig Howard posted on Tue, 01 Mar 2011 20:13:17 -0800 as excerpted:

> I've got a flash disk that is automounting great.  However, it's a vfat
> filesystem and I've got ssh keys stored on it, which means ssh complains
> about the file permissions not being 0600.  If I mount the drive
> manually from the console with umask=077, then ssh is happy.
> 
> How can I make KDE mount either just this flash drive (ideally) or all
> flash drives with a umask of 077?
> 
> Alternatively, can someone describe how KDE mounts a disk?
> 
> I'm running KDE 4.5 on Maverick.

For automaounting, kde 4.5 still uses the deprecated hal, which is 
horrible to try to manually configure for such things as the *.fdi files 
are XML based so in addition to keeping straight the keys and values, you 
have to keep track of the XML formatting.  Additionally, as I said, hal is 
deprecated and replaced in kde 4.6 with udisks based automounting, so 
you'll finally figure it out and get it all working the way you want, only 
to have the next update screw it up since it uses a different system, with 
its own configuration.

That said, not a lot of people have much experience customizing the new kde 
4.6 udisks based system...

Possibly the simplest short-term fix, since you already know how to use 
mount at the CLI and aren't afraid to do so, would be to create an 
appropriate entry in /etc/fstab, setting the umask=077 mode there.  hal 
ignores devices with entries in /etc/fstab, considering them reserved, for 
the sysadmin to handle, so it won't automount them (at least by default).  
That'll mean you'll have to handle mounting manually, but as you already 
know how to do that and it solves your ssh problem...

Another alternative, of course, would be to copy the data on the USB that 
you need and then format it to a reasonable *ix based fs such as ext4 
(probably with journaling turned off for flash disks).  Of course that 
assumes you don't need to access the filesystem and content from MSWormOS 
or the like, but it'd allow proper permissions, etc, and in general should 
be more efficient than (V)FAT.

Of course, depending on the size, you could fdisk/gdisk the device as 
well, creating several partitions, one that could remain VFAT, another 
ext4 or whatever, if that better fits your usage needs, too.

Longer term, presumably with (k)ubuntu 11.4, which will presumably contain 
kde 4.6.x, you can look into udisk config and see how that works, but 
honestly, I'd not bother with hal at this point unless you /want/ to learn 
it now, only to have to relearn a new config style with udisks a few 
months from now.

Or, you could of course add the appropriate package repos and/or build 4.6 
yourself, and install that, then do the udisks thing, now, but of course 
that tends to have other issues since it's newer kde on an otherwise older 
platform, which tends to have bugs you won't get if you wait until it's 
actually shipped as part of a release, where everything's reasonably well 
tested together and should be close to the same age.

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman

___________________________________________________
This message is from the kde mailing list.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.




More information about the kde mailing list