Skip to contentSkip to conversation

shrink reiserfs

DISCUSSION Jake Hawkes 4 participants 11 messages Jan 23, 2005 – Jan 30, 2005 3 messages not in the archive

lore
Share & tools
lore
#0 lore raw

Hi.

resize_reiserfs says that there are already too many allocated blocks.

This isn't the exact error message, but I hope you get the idea.

jake@jacobh jake $ df -h
Filesystem Size Used Avail Use% Mounted on

/dev/hda4              38G  7.1G   31G  20% /
/dev/hda2              16G   15G  1.6G  91% /mnt/xp

none 506M 0 506M 0% /dev/shm

so how can this be possible if it is only 20% used?

#1 lore raw

Hello,

Quoted 3 lines · Jake Hawkes

Hi.

resize_reiserfs says that there are already too many allocated blocks.

which resize_reiserfs command produces the error message?

Quoted 10 lines

This isn't the exact error message, but I hope you get the idea.

jake@jacobh jake $ df -h
Filesystem Size Used Avail Use% Mounted on

/dev/hda4              38G  7.1G   31G  20% /
/dev/hda2              16G   15G  1.6G  91% /mnt/xp

none 506M 0 506M 0% /dev/shm

so how can this be possible if it is only 20% used?

the shrinker can't make the fs less than 7.1G in size.

Signature · 1 line
Alex.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw
Quoted 8 lines · Jake Hawkes
Quoted 7 lines · Alex Zarochentsev

Hello,

Quoted 3 lines · Jake Hawkes

Hi.

resize_reiserfs says that there are already too many allocated blocks.

Quoted 7 lines
Quoted 1 line

which resize_reiserfs command produces the error message?

resize_reiserfs -v -s -1G /dev/hda4

and when that failed, I tried

resize_reiserfs -v -s -1M /dev/hda4

and it failed too?

which reiserfsprogs version are you using? It is possible that this bug is fixed already in the latest release of reiserfsprogs (3.6.19).

Quoted 17 lines
Quoted 11 lines
Quoted 9 lines

jake@jacobh jake $ df -h
Filesystem Size Used Avail Use% Mounted on

/dev/hda4              38G  7.1G   31G  20% /
/dev/hda2              16G   15G  1.6G  91% /mnt/xp

none 506M 0 506M 0% /dev/shm

so how can this be possible if it is only 20% used?

the shrinker can't make the fs less than 7.1G in size.

I had to read that af ew times before I realised you were talking about my installation and not a general reiserfs issue :D

given the command above then, what can I do?

Signature · 1 line
Alex.
#4 lore raw
Quoted 15 lines · Jake Hawkes
Quoted 14 lines
Quoted 8 lines · Alex Zarochentsev

Hello,

Quoted 3 lines · Jake Hawkes

Hi.

resize_reiserfs says that there are already too many allocated blocks.

which resize_reiserfs command produces the error message?

resize_reiserfs -v -s -1G /dev/hda4

and when that failed, I tried

Quoted 7 lines
Quoted 1 line

resize_reiserfs -v -s -1M /dev/hda4

and it failed too?

which reiserfsprogs version are you using? It is possible that this bug is fixed already in the latest release of reiserfsprogs (3.6.19).

Just a side-note. After upgrading to latest reiserfsprogs, then do a fsck before attempting to resize the filesystem.

~S

Quoted 17 lines
Quoted 17 lines
Quoted 11 lines
Quoted 9 lines

jake@jacobh jake $ df -h
Filesystem Size Used Avail Use% Mounted on

/dev/hda4              38G  7.1G   31G  20% /
/dev/hda2              16G   15G  1.6G  91% /mnt/xp

none 506M 0 506M 0% /dev/shm

so how can this be possible if it is only 20% used?

the shrinker can't make the fs less than 7.1G in size.

I had to read that af ew times before I realised you were talking about my installation and not a general reiserfs issue :D

given the command above then, what can I do?

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw
Quoted 33 lines · Jake Hawkes
Quoted 12 lines · Alex Zarochentsev
Quoted 11 lines · Jake Hawkes
Quoted 6 lines · Alex Zarochentsev

Hello,

Quoted 3 lines · Jake Hawkes

