UDF can replace
ext4 to protect a partition with linux style
- The problem is that Windows 10 has changed from ignoring a second partition with the linux
ext4 file system to prompting the user the format it.
- Windows 10 does not prompt the user to format UDF, the Universal Disk Format.
UDF is described in the following links,
UDF provides a workaround that helps protect a partition with linux style
- links and
- individual permissions for files and directories.
It is even possible to use UDF in the
casper-rw partition of a persistent live drive, illustrated by the following screenshot of Lubuntu 16.04.1 LTS,
Install udftools if necessary
sudo apt-get install udftools
Create a partition table with
Erase confusing data with
sudo dd if=/dev/zero of=/dev/sdxn bs=1M count=1 # wipe first MiB
where x is the drive letter and n is the partition number. Check and double check that everything is correct before you press the Enter key to run the
dd command line!
Create UDF file system (risky!)
sudo mkudffs -b 512 --media-type=hd --lvid=my-label /dev/sdxn
where x is the drive letter and n is the partition number. Check and double check that everything is correct before you press the Enter key!
But it might be difficult to find good tools to repair UDF. Maybe Windows can fix some errors. So it is important to backup the content regularly, so that the content is not lost, if the file system gets damaged.
ext4in a file and loop mount to use it
If you must have ext4, you can put it in a file and loop mount to use it from linux. I don't think that Windows will bother to look in the file.
This method is the same as for a casper-rw file for persistence.
Create mount points (only once)
sudo mkdir -p /mnt/lp1
sudo mkdir -p /mnt/sd1
Mount the partition, where you intend to create the file.
sudo mount /dev/sdxn /mnt/sd1
where x is the drive letter and n is the partition number.
Create a file. In the FAT32 file system the maximum file size 4 GB, but in NTFS and UDF, the size is limited by the size of the partition.
The following command line will make an empty file with the size (bs * count, in this case 1MiB*8KiB) = 8GiB.
sudo dd if=/dev/zero of=/mnt/sd1/linux-fs bs=1M count=8K
Create an ext4 file system in the file
sudo mkfs.ext4 /mnt/sd1/linux-fs
In order to use the file in linux, loop mount it (you can provide a script or desktop file for the end users),
sudo mount -o loop /mnt/sd1/linux-fs /mnt/lp1
or maybe you would prefer something like this,
sudo mount -o defaults,users,loop /mnt/sd1/linux-fs /mnt/lp1
I assume that you already create a structure of directories, ownerships and permissions in the ext4 partition, and the same structure should work in this ext4 file too.
The content will be available via the mount point
/mnt/lp1, which means that you and an end user can read and write files and directories, just like an ext4 file system in a partition. But Windows does not prompt the user the format it.