[systemd-devel] udev rule to mount ext4 with data=journal

MichaƂ Zegan webczat_200 at poczta.onet.pl
Wed Jun 14 07:31:55 UTC 2017


Hmm, why not to place such things in /etc/fstab?

W dniu 14.06.2017 o 09:30, Pascal K pisze:
> Hello everyone, 
> 
> I am new to this list and to udev (used mdev before). 
> 
> My goal: Mount a CFast card partioned with 2 partitions one FAT32 and
> one EXT4, the EXT4 I would like to mount with option "data=journal"
> 
> The Problem: from the console using mount the partition can be mounted
> with mount -o "data=journal" ... but not from my udev rule. My rule
> results in only the FAT32 partition being mounted. 
> 
> My Rule: 
> 
> KERNEL!="sd[a-z][0-9]", GOTO="media_by_label_auto_mount_end"  
> # Import FS infos  
> IMPORT{program}="/sbin/blkid -o udev -p %N"  
> 
> # Global mount options  
> ACTION=="add", ENV{mount_options}="relatime"  
> 
> # Filesystem-specific mount options  
> ACTION=="add", ENV{ID_FS_TYPE}=="vfat|ntfs",
> ENV{mount_options}="$env{mount_options},utf8,gid=100,umask=002"
> ACTION=="add", ENV{ID_FS_TYPE}=="ext4",
> ENV{mount_options}="$env{mount_options},data=journal"     
> 
> #Mount the Filesystems
> ACTION=="add", RUN+="/bin/mkdir -p /media/$env{ID_FS_LABEL}",
> RUN+="/bin/mount -o %E{mount_options} /dev/%k /media/$env{ID_FS_LABEL}" 
> 
> # Exit  
> LABEL="media_by_label_auto_mount_end"
> 
> Any help is highly appreciated, so far I can only mount with
> "data=ordered" since this seems to be the default option (for that the
> two lines matching "ENV{ID_FS_TYPE} are removed). 
> 
> Best regards
> Pascal
> 
> 
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 525 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20170614/c0bfd078/attachment-0001.sig>


More information about the systemd-devel mailing list