Hi.

resize_reiserfs says that there are already too many allocated

blocks.

Quoted 2 lines

which resize_reiserfs command produces the error message?

Quoted 7 lines
Quoted 5 lines

resize_reiserfs -v -s -1G /dev/hda4

and when that failed, I tried

resize_reiserfs -v -s -1M /dev/hda4

and it failed too?

yep

Quoted 4 lines

which reiserfsprogs version are you using? It is possible that this bug is fixed already in the latest release of reiserfsprogs (3.6.19).

jacobh log # esearch reiserfsprogs
[ Results for search key : reiserfsprogs ]
[ Applications found : 1 ]

Quoted 6 lines

* sys-fs/reiserfsprogs
Latest version available: 3.6.19
Latest version installed: 3.6.18
Size of downloaded files: [no/bad digest]
Homepage: http://www.namesys.com/
Description: Reiserfs Utilities

yes, it see, new reiserfsprogs has this bug (v3.0.9 does not :-/) .

As a workaround I suggest don't use relative values in current resizer. please try resize_reiserfs -v -s 21G /dev/hda4 .

Quoted 1 line

I'm using 3.6.18

Thanks for the report.

Signature · 1 line
Alex.
#7 lore raw
Quoted 34 lines · Alex Zarochentcev
Quoted 33 lines · Jake Hawkes
Quoted 12 lines · Alex Zarochentsev
Quoted 11 lines · Jake Hawkes
Quoted 6 lines · Alex Zarochentsev

Hello,

Quoted 3 lines · Jake Hawkes

Hi.

resize_reiserfs says that there are already too many allocated

blocks.

Quoted 2 lines

which resize_reiserfs command produces the error message?

Quoted 7 lines
Quoted 5 lines

resize_reiserfs -v -s -1G /dev/hda4

and when that failed, I tried

resize_reiserfs -v -s -1M /dev/hda4

and it failed too?

yep

Quoted 4 lines

which reiserfsprogs version are you using? It is possible that this bug is fixed already in the latest release of reiserfsprogs (3.6.19).

jacobh log # esearch reiserfsprogs
[ Results for search key : reiserfsprogs ]
[ Applications found : 1 ]

Quoted 8 lines
Quoted 6 lines

* sys-fs/reiserfsprogs
Latest version available: 3.6.19
Latest version installed: 3.6.18
Size of downloaded files: [no/bad digest]
Homepage: http://www.namesys.com/
Description: Reiserfs Utilities

yes, it see, new reiserfsprogs has this bug (v3.0.9 does not :-/) .

oops, i can't reproduce the bug anymore, seems i forgot '-' in "-s -1G" option in my first resize attempt. 3.6.19, 3.6.18 work well for me.

Quoted 9 lines

As a workaround I suggest don't use relative values in current resizer. please try resize_reiserfs -v -s 21G /dev/hda4 .

Quoted 1 line

I'm using 3.6.18

Thanks for the report.

Signature · 1 line
Alex.
Signature · 1 line
Alex.
#8 lore raw
Quoted 3 lines · Alex Zarochentsev

oops, i can't reproduce the bug anymore, seems i forgot '-' in "-s -1G" option in my first resize attempt. 3.6.19, 3.6.18 work well for me.

well - I upgraded and set an exact size to reize to, and it worked fine, so I can only assume that I messed up the command line args somehow.

My next question, can I grow a reiserfs filesystem backwards in the partition?

I have resized my filesystem, and deleted and re-created my partition accordingly.

Disk /dev/hda: 60.0 GB, 60011642880 bytes
255 heads, 63 sectors/track, 7296 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1               1           6       48163+   6  FAT16
/dev/hda2   *           7        2074    16611210    7  HPFS/NTFS
/dev/hda3            2437        2439       24097+  83  Linux [boot-ext3]
/dev/hda4            2440        4398    15735667+  83  Linux [ reiser ]

I'd like to delete partition 3 & 4, and create a new partition from 2437 to 4398, and then grow the reiserfs filesystem to fill it, only, its going to be lower/before the filesystem.

I thought there might be a vagur chance the reiser being advanced enough might be able to handle this.

If not, then I'm kinda stuck with a spotty partition table and I'g going to have pull the drive and start hauling around disk images and stuff, which I'd like to avoid.

