https://github.com/merge/fatattr-label
Change a mounted FAT filesystem's label while being used
https://github.com/merge/fatattr-label
fat12 fat16 fat32 filesystem-api filesystem-utils ioctl linux linux-filesystem linux-kernel
Last synced: 27 days ago
JSON representation
Change a mounted FAT filesystem's label while being used
- Host: GitHub
- URL: https://github.com/merge/fatattr-label
- Owner: merge
- License: gpl-2.0
- Created: 2018-01-29T12:18:27.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-09-14T06:30:00.000Z (over 7 years ago)
- Last Synced: 2025-04-18T18:46:44.962Z (about 1 year ago)
- Topics: fat12, fat16, fat32, filesystem-api, filesystem-utils, ioctl, linux, linux-filesystem, linux-kernel
- Language: Shell
- Size: 25.4 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fatattr_label
Linux example tool to change a __mounted__ FAT filesystem partition's
label while it is being used. Want a USB Stick's name to be writable?
Then this might be for you.
### What's different from `fatlabel`?
[dosfstools](https://github.com/dosfstools/dosfstools)' `fatlabel` program writes
this label too, so what's the difference? Well, it only write the label when the
partition is __unmounted__ or while created. `fatattr_label` simply makes the label
writeable while the partition is being used.
### How to build
./autogen.sh
make
### How to use
Run `./fatattr_label` without parameters to see how to use it. This should
look like so
Change label:
fatattr_label [mountpoint] [label]
Show label:
fatattr_label [mountpoint]
An example for listing available filesystems and their
mountpoints would be:
df --output=source,fstype,target | grep -E 'msdos|fat'
`vfat`, `msdos` and `fat` types are supported. You can of course `make install`
it.
### Linux support
This tool is using the following ioctl interface that is *not* part of mainline
Linux as of now:
#define VFAT_IOCTL_SET_LABEL _IOW('r', 0x14, __u32)
FAT12, FAT16 and FAT32 are supported, on 32bit and 64bit systems. You need to
apply the provided patch and build your kernel. The patch is included in this
source repository and applies to the latest Linux release.
I promised not to publish this quite yet. If you are overly interested in
having support for this now, feel free to [contact me](mailto:martink@posteo.de).