No way to resize reiserfs partition? 

http://mirror.hamakor.org.il/archives/linux-il/08-2005/16737.html

There is a way - I did it. Just resize it with resize_reiserfs.

But backup your data first and run fsck —rebuild-tree after the fact.

If you are shrinking the partition, consider the —scan-whole-partition option of reiserfsck.

09 Aug 2005, Amos Shapira

No way to resize reiserfs partition? 

> There is a way - I did it. Just resize it with resize_reiserfs.

This is the way to go when enlarging a partition:

  1. Expand the partition with fdisk

  2. resize_reiserfs /dev/whatever

However shrinking a partition is probably more complicated: you should first use resize_reiserfs to shrink the filesystem (the on-disk data-structure) and then only use fdisk to shrink the partition (the space allocated on the disk).

This would have been easy if both would have used the same units. Or somewhat compatible units, for that fact.

Tzafrir Cohen

No way to resize reiserfs partition? 

> This would have been easy if both would have used the same units. Or
> somewhat compatible units, for that fact.

gparted[0] is supposed to help with this by combining both steps into one, making sure that the right numbers are passed to both programs. I don't remember why it didn't work for me, maybe it failed to work with reiserfs (as far as I remember I tried the version which comes with Ubuntu's live CD).

[0] - http://gparted.sourceforge.net/

10 Aug 2005, Amos Shapira

Resize reiserfs partition 

Resize reiserfs partition up with resize_reiserfs 

RSDEV=/dev/sda14
df
/dev/sda14            51197536  37636660  13560876  74% /lfs/cache12
umount /lfs/cache12
$ reiserfsck --check $RSDEV
reiserfsck 3.6.19 (2003 www.namesys.com)
Reiserfs journal '/dev/sda14' in blocks [18..8211]: 0 transactions replayed
Checking internal tree..finished
Comparing bitmaps..finished
Checking Semantic tree:
finished
No corruptions found
$ resize_reiserfs $RSDEV
resize_reiserfs 3.6.19 (2003 www.namesys.com)
ReiserFS report:
blocksize             4096
block count           19908528 (12799776)
free blocks           10498754 (3390219)
bitmap block count    608 (391)
Syncing..done
resize_reiserfs: Resizing finished successfully.
!reiserfsck
No corruptions found
mount /lfs/cache12
df | grep !$
/dev/sda14            79631676  37636660  41995016  48% /lfs/cache12

Resize reiserfs partition down with gparted 

Necessary prepare:

RSDEV=/dev/sda15
% umount $RSDEV
% reiserfsck --check $RSDEV
Will read-only check consistency of the filesystem on /dev/sda15
Will put log info to 'stdout'
Do you want to run this program?[N/Yes] (note need to type Yes if you do):Yes
Replaying journal..
Reiserfs journal '/dev/sda15' in blocks [18..8211]: 0 transactions replayed
Checking internal tree..finished
Comparing bitmaps..finished
Checking Semantic tree:
finished
No corruptions found
There are on the filesystem:
        Leaves 42697
        Internal nodes 287
        Directories 11326
        Other files 147601
        Data block pointers 11114762 (7469 of them are zero)
        Safe links 0

Resize reiserfs partition with gparted. First try to resize down just 10M.

% gparted &
$ fdisk -l | grep $RSDEV
/dev/sda15          17417       24791    59239656   83  Linux

Yes, partition resized.

% mount $RSDEV
% umount $RSDEV

Yes, mounting/unmounting don't have any problem.

% reiserfsck --scan-whole-partition --check $RSDEV

Everything tested OK. Redo the last steps to resize reiserfs partition to the desired size.

documented on: 2006.12.03

Example using resize_reiserfs 

From resize_reiserfs' man page:

The following example shows how to test resize_reiserfs. Suppose 2Gb reiserfs filesystem is created on the device /dev/hda8 and is mounted on /mnt. For shrinking the device we need to unmount it first, then run resize_reiserfs with a size parameter (in this case -1Gb):

df
umount /mnt
resize_reiserfs -s -1G /dev/hda8
mount /dev/hda8 /mnt
df /mnt

lost data when resizing reiserfs 

http://www.linuxforums.org/forum/debian-linux-help/13985-lost-data-when-resizing-reiserfs.html

> I used Qtparted to shrink the reiserfs one, and then I used cfdisk to create
> the fat32 partition (should I have rebooted the computer before using
> cfdisk? I dont't know.). Then I rebooted the computer, and received a lot of
> error messages.

If you shrunk the reiser partition, then you're pretty much SOL. To shrink a reiserfs partition, you have to use a program called resize_reiserfs (included with reiserfstools) to shrink the filesystem first. Then you can use fdisk or cfdisk to resize the partition itself. AFAIK, QParted is just to resize FAT/NTFS filesystems.

documented on: 09-19-2004, sarumont