Sujet : Re: How do you wipe a UBI filesystem?
De : invalid (at) *nospam* invalid.invalid (Grant Edwards)
Groupes : comp.arch.embeddedDate : 05. Feb 2025, 22:15:32
Autres entêtes
Organisation : PANIX Public Access Internet and UNIX, NYC
Message-ID : <vo0kdk$1k0$1@reader2.panix.com>
References : 1
User-Agent : slrn/1.0.3 (Linux)
On 2025-02-05, Grant Edwards <
invalid@invalid.invalid> wrote:
Pretend I've got an MTD partition attached as a UBI device.
>
That UBI device contains a couple differen UBI volumes.
>
In one of those volumes is a UBIFS filesystem that has a bunch of
files in it.
>
I've done some googling, but all of the answers are "use
ubiformat". That will wipe the whole device. I just want to
re-initialize one ubifs filesytem in one volume -- not the whole
ubi device.
>
How do I wipe that filesystem (set it back to empty). Do I need to
create an empty ubifs "image" file using mkfs.ubifs and then use
ubiupdatevol to write that image to the volume?
>
Isn't there a simpler way?
I've figured out two other ways to do it:
ubiupdatevol -t /dev/ubiX_Y
mount -t ubifs /dev/ubiX:volname /mnt/point
That works, but apparently that erases every block in the
volume. That's a lot of unecessary wear. Surely you can "empty" the
filesystem without erasing every block in the volume (when probably
90% of the blocks have never been written).
Another option:
ubirmvol /dev/ubiX -N volname
umimkvol /dev/ubiX -N volname -m
mount -t ubifs /dev/ubiX:volname /mnt/point
That too seems to work, but modifying the devices volume table/list
seems a bit risky compared to simply re-initializing the filesystem
inside an existing volume.