Skip to contentSkip to conversation

ubi resize shrink volume

DISCUSSION Jaap de Jong 3 participants 6 messages Sep 15, 2017 – Sep 18, 2017 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

Hi All!

I've seen a several (old) posts regarding this subject and I was wondering what the status at this moment is.

Is there any implementation available that is able to shrink a ubi volume, so that it will move used blocks at the end to the front?

Thanks in advance!

Jaap de Jong

#1 lore raw
Quoted 7 lines · Jaap de Jong

Hi All!

I've seen a several (old) posts regarding this subject and I was wondering what the status at this moment is.

Is there any implementation available that is able to shrink a ubi volume, so that it will move used blocks at the end to the front?

Not sure if I got your use case, but you can do this in userspace.

If you're asking whether it is possible to shrink UBIFS, no, this is not possible.

Signature · 2 lines
Thanks,
//richard
#2 lore raw
Quoted 6 lines · Richard Weinberger
Quoted 5 lines · Jaap de Jong

Hi All!

I've seen a several (old) posts regarding this subject and I was wondering what the status at this moment is.

Quoted 7 lines
Quoted 2 lines

Is there any implementation available that is able to shrink a ubi volume, so that it will move used blocks at the end to the front?

Not sure if I got your use case, but you can do this in userspace.

If you're asking whether it is possible to shrink UBIFS, no, this is not possible.

Sorry for the confusion.
Yes, I want to shrink of a not-mounted UBIFS preferably in u-boot.
In the posts I read it should not be that hard to do, so I was wondering if anyone had taken the effort to implement this...

#3 lore raw

Am Montag, 18. September 2017, 08:34:34 CEST schrieb Jaap de Jong:

Quoted 2 lines · Richard Weinberger
Quoted 1 line

On Fri, Sep 15, 2017 at 8:34 AM, Jaap de Jong <[email protected]>

Quoted 12 lines · wrote:
Quoted 12 lines
Quoted 9 lines

Hi All!

I've seen a several (old) posts regarding this subject and I was wondering
what the status at this moment is.

Is there any implementation available that is able to shrink a ubi volume,
so that it will move used blocks at the end to the front?

Not sure if I got your use case, but you can do this in userspace.

Quoted 7 lines
Quoted 2 lines

If you're asking whether it is possible to shrink UBIFS, no, this is not possible.

Sorry for the confusion.
Yes, I want to shrink of a not-mounted UBIFS preferably in u-boot. In the posts I read it should not be that hard to do, so I was wondering if anyone had taken the effort to implement this...

Nope. So far nobody cared enough about this feature.
Please note that many other major filesystems alos don't support this. Such das XFS.

Thanks,
//richard

#4 lore raw
Quoted 16 lines · Richard Weinberger

Am Montag, 18. September 2017, 08:34:34 CEST schrieb Jaap de Jong:

Quoted 15 lines · Richard Weinberger
Quoted 14 lines · Jaap de Jong
Quoted 9 lines

Hi All!

I've seen a several (old) posts regarding this subject and I was wondering
what the status at this moment is.

Is there any implementation available that is able to shrink a ubi volume,
so that it will move used blocks at the end to the front?

Not sure if I got your use case, but you can do this in userspace.

If you're asking whether it is possible to shrink UBIFS, no, this is not possible.

Quoted 8 lines
Quoted 4 lines

Sorry for the confusion.
Yes, I want to shrink of a not-mounted UBIFS preferably in u-boot. In the posts I read it should not be that hard to do, so I was wondering if anyone had taken the effort to implement this...

Nope. So far nobody cared enough about this feature.
Please note that many other major filesystems alos don't support this. Such das XFS.

Well we do care!
Any thoughts to share? We could use some help...
My first impression was that the size of the partition was just a maximum number of PEBs to use for it, so lowering that value would just set a new limit and whatever PEBs were used for that specific partition was under control of the wear-levelling algorithms. But apparently it is more complicated.

#5 lore raw

Am Montag, 18. September 2017, 14:32:56 CEST schrieb Jaap de Jong:

Quoted 9 lines
Quoted 8 lines
Quoted 4 lines

Sorry for the confusion.
Yes, I want to shrink of a not-mounted UBIFS preferably in u-boot. In the posts I read it should not be that hard to do, so I was wondering if anyone had taken the effort to implement this...

Nope. So far nobody cared enough about this feature.
Please note that many other major filesystems alos don't support this. Such das XFS.

Quoted 8 lines

Well we do care!
Any thoughts to share? We could use some help...
My first impression was that the size of the partition was just a maximum number of PEBs to use for it,
so lowering that value would just set a new limit and whatever PEBs were used for that specific partition
was under control of the wear-levelling algorithms. But apparently it is more complicated.

Well, on UBI level it is easy.
On UBIFS you need to do more.

Think about the situation where you have N LEBs where M are in use by UBIFS and you reduce the volume size to X.
Assuming that all existing files can fit into X LEBs, therefore X >= M. Now you have to find all UBIFS data structures that have a reference to a LEB (> X) that is now outside of the new volume size. You have move data around patch all references.

Thanks,
//richard

Signature · 2 lines
sigma star gmbh - Eduard-Bodem-Gasse 6 - 6020 Innsbruck - Austria
ATU66964118 - FN 374287y