Here's hoping.

-Jake

p.s. thanks heaps for your responses mate =)

#9 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jake Hawkes wrote:
[...]
| My next question, can I grow a reiserfs filesystem backwards in the | partition?

Don't think so, but I wouldn't know.

[...]

| If not, then I'm kinda stuck with a spotty partition table and I'g going
| to have pull the drive and start hauling around disk images and stuff,
| which I'd like to avoid.

How full is the fs? If less than half-full, you could try this (for example):

| free space | reiserfs partition |

shrink fs and partition to less than half:

| free space | reiser | free spac |

make new partition to the "right" of old partition:

| free space | reiser | new parti |

dd from reiserfs to new partition:

| free space | reiser | reiserfs |

delete old reiserfs partition:

| free space | reiserfs |

make new partition

| new partition | reiserfs |

dd old reiserfs to new partition

| reiserfs partition | reiserfs |

delete old partition, expand new partition and fs

| reiserfs partition |

This could clearly be much easier to follow, but it illustrates two points:

- - If your disk is not full, you can almost always get from your current partition scheme to any new one without completely backing up / reformatting (no pulling the drive, no installing a new backup drive, etc.)

- - Sometimes, the workaround for a missing feature literally takes more time than writing the feature or buying new hardware.

Disclaimer: this may not be such a time, and my comments may just stem from my wish that reiser4 had a repacker and online resizer/shrinker/grow-forward/backward feature.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iQIVAwUBQfSZyHgHNmZLgCUhAQJRSA/+P2f5U/BNhaXjm3Q15gBYiuhOur2jbWw0 +LOYpFN2+zLYWFNmTIt7ypHshXF+Qejt55cwvPF/aLG4pWsTcwVYtVYWti8El7/y lhLiu6b/AeEnBBMyOHqZ4VyBdalR7JzftGU0n0gBcTKTFC3eaWYlMIcSEprnIpEw KIrpsteUn5vaF5Z9yLBG40GDi6l+c/LH3nzdOw+rlTtjwhhBdVvV9SSbQYwY+jaS QbW/7hlImrOuhDrgGUTo+ne7TYnJvn3ZtDztXpeTskpNGs7UHE+7yLQxwgBIg3ma R14ToHnnTbXftQwyq/H7Dcv3qQP7tuO+IqAbd9QCBVtA+pOv5yYqpodmjtU6FJd3 uINrO1aMRfsX772lcbyiJHo70H2ksZAOODCYD/Id7I6s3qWYxr8kpHgiL8az8Mpn 3sVbmKfZSPuM34vYlrLh1P2So3A3L8ZROYaciUvEyKeE0Gpbpq7bxrTSeRTfSrzI W2ZP2GpI9pxzXigeghK/B/UcLvkgNU7n61o3yGkinJJjoUdjb7Ymfo4g1r5wN7Px FKSrsvCz4J0x6NsV1bBE3pLdnb9Cf8gqnhxNVc/R2ftVtDKlmJTokMx8/UxAe//T uaX/5M1R0cNIWzVUDQ+oNiTeeZhKf9EMyQkyqdUW84ES+fw5Hoqge4jz/kZYAP7E 6T2GGLHyiUc=
=TudP
-----END PGP SIGNATURE-----

A message that is not in the archive (sent off-list or not yet received): [email protected]

#11 lore raw
Quoted 12 lines · Chet Hosey

A quick perusal of GNU parted's manual gives me the impression that it can move partitions about the disk:

http://www.gnu.org/software/parted/manual/html_chapter/parted_2.html#SEC20

I've not used parted, but rather than dropping $25 on PartitionMagic on Amazon (or much more in a retail outlet), you could give it a shot.

If you try it, it might be nice if you let all us (and those searching the archives) how it went

It seems that it doesn't want to try to move a reiser partition. Oh well.

I took David Masover's suggestion, and did some fancy footwork.

First thing I did was realise what hda1 was used for. this was the table before I started messing around:

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1               1           6       48163+   6  FAT16
/dev/hda2   *           7        2074    16611210    7  HPFS/NTFS
/dev/hda3            2437        2439       24097+  83  Linux [boot-ext3]
/dev/hda4            2440        4398    15735667+  83  Linux [ reiser ]

