![Phytec L-1017e.A3 i.MX 8M Plus Manual Download Page 46](http://html1.mh-extra.com/html/phytec/l-1017e-a3-i-mx-8m-plus/l-1017e-a3-i-mx-8m-plus_manual_1554092046.webp)
L-1017e.A3 i.MX 8M Plus BSP Manual
•
•
target$ mmc extcsd read /dev/mmcblk2 | grep -A
5
WR_REL_SET
Write reliability setting register [WR_REL_SET]:
0x1f
user area: the device protects existing data
if
a power failure occurs during a
write o
peration
partition
1
: the device protects existing data
if
a power failure occurs during a
write
operation
partition
2
: the device protects existing data
if
a power failure occurs during a
write
operation
partition
3
: the device protects existing data
if
a power failure occurs during a
write
operation
partition
4
: the device protects existing data
if
a power failure occurs during a
write
operation
--
Device supports writing EXT_CSD_WR_REL_SET
Device supports the enhanced def. of reliable write
Otherwise, it can be enabled with the
mmc
tool:
target$ mmc --help
[...]
mmc write_reliability set <-y|-n> <partition> <device>
The second
Reliable Write
option is the configuration bit
Reliable Write Request parameter (bit 31)
in
command
CMD23
. It has been used in the kernel since
v3.0
by file systems, e.g.
ext4
for the journal and user space
applications such as
fdisk
for the partition table. In the
Linux
kernel source code, it is handled via flag
REQ_META
.
Conclusion:
ext4
file system with mount option
data=journal
should be safe against power cuts. The file system
check can recover the file system after a power failure, but data that was written just before the power cut may be
lost. In any case, a consistent state of the file system can be recovered. To ensure data consistency for the files of an
application, the system functions
fdatasync
or
fsync
should be used in the application.
Resizing ext4 Root Filesystem
When flashing the sdcard image to eMMC the ext4 root partition is not extended to the end of the eMMC. parted
can be
used to expand the root partition. The example works for any block device such as eMMC, SD card, or hard disk.
Get the current device size:
target$ parted /dev/mmcblk2 print
The output looks like:
Model: MMC Q2J55L (sd/mmc)