ext4 and flash drives

Keith keith at caramail.com
Thu Jan 5 20:36:06 UTC 2023


On 1/5/23 12:45 PM, Ian Bruntlett wrote:
> Hi,
> 
> I use ext4 on USB flash drives. In order to make the full extent of the 
> drive available to ordinary users, I have to use this tune2fs command to 
> set the "reserved blocks count":-
> # tune2fs -r 0 /dev/sdetc
> 
> Where the device for a particular filesystem can be found with the df 
> command.
> 
> I am wondering - what is the command to find the current setting of the 
> "reserved blocks count"?

tune2fs -l <device>
will list the current settings for an ext[234] filesystem on <device>.

> 
> Also: whilst writing this email, I discovered that the reserved blocks 
> count can be specified as a percentage by using the option -m with tune2fs
> 
> I haven't noticed gparted or gnome-disks supporting this kind of thing. 
> Have I overlooked something?

No, but if you edit /etc/mke2fs.conf and put "reserved_ratio = 0" under 
the "defaults" section, then whenever a disk utility like gnome-disks 
calls mkfs[.extx] directly under the hood, or through a library function 
that honors the conf file, it will create a new ext[234] filesystem 
without reserved blocks. Gnome-disks will do it, but I don't know if 
gparted does since I never use it.

-- 
Keith







More information about the ubuntu-users mailing list