* shrinking ubifs? @ 2010-01-14 22:15 Jon Ringle 2010-01-17 10:40 ` Artem Bityutskiy 0 siblings, 1 reply; 8+ messages in thread From: Jon Ringle @ 2010-01-14 22:15 UTC (permalink / raw) To: linux-mtd On ubi0, I have 3 volumes: ubi0_0 kernel (static volume) ubi0_1 squashfs (static volume) ubi0_2 ubifs (dynamic volume) When I create the volumes, the static volumes are created first and then the ubifs volume is created with whatever LEBs are left over. I am using the squashfs and ubifs in a aufs2 union fs. When I need to reflash either of the static volumes for an upgrade, and the new images don't fit the space available in the LEBs reserved in the corresponding static volume, I remove the ubifs volume to create space and then recreate the ubifs volume again with what is remaining. This is sub-optimal as this means that and data on the ubifs is now lost. Is there a way to shrink a UBIFS if there are unused LEBs in the UBIFS? Thanks Jon ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: shrinking ubifs? 2010-01-14 22:15 shrinking ubifs? Jon Ringle @ 2010-01-17 10:40 ` Artem Bityutskiy 2010-01-22 19:21 ` Jon Ringle 0 siblings, 1 reply; 8+ messages in thread From: Artem Bityutskiy @ 2010-01-17 10:40 UTC (permalink / raw) To: Jon Ringle; +Cc: linux-mtd On Thu, 2010-01-14 at 17:15 -0500, Jon Ringle wrote: > On ubi0, I have 3 volumes: > ubi0_0 kernel (static volume) > ubi0_1 squashfs (static volume) > ubi0_2 ubifs (dynamic volume) > > When I create the volumes, the static volumes are created first and > then the ubifs volume is created with whatever LEBs are left over. I > am using the squashfs and ubifs in a aufs2 union fs. When I need to > reflash either of the static volumes for an upgrade, and the new > images don't fit the space available in the LEBs reserved in the > corresponding static volume, I remove the ubifs volume to create space > and then recreate the ubifs volume again with what is remaining. This > is sub-optimal as this means that and data on the ubifs is now lost. Yes, this is not optimal. However, ubifs shrinking is not implemented. One could UBIFS ioctl to shring the FS, though, it should not be extremely difficult. It is about garbage-collecting the last LEBs to somewhere else, and amending the master block. > Is there a way to shrink a UBIFS if there are unused LEBs in the UBIFS? Not at the moment, this would need some development. -- Best Regards, Artem Bityutskiy (Артём Битюцкий) ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: shrinking ubifs? 2010-01-17 10:40 ` Artem Bityutskiy @ 2010-01-22 19:21 ` Jon Ringle 2010-01-27 16:25 ` Artem Bityutskiy 0 siblings, 1 reply; 8+ messages in thread From: Jon Ringle @ 2010-01-22 19:21 UTC (permalink / raw) To: dedekind1; +Cc: linux-mtd On Sun, Jan 17, 2010 at 5:40 AM, Artem Bityutskiy <dedekind1@gmail.com> wrote: > On Thu, 2010-01-14 at 17:15 -0500, Jon Ringle wrote: >> On ubi0, I have 3 volumes: >> ubi0_0 kernel (static volume) >> ubi0_1 squashfs (static volume) >> ubi0_2 ubifs (dynamic volume) >> >> When I create the volumes, the static volumes are created first and >> then the ubifs volume is created with whatever LEBs are left over. I >> am using the squashfs and ubifs in a aufs2 union fs. When I need to >> reflash either of the static volumes for an upgrade, and the new >> images don't fit the space available in the LEBs reserved in the >> corresponding static volume, I remove the ubifs volume to create space >> and then recreate the ubifs volume again with what is remaining. This >> is sub-optimal as this means that and data on the ubifs is now lost. > > Yes, this is not optimal. However, ubifs shrinking is not implemented. > One could UBIFS ioctl to shring the FS, though, it should not be > extremely difficult. It is about garbage-collecting the last LEBs to > somewhere else, and amending the master block. > >> Is there a way to shrink a UBIFS if there are unused LEBs in the UBIFS? > > Not at the moment, this would need some development. How about the opposite. If the static volumes became smaller freeing up some LEBs. Can the UBIFS be expanded to make use of the freed LEBs? Jon ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: shrinking ubifs? 2010-01-22 19:21 ` Jon Ringle @ 2010-01-27 16:25 ` Artem Bityutskiy 2010-01-27 16:34 ` Jon Ringle 0 siblings, 1 reply; 8+ messages in thread From: Artem Bityutskiy @ 2010-01-27 16:25 UTC (permalink / raw) To: Jon Ringle; +Cc: linux-mtd On Fri, 2010-01-22 at 14:21 -0500, Jon Ringle wrote: > On Sun, Jan 17, 2010 at 5:40 AM, Artem Bityutskiy <dedekind1@gmail.com> wrote: > > On Thu, 2010-01-14 at 17:15 -0500, Jon Ringle wrote: > >> On ubi0, I have 3 volumes: > >> ubi0_0 kernel (static volume) > >> ubi0_1 squashfs (static volume) > >> ubi0_2 ubifs (dynamic volume) > >> > >> When I create the volumes, the static volumes are created first and > >> then the ubifs volume is created with whatever LEBs are left over. I > >> am using the squashfs and ubifs in a aufs2 union fs. When I need to > >> reflash either of the static volumes for an upgrade, and the new > >> images don't fit the space available in the LEBs reserved in the > >> corresponding static volume, I remove the ubifs volume to create space > >> and then recreate the ubifs volume again with what is remaining. This > >> is sub-optimal as this means that and data on the ubifs is now lost. > > > > Yes, this is not optimal. However, ubifs shrinking is not implemented. > > One could UBIFS ioctl to shring the FS, though, it should not be > > extremely difficult. It is about garbage-collecting the last LEBs to > > somewhere else, and amending the master block. > > > >> Is there a way to shrink a UBIFS if there are unused LEBs in the UBIFS? > > > > Not at the moment, this would need some development. > > How about the opposite. If the static volumes became smaller freeing > up some LEBs. Can the UBIFS be expanded to make use of the freed LEBs? That works automatically. UBIFS expands automatically, but up to the size which you specified with the '-c' mkfs.ubifs option. http://www.linux-mtd.infradead.org/faq/ubifs.html#L_max_leb_cnt -- Best Regards, Artem Bityutskiy (Артём Битюцкий) ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: shrinking ubifs? 2010-01-27 16:25 ` Artem Bityutskiy @ 2010-01-27 16:34 ` Jon Ringle 2010-01-27 16:35 ` Artem Bityutskiy 0 siblings, 1 reply; 8+ messages in thread From: Jon Ringle @ 2010-01-27 16:34 UTC (permalink / raw) To: dedekind1; +Cc: linux-mtd On Wed, Jan 27, 2010 at 11:25 AM, Artem Bityutskiy <dedekind1@gmail.com> wrote: > On Fri, 2010-01-22 at 14:21 -0500, Jon Ringle wrote: >> How about the opposite. If the static volumes became smaller freeing >> up some LEBs. Can the UBIFS be expanded to make use of the freed LEBs? > > That works automatically. UBIFS expands automatically, but up to the > size which you specified with the '-c' mkfs.ubifs option. Can the same thing be done using ubimkvol? ubimkvol -m -N ubifs /dev/ubi0 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: shrinking ubifs? 2010-01-27 16:34 ` Jon Ringle @ 2010-01-27 16:35 ` Artem Bityutskiy 2010-02-01 4:01 ` Jon Ringle 0 siblings, 1 reply; 8+ messages in thread From: Artem Bityutskiy @ 2010-01-27 16:35 UTC (permalink / raw) To: Jon Ringle; +Cc: linux-mtd On Wed, 2010-01-27 at 11:34 -0500, Jon Ringle wrote: > On Wed, Jan 27, 2010 at 11:25 AM, Artem Bityutskiy <dedekind1@gmail.com> wrote: > > On Fri, 2010-01-22 at 14:21 -0500, Jon Ringle wrote: > >> How about the opposite. If the static volumes became smaller freeing > >> up some LEBs. Can the UBIFS be expanded to make use of the freed LEBs? > > > > That works automatically. UBIFS expands automatically, but up to the > > size which you specified with the '-c' mkfs.ubifs option. > > Can the same thing be done using ubimkvol? > ubimkvol -m -N ubifs /dev/ubi0 Sorry, I don't understand the question... -- Best Regards, Artem Bityutskiy (Артём Битюцкий) ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: shrinking ubifs? 2010-01-27 16:35 ` Artem Bityutskiy @ 2010-02-01 4:01 ` Jon Ringle 2010-02-01 4:30 ` Artem Bityutskiy 0 siblings, 1 reply; 8+ messages in thread From: Jon Ringle @ 2010-02-01 4:01 UTC (permalink / raw) To: dedekind1; +Cc: linux-mtd On Wed, Jan 27, 2010 at 11:35 AM, Artem Bityutskiy <dedekind1@gmail.com> wrote: > On Wed, 2010-01-27 at 11:34 -0500, Jon Ringle wrote: >> On Wed, Jan 27, 2010 at 11:25 AM, Artem Bityutskiy <dedekind1@gmail.com> wrote: >> > On Fri, 2010-01-22 at 14:21 -0500, Jon Ringle wrote: >> >> How about the opposite. If the static volumes became smaller freeing >> >> up some LEBs. Can the UBIFS be expanded to make use of the freed LEBs? >> > >> > That works automatically. UBIFS expands automatically, but up to the >> > size which you specified with the '-c' mkfs.ubifs option. >> >> Can the same thing be done using ubimkvol? >> ubimkvol -m -N ubifs /dev/ubi0 > > Sorry, I don't understand the question... I create my ubi volumes from an initramfs environment that is compiled against klibc. So far, I haven't been able to build mkfs.ubifs against klibc, so I create my ubifs volume by using ubimkvol and then mounting it as ubifs. Jon ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: shrinking ubifs? 2010-02-01 4:01 ` Jon Ringle @ 2010-02-01 4:30 ` Artem Bityutskiy 0 siblings, 0 replies; 8+ messages in thread From: Artem Bityutskiy @ 2010-02-01 4:30 UTC (permalink / raw) To: Jon Ringle; +Cc: linux-mtd On Sun, 2010-01-31 at 23:01 -0500, Jon Ringle wrote: > On Wed, Jan 27, 2010 at 11:35 AM, Artem Bityutskiy <dedekind1@gmail.com> wrote: > > On Wed, 2010-01-27 at 11:34 -0500, Jon Ringle wrote: > >> On Wed, Jan 27, 2010 at 11:25 AM, Artem Bityutskiy <dedekind1@gmail.com> wrote: > >> > On Fri, 2010-01-22 at 14:21 -0500, Jon Ringle wrote: > >> >> How about the opposite. If the static volumes became smaller freeing > >> >> up some LEBs. Can the UBIFS be expanded to make use of the freed LEBs? > >> > > >> > That works automatically. UBIFS expands automatically, but up to the > >> > size which you specified with the '-c' mkfs.ubifs option. > >> > >> Can the same thing be done using ubimkvol? > >> ubimkvol -m -N ubifs /dev/ubi0 > > > > Sorry, I don't understand the question... > > I create my ubi volumes from an initramfs environment that is compiled > against klibc. So far, I haven't been able to build mkfs.ubifs against > klibc, so I create my ubifs volume by using ubimkvol and then mounting > it as ubifs. I see. Well, that is about UBIFS, about the default formatting code, when UBIFS formats empty volume. That code should be hacked and the maximum FS size should be increased to the value you need. -- Best Regards, Artem Bityutskiy (Артём Битюцкий) ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2010-02-01 4:30 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-01-14 22:15 shrinking ubifs? Jon Ringle 2010-01-17 10:40 ` Artem Bityutskiy 2010-01-22 19:21 ` Jon Ringle 2010-01-27 16:25 ` Artem Bityutskiy 2010-01-27 16:34 ` Jon Ringle 2010-01-27 16:35 ` Artem Bityutskiy 2010-02-01 4:01 ` Jon Ringle 2010-02-01 4:30 ` Artem Bityutskiy
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox