Skip to contentSkip to conversation

Find & remove orphan LEBs from UBIFS partition

DISCUSSION Konstantin Tokarev 2 participants 4 messages Jan 17, 2014 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

Hi all,

How can I find and remove LEBs which don't correspond to known files using internal API of UBIFS?

AFAIU, somethinng like this is done on recovery during mount, but in my case superblock is not dirty, so I'd like to force cleanup with custom mount option.

Signature · 2 lines
Regards,
Konstantin
#1 lore raw
Quoted 8 lines · Konstantin Tokarev

Hi all,

How can I find and remove LEBs which don't correspond to known files using internal API of UBIFS?

AFAIU, somethinng like this is done on recovery during mount, but in my case superblock is not dirty, so I'd like to force cleanup with custom mount option.

Are you trying to do something like 'secure deletion' ? Disclosing your intentions would help understanding what you need. I do not quite understand.

Do you want to fine all LEBs which do not contain anything useful like data or meta-data, and unmap them?

Signature · 2 lines
Best Regards,
Artem Bityutskiy
#2 lore raw

17.01.2014, 18:59, "Artem Bityutskiy" <[email protected]>:

Quoted 10 lines · Konstantin Tokarev
Quoted 8 lines

 Hi all,

 How can I find and remove LEBs which don't correspond to known files using internal API of UBIFS?
 AFAIU, somethinng like this is done on recovery during mount, but in my case superblock is not dirty, so I'd like to force cleanup with custom mount option.

Quoted 6 lines

Are you trying to do something like 'secure deletion' ? Disclosing your intentions would help understanding what you need. I do not quite understand.

Do you want to fine all LEBs which do not contain anything useful like data or meta-data, and unmap them?

Yes, exactly.

Signature · 2 lines
Regards,
Konstantin
#3 lore raw
Quoted 12 lines · Konstantin Tokarev

17.01.2014, 18:59, "Artem Bityutskiy" <[email protected]>:

Quoted 10 lines · Konstantin Tokarev
Quoted 8 lines

Hi all,

How can I find and remove LEBs which don't correspond to known files using internal API of UBIFS?
AFAIU, somethinng like this is done on recovery during mount, but in my case superblock is not dirty, so I'd like to force cleanup with custom mount option.

Quoted 8 lines
Quoted 6 lines

Are you trying to do something like 'secure deletion' ? Disclosing your intentions would help understanding what you need. I do not quite understand.

Do you want to fine all LEBs which do not contain anything useful like data or meta-data, and unmap them?

Yes, exactly.

Check 'fixup_free_space', it iterates over all useful ones, the rest can be unmapped.

Signature · 2 lines
Best Regards,
Artem Bityutskiy