All of lore.kernel.org
 help / color / mirror / Atom feed
* I have an idea to allow shrinkage of a Reiser4 volume.
@ 2017-03-19 10:39 doiggl
  2017-03-20  1:33 ` Daniel Horne
  0 siblings, 1 reply; 2+ messages in thread
From: doiggl @ 2017-03-19 10:39 UTC (permalink / raw)
  To: Reiserfs development mailing list

Hello,

I have an idea to allow shrinkage of a Reiser4 volume.
And I ask help in writing a command line utility for it.

my idea's,example:
- ensure debugfs.reiser4 installed. [debugfs.reiser4] reiser4progs
- check unmounted volume is a Reiser4 formatted partition.
- find the last 'used block' on a unmounted Reiser4 partition [1]
- check block number is greater than >0 and less than < the maximum block
of reiser4 volume size.
- print details of new volume, space unused.
- ask to perform shrink reiser4 volume to nnn.
- if 'y' do volume shrink.
- verify volume details and print new details used/free,


Reason I ask:
Allow shinkage of reiser4 volume to last 'used block' + [n blocks free]
Since no reiser4 blocks moved, no reiser4 metadata changes needed.
Just volume size changes [no blocks moved].
Is this idea logical to ask ?
Thanks
--Glenn

[1] find the last 'used block'.

# debugfs.reiser4 /dev/sdb2  --print-tree | grep -i "NODE"   | grep -v
"NPTR"| cut -d" " -f2  | sed 's/(//'  | sed 's/)//'  |sort -n |tail -1
Format release: 4.0.1
Copyright (C) 2001-2005 by Hans Reiser, licensing governed by
reiser4progs/COPYING. 

2938354

other info:

Total blocks used:
#################
# debugfs.reiser4 /dev/sdb2  --print-tree | grep -i "NODE"   | grep -v
"NPTR"| cut -d" " -f2  | sed 's/(//'  | sed 's/)//'  |sort -n | wc -l
debugfs.reiser4 1.1.0
Format release: 4.0.1
Copyright (C) 2001-2005 by Hans Reiser, licensing governed by
reiser4progs/COPYING. 

833657

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: I have an idea to allow shrinkage of a Reiser4 volume.
  2017-03-19 10:39 I have an idea to allow shrinkage of a Reiser4 volume doiggl
@ 2017-03-20  1:33 ` Daniel Horne
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Horne @ 2017-03-20  1:33 UTC (permalink / raw)
  To: Reiserfs mailing list

Some metadata changes would still be needed in this case, I think: For
one thing, you'd need to remove some of the bitmap blocks which are
used to track space usage. And the size of the volume is probably
stored in the superblock. That'd have to be changed.

I'm not sure this approach would work too well though - it could only
work in cases where there were no unused blocks past the length you're
trimming at - the allocators try to spread data out over the volume,
which would mean you probably couldn't shrink a real r4 volume much
using this method without data loss.

A proper resize tool would probably pack all the data to the front of
the volume, change the volume metadata, and then unpack it -
Essentially a special case of the planned "repacker" tool, I think.

--
DH

On 19 March 2017 at 10:39,  <doiggl@velocitynet.com.au> wrote:
> Hello,
>
> I have an idea to allow shrinkage of a Reiser4 volume.
> And I ask help in writing a command line utility for it.
>
> my idea's,example:
> - ensure debugfs.reiser4 installed. [debugfs.reiser4] reiser4progs
> - check unmounted volume is a Reiser4 formatted partition.
> - find the last 'used block' on a unmounted Reiser4 partition [1]
> - check block number is greater than >0 and less than < the maximum block
> of reiser4 volume size.
> - print details of new volume, space unused.
> - ask to perform shrink reiser4 volume to nnn.
> - if 'y' do volume shrink.
> - verify volume details and print new details used/free,
>
>
> Reason I ask:
> Allow shinkage of reiser4 volume to last 'used block' + [n blocks free]
> Since no reiser4 blocks moved, no reiser4 metadata changes needed.
> Just volume size changes [no blocks moved].
> Is this idea logical to ask ?
> Thanks
> --Glenn
>
> [1] find the last 'used block'.
>
> # debugfs.reiser4 /dev/sdb2  --print-tree | grep -i "NODE"   | grep -v
> "NPTR"| cut -d" " -f2  | sed 's/(//'  | sed 's/)//'  |sort -n |tail -1
> Format release: 4.0.1
> Copyright (C) 2001-2005 by Hans Reiser, licensing governed by
> reiser4progs/COPYING.
>
> 2938354
>
> other info:
>
> Total blocks used:
> #################
> # debugfs.reiser4 /dev/sdb2  --print-tree | grep -i "NODE"   | grep -v
> "NPTR"| cut -d" " -f2  | sed 's/(//'  | sed 's/)//'  |sort -n | wc -l
> debugfs.reiser4 1.1.0
> Format release: 4.0.1
> Copyright (C) 2001-2005 by Hans Reiser, licensing governed by
> reiser4progs/COPYING.
>
> 833657
> --
> To unsubscribe from this list: send the line "unsubscribe reiserfs-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-20  1:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-19 10:39 I have an idea to allow shrinkage of a Reiser4 volume doiggl
2017-03-20  1:33 ` Daniel Horne

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.