I had a look on hda1 and realised it was a "special" Dell system recovery partition, with various diagnostic programs on it. And it had free space
- so it became my boot partition.

So, I deleted hda3, shrank hda4 as far as possible, created a new hda3 *after* hda4, dd'd hda4 -> hda3.

Some advice for those wanting to do this again:

- reboot after every step, to check that you haven't messed something up,
especially if after writing a new partition, fdisk say "Kernel will continue to use old partition table".

- do one thing at a time, dont try to do too many steps at once. You
will not save time in the long run.

- always have an alternative boot media handy (I use the gentoo live CD)

- be very familiar (ie, dont rely on man pages or web pages) with your
tools, especially resize_reiserfs, grub, mount etc

- dont do what I did and gamble that your laptop battery will have enough
juice to do all the steps, especially if you are in Frankfurt airport with no power outlets :)

End Result: good so far. I haven't completely finished yet, still to do are finalising the grub install, and creating the new FAT partition to share data between windows and linux.

Thanks for the advice guys!

-Jake

#12 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jake Hawkes wrote:
[...]

|  - reboot after every step, to check that you haven't messed something up,
| especially if after writing a new partition, fdisk say "Kernel will
| continue to use old partition table".

Only if that happens. And it will only happen if you are using the disk in question, so...

[...]
| - always have an alternative boot media handy (I use the gentoo live CD)

I'd use it in the first place, to avoid having to reboot after fdisk. And I'd use cfdisk. Less chance for mistakes.

| - be very familiar (ie, dont rely on man pages or web pages) with your | tools, especially resize_reiserfs, grub, mount etc

It's good to have such documentation available, whether or not you know resize_reiserfs by heart. The important thing is to train yourself to always look at the doc, and never guess, especially when a typo can mean your disk.

| End Result: good so far.  I haven't completely finished yet, still to do
| are finalising the grub install, and creating the new FAT partition to
| share data between windows and linux.

I'm curious why windows would be needed on a laptop. I only use it for games. But maybe your laptop is better than mine.

And btw, when I mess with my laptop partitions, I usually tar up everything and dump it to my desktop. Just make sure the boot cd has ethernet support.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iQIVAwUBQfwth3gHNmZLgCUhAQJTlRAAiL1GrZ0qAAQUmreveCM+AgtMoifecDgR AyPE4gv6Ah7MUsb7QluDdnGXe83YDqhnJEdIm67Iaxie0zVKWb7F5utQgzrBV7lg oY7aE7UpS1c6wQ9cNkUnfYIq4gc851J8kSTG+vO/sZIkvAxg+zp/dz/ZQa1ED+6u WxwFNkoXNq60DYg8taseVFJiy9E6jN1aM+DPsrvitgKfnjfC5xGXT62yST/So5Ua +RJTQTh+UANps3T+tubZsp/+OcH9V+mFXgGXX985ABWUjG1KX6HPSnjttkIhvvIS X+KNyXjJTH/QKW/r9xeNYXafV359GwRxxHZJuxesq8cofh5PYLg5p98FwxLHUbiY iI7pqJpDDkm4JHAa0k6c2EZyh02Iaj5vb9RbDK9p9kPSCke0cXYeyExAnCVOUDtf agNDpkC2Q9Nm+s0AsxkJX1BiLB0hGz54NAbJvfIHhxF/PgmTVCEOGjDNWoc0cAll uwc7OZK9Jv96ybuaxeDmNlLLz0iy8dK4lAh3VKw6vIA565fYGhAqFopwfcU3axqK VMTcnfq4BrmVWQnZXdX2OPPuSwss7cbYbdjoV5So8U0X5/V62QeJhGskvm8prJA9 7n/ebxGnGGQt++u8B9gIlRuT+ndZcj01k4/y3YM9Yw/inOF8bSHCjPF2B2wCGNNF yKb+jPeBRRM=
=TdWu
-----END PGP SIGNATURE-----

#13 lore raw
Quoted 4 lines · David Masover

I'm curious why windows would be needed on a laptop. I only use it for games. But maybe your laptop is better than mine.

Work VPN. :)