User has a (incremental) backup script using rsync
, to external device. This was erroring on an SSD he had. Turns out his device was formatted exFAT
. That means I need to detect this in the script, as I need to alter the options to rsync
(e.g., exFAT cannot handle symbolic links, no owner/group permissions, etc.).
User is running Linux Mint. I run Ubuntu. I can only assume/hope that a solution for my Ubuntu will work for his Mint.
I have looked at:
- How do I know if a partition is ext2, ext3, or ext4?
- How to tell what type of filesystem you're on?
- https://www.tecmint.com/find-linux-filesystem-type/
There are a variety of good suggestions there, but I do not see one which meets my requirements, which are:
- Must report (parseable)
ntfs
/exfat
explicitly, not just sayfuseblk
(which it will for bothexfat
&ntfs
, I need to distinguish). - Must not require sudo.
- Must be executable starting from a directory path on the file system (can assume it will be mounted), not just starting from a
/dev/...
.
From the suggestions I have tried:
fdisk -l
,parted -l
,file -sL
: require sudo and/or/dev/...
block devicemount
: requires/dev/...
, only reportsfuseblk
df -T
,stat -f -c %T
: accept directory, but report onlyfuseblk
lsblk -f
,blkid
: require/dev/...
block device
Is there a single, simple command which meets all these criteria? Or, lsblk
/blkid
seem to report exfat
/ntfs
correctly, if I need to pass them the /dev
how do I get that suitably from the directory path in script?