# Howto Create a Reiser4 Partition

## Redeeman

okay, the first thing we need to do is: get a kernel with reiser4 support. that could be a vanilla you have patched yourself, or, this one(i made the patch, and it works)

for kernel, read: https://forums.gentoo.org/viewtopic.php?t=167182

then after configuring this kernel and installing (i wont describe that, i assume you know that) you need to emerge reiser4progs and libaal. the newest libaal is alreadt in portage, just grab it.

and then you emerge reiser4progs:

```
ACCEPT_KEYWORDS="~x86" emerge --digest reiser4progs
```

good! now you have all thats needed. then we create the partition, and mount it:

```
mkfs.reiser4 /dev/hdxx

mount /dev/hdxx /mnt/reiser4
```

Mod Edit: fixed formatting - tomk

thanks  :Very Happy:  - redeeman

and then start feel the power coming through your harddrive (and please, test this on /usr/portage, and you will for sure be enlightened)

IF you want a fully system on reiser4, take a look at my livecd - https://forums.gentoo.org/viewtopic.php?p=1046028#1046028

----------

## shanghai

Has reiserfs4 been finally marked as stable?

I knew it still had some workarounds a month ago...

----------

## Blue Fox

Is reiser4 stable? I say, if i can trust it and won't lose data sometimes.

----------

## Yen

I'm using Reiser4 on my /usr/portage.. wow this thing is fast!!

TEST: tar xf linux-2.6.5.tar (I uncompressed it before doing the benchmark).

Untar of the Linux kernel 2.6.5 on ext3:

real    0m20.491s

user    0m0.189s

sys     0m2.321s

Untar of the Linux kernel 2.6.5 on Reiser4:

real    0m14.954s

user    0m0.235s

sys     0m4.541s

Untar of the Linux kernel 2.6.5 on ext2:

real    0m25.193s

user    0m0.194s

sys     0m1.625s

Untar of the Linux kernel 2.6.5 on XFS:

real    0m25.764s

user    0m0.244s

sys     0m3.027s

Untar of the Linux kernel 2.6.5 on JFS:

real    0m34.063s

user    0m0.212s

sys     0m2.112s

Untar of the Linux kernel 2.6.5 on ReiserFS (v3.6):

real    0m23.708s

user    0m0.213s

sys     0m4.290s

Untar of the Linux kernel 2.6.5 on VFAT (Yeah i know, stupid benchmark):

real    0m48.947s

user    0m0.962s

sys     0m6.687s

----------

## malloc

Don't forget that if you don't enable Large keys support in the kernel (wich by the help they don't recommend) you need to build your partition with 

```

mkfs.reiser4 -o key=key_short /dev/hdXX

```

----------

## Redeeman

 *shanghai wrote:*   

> Has reiserfs4 been finally marked as stable?
> 
> I knew it still had some workarounds a month ago...

 

nope, there are 2 known errors left, but as hans said "its fairly stable for average users". and it works perfect here

----------

## StringCheesian

Thank you for this patch and howto, Redeeman!

I googled and searched the man pages to find out how to apply a kernel patch like this one, and I thought I'd save any other newbies the effort (somebody correct me if I'm wrong, please).

How to apply this patch:

```
(decompress the bz2 file)

su

cd /usr/src

patch -p0 < (where-ever the .patch file is)/2.6.5-Redeeman2.patch

(and then the usual make, make modules_install, mount /boot, make install)
```

For more info see the "patch" man page and this link: http://www.linuxhq.com/patch-howto.html

EDIT: Portage can't download reiser4progs-0.5.4.tar.gz! And the version I see in http://thebsh.namesys.com/snapshots/LATEST/ is 0.5.3...

----------

## hiroki

hmm. i don't know where you got reiser4progs 0.5.4 ... but i am installing 0.5.3 now. it's the most recent on namesys.com/snapshot

----------

## broeman

 *Quote:*   

> hmm. i don't know where you got reiser4progs 0.5.4 ... but i am installing 0.5.3 now. it's the most recent on namesys.com/snapshot

 

same here   :Rolling Eyes: 

I have mentioned it to redeeman on irc  :Wink: 

----------

## floam

 *Redeeman wrote:*   

> for reiser4progs they are OLD in portage, you need to do this:
> 
> ```
> root@redeeman: ~# cd /usr/portage/sys-fs/reiser4progs/
> 
> ...

 Wouldn't it be better to use the overlay?

----------

## scout

 *floam wrote:*   

> Wouldn't it be better to use the overlay?

 

Sure, but it would be longer to explain  :Rolling Eyes: 

[EDIT] I submited a version bump for reiser4progs-0.5.3 (https://bugs.gentoo.org/show_bug.cgi?id=47554)

[EDIT2] Wow that was fast, it's already in portage http://www.gentoo-portage.com/browse-program.php?program=6245

----------

## JefPober

is it possible to convert an existing reiserfs 3 partition to version 4?

----------

## Enderson

 *JefPober wrote:*   

> is it possible to convert an existing reiserfs 3 partition to version 4?

 

I dunno, but you cold make something like this:

reise3to4 on /home

```

bash # tar -cjf /tmp/home.tar.bz2 /home

bash # umount /home

bash # mkfs.reiser4 /dev/hda4 # your /home partition

bash # mount /dev/hda4 /home

bash # tar -xjpf /tmp/home.tar.bz2 /home

```

I think it should work.

----------

## GentooBox

what about the grub-94 diff file from namesys homepage, is it something i need to have a full working reiserfs4 system ?

----------

## infirit

GentooBox see bug 46410, you only need it if you want reiser4 for /boot. 

Libaal and resier4progs need to be recompiled with --stand-alone

----------

## stahlsau

edit: sry, misplaced post.

anyway, i changed my sys to reiser4 without any problem  :Wink: 

----------

## zend

 *stahlsau wrote:*   

> edit: sry, misplaced post.
> 
> anyway, i changed my sys to reiser4 without any problem 

 

how could you get it works??

----------

## deepspace9

Can someone tell me how to make a complete install on reiserfs4? The kernel from the boot CD does not support it, so even if the tools work, I couldn't mount the partition  :Sad: .

----------

## stahlsau

 *Quote:*   

> how could you get it works??

 

**edit**

best way should be to download redeemans live-cd and use it  :Smile: 

hi, 

i havn't much time, so only a short reply:

1. created a reiser4-kernel like said above

2. copied my whole sys from the "old" partitions to a spare one (cp -rp ...)

3. changed my /etc/fstab to use this partition

4. rebooted (to reiser4-kernel  :Wink: )

5. generated reiser4-filesystem on all "old" partitions

6. copied data back

7. changed fstab to use the created partitions (fs-type "reiser4")

8. rebooted into the new reiser4-world  :Smile: 

that's all, but i'll give no warranty if you f**k up your sys  :Wink: 

If s/t goes wrong, you can always boot with your gentoo-cd and change your fstab to use the backup-partition.Last edited by stahlsau on Fri Apr 23, 2004 7:04 am; edited 1 time in total

----------

## StringCheesian

The only way I can think of is the make two root partition, one to be reiserfs4, and the other a quickie GRP install. Finish the quickie, install the latest 2.6 kernel sources and ReiserFS4 patch and tools, format the other root partition, mount it and install gentoo on it. Then delete the temporary quickie partition, or keep it in case you'll need it again.

EDIT: stahlsau beat me to it, and explained it more coherently.

----------

## Redeeman

hey hey, this is why i made the livecd with reiser4 support!!!!!!!!!!!!

https://forums.gentoo.org/viewtopic.php?t=161783&highlight=reiser4+enabled+livecd

hehe

----------

## Redeeman

http://www.pandorasearch.com/~ruben/

as the site says, grab the iso from there while its still there!

(and then please grab torrent too, so you can see some time now and then  :Smile: )

----------

## stahlsau

yes, noticed bout your cd. But here in germany most users, including me, have got those silly small connections, so it was faster for me to backup'n'copy than to download your cd.

another thing:

i feel my system being a little slower than on ext3 which i ran before. Maybe it's cause i had to change my kernel from love-sources to speedy-sources to get reiser4 working, but maybe i've messed s/t up with the filesystem.

Anyone can confirm this? Or anyone got an idea what i could have fu...messed up?  :Smile: 

----------

## neenee

i'd have to say that moving away from love-sources

has caused the decrease in performance; i've noticed

it too, especially with ut2004.

----------

## cohonen

Some concerns i have

i made a reiser4 partition and tested it with a vanilla kernel tar'ed and bz2'ed

and the results was less than impressive ext3 actually beat reiserfs4 here 

also a friend of mine noticed that on a 100GB disk reiser4 took 4GB more space  

for partition than reiser3 which seems quite a lot.

any fixes for those two conserns somebody please tell me i did something stupid cuz im not gonna use reiser4 if it do not own every other fs out there   :Very Happy: 

----------

## MG-Cloud

Hi all,

I would love to try reiser4 on my computer.  I have a problem though - I only have one hard drive, and I'm not willing to spend the time to rebuild my system (at the moment - it's finals and essays time in school haha).  My drive is set up (as per the older gentoo install guide) as /, /boot, and swap.  My / partition is less than half full, and I want to convert it to reiser4.

I plan on:

1. backing up my ~/

2. Using resize_reiserfs to resize my /

3. Creating a reiser3 partition on the rest of the drive, and copying over all my files from / to the new partition (call it /bkp)

4. Make / reiser4

5. copy /bkp/* to /

6. Delete the /bkp partition

7. Use resizefs.reiser4 to resize / to fill its old space

Does this sound like a pretty good plan, or am I setting myself up for almost certain drive corruption/b0rkage?  :Razz: 

Thanks =)

----------

## Petyr

A suggestion if I may. Please bear in mind, it's rather late for me so my mind may be a bit fuddled  :Wink: 

Copying your / to reiser4 may not be the best of ideas, especially with finals coming up. I'd suggest waiting at least until those are done first. Personal experience from years as a sysadmin makes me quezy at the thought of making a major change like that before something really mission critical. That aside, one thing you could try doing is this

1) Shrink the original / ( I'll call it /#1)

2) create /#2 and make it reiser3

3)  use something like rsync to get everything over from /#1 -> /#2

4) *TEST the system* extensivly if possible. i.e. change your grub.conf so that /dev/hda3 (or whatever /#2 is on) is the param for root. Create all that under a new label in grub so that switching back is as simple as selecting Old Boot on the menu  :Smile: 

5) Assuming the system works, boot into the new system where /#2 is the root param for your kernel, and format /#1 to reiser4

6) again sync /#2 -> /#1, create the initrd stuff if needed to a seperate file, make adjustments to grub.conf blahblahblah.

7) Spend some serious time testing

8 ) work on that for like a week (in reality probably a couple days but where I work, everything gets about a week of smoke testing if it's even slightly important) if all goes well THEN hose out /#2 and resize /#1 to fill the drive

somehow I feel like I'm missing something important... bah, it'll come to me later. Just take everything I just wrote and consider it carefully. You might be following the instructions of a half dead crazy person  :Laughing: 

Cheers,

Petyr Rahl

----------

## Redeeman

https://forums.gentoo.org/viewtopic.php?t=167182

----------

## azlan

I lost a hard drive, testing Reiser4 a few months ago.  It was really fast, but I have been unable to find a partitioning tool that can read and reformat a reiser4 partition.

I would ty it again if someone could point to an version of fdisk or the like that can actually see a reiser4 partition.

----------

## chipi

Has someone managed to patch the latest love-sources (2.6.6-rc3-love1)? all the patchs I saw was for 2.6.5...

----------

## gaelic

just finished to setup reiser4 on my pc.

/boot: ext3

/: reiser4

/home: reiser4

patched vanilla 2.6.5-rc2

an its so fast  :Very Happy: 

with /boot i'm waiting till reiser4 ist officially supportet by grub & mm-sources or love-sources, whatever

----------

## theonlymcc

I have tried using cp -a, cp -Rp, and other variations of cp. I tried tar'ing my / but that didn't work either. After changing my root param in grub and editing my fstab on the reiser4 partition, it still mounts reiserfs partition as root instead of reiser4. Am I not copying correctly? Help.

----------

## Gentree

 *Yen wrote:*   

> I'm using Reiser4 on my /usr/portage.. wow this thing is fast!!
> 
> TEST: tar xf linux-2.6.5.tar (I uncompressed it before doing the benchmark).
> 
> Untar of the Linux kernel 2.6.5 on ext3:
> ...

 

Very interesting to see your tests. Good to have something concrete rather than "this feels much faster".

However, inspired by your results I decided to move portage over to reiser4, but first decided to see how my system compared to yours on a similar test.

I copied /usr/portage/tmp accross to my new r4 partition and untared the zsh archive. 

I found my test a bit SLOWER on r4. (only a few % but slower , repeated tests confirm)

I should emphasise that I do have long keys enabled on mine.

Anyone got similar results?

Maybe I should go for short keys if I want speed.  :Confused: 

----------

## Gentree

Compare the following on new reiser4 part. , untarring linux-2.6.6.tar.bz2

```
df . && time tar -xjf lin*2.6.6* -C ../test

Filesystem           1K-blocks      Used Available Use% Mounted on

/dev/hdc5             10000116   3039544   6960572  31% /usr/portage/tmp

real    0m37.669s

user    0m23.748s

sys     0m5.060s

```

with identical task on old rieser3 part.

```
df . && time tar -xjf lin*2.6.6* -C ../test

Filesystem           1K-blocks      Used Available Use% Mounted on

/dev/hdc12             3892516   2107656   1784860  55% /mnt/reiser4

real    0m39.969s

user    0m24.162s

sys     0m6.608s

```

exerpt from mount:

```
/dev/hdc5 on /usr/portage/tmp type reiserfs (rw,noatime)

/dev/hdc12 on /mnt/reiser4 type reiser4 (rw,noatime)

```

Reiser4 is marginally SLOWER on this system, now using key_short.

Comments please.

 :Confused: 

----------

## thoffmeyer

Reiser4 for what I have tested is pretty nice and very stable. I have had no problems yet, but it is very stable. I cant wait untill the final release.

----------

## AstralStorm

Where were you copying from? That ReiserFS partition?

No doubt it will get better results then.

Here, Reiser4 > ReiserFS > ext3 writeback > XFS

Tested with ~1GiB file copying & portage tree unpacking (with metadata: ~50MiB tar.bz2 of small files)

(from VFAT partition)

With large file XFS is nearly the same as ReiserFS (about 2 sec difference, XFS faster), but much slower with small files.

Can't post timings - reinstalling now only on Reiser4, no space for another partition and haven't stored the results.

All tests were under 2.6.6-love4.

----------

## Gentree

Interesting: here are some thorough tests results by Grant Miner 

 *Quote:*   

> The first item number is time, in seconds, to complete the test (lower 
> 
> is better).  The second number is CPU use percentage (lower is better).
> 
> reiser4 171.28s, 30%CPU (1.0000x time; 1.0x CPU)
> ...

 

These test results are reported in more detail on the following link:

http://kerneltrap.org/node/view/715

Even more detail result tables here: http://www.namesys.com/benchmarks.html#mongo.2003.07.10

Well the reiser3 results contradic my findings above.

Anyone got any ideas why?

Thx.   :Cool: 

----------

## CuttEdge

x86_64 uses;

For x86_64 users, I had to apply the following patches to linux-2.6.7-mm4-Redeeman5 for the kernel to compile.  It appears that none of these items removed are used as far as I can tell.  My RAID 5 is rebuilding now, and reiserfs 4 appears to be working correctly.  I am getting dbench numbers of

150 MB/s with 60 clients with R5 (4 disks) in the middle of a resync.

-----------------------------------------------------------------------------------------------------------------------------------

--- linux-2.6.7/include/asm-x86_64/bootsetup.h.orig     2004-06-30 10:34:30.051691656 -0700

+++ linux-2.6.7/include/asm-x86_64/bootsetup.h  2004-06-30 10:38:50.067163296 -0700

@@ -29,6 +29,8 @@

 #define DISK80_SIGNATURE (*(unsigned int*) (PARAM+DISK80_SIG_BUFFER))

 #define EDD_NR     (*(unsigned char *) (PARAM+EDDNR))

 #define EDD_BUF     ((struct edd_info *) (PARAM+EDDBUF))

+#define EDD_MBR_SIG_NR (*(unsigned char *) (PARAM+EDD_MBR_SIG_NR_BUF))

+#define EDD_MBR_SIGNATURE ((unsigned int *) (PARAM+EDD_MBR_SIG_BUF))

 #define COMMAND_LINE saved_command_line

 #define RAMDISK_IMAGE_START_MASK       0x07FF

------------------------------------------------------------------------------------------------------------------------------------

--- linux-2.6.7/arch/x86_64/kernel/domain.c.orig        2004-06-30 11:35:19.665865968 -0700

+++ linux-2.6.7/arch/x86_64/kernel/domain.c     2004-06-30 11:37:39.854554048 -0700

@@ -21,10 +21,6 @@

                struct sched_domain *phys_domain = &per_cpu(phys_domains, i);

                *cpu_domain = SD_SIBLING_INIT;

-               /* Disable SMT NICE for CMP */

-               /* RED-PEN use a generic flag */

-               if (cpu_data[i].x86_vendor == X86_VENDOR_AMD)

-                       cpu_domain->flags &= ~SD_SHARE_CPUPOWER;

                cpu_domain->span = cpu_sibling_map[i];

                cpu_domain->parent = phys_domain;

                cpu_domain->groups = &sched_group_cpus[i];

-------------------------------------------------------------------------------------------------------------------------------------

--- linux-2.6.7/fs/reiser4/coord.c.orig 2004-06-24 17:49:05.306341272 -0700

+++ linux-2.6.7/fs/reiser4/coord.c      2004-06-24 18:55:00.247098888 -0700

@@ -582,77 +582,6 @@

        }

 }

-#if REISER4_DEBUG

-#define DEBUG_COORD_FIELDS (sizeof(c1->plug_v) + sizeof(c1->body_v))

-#else

-#define DEBUG_COORD_FIELDS (0)

-#endif

-

-reiser4_internal int

-coords_equal(const coord_t * c1, const coord_t * c2)

-{

-       assert("nikita-2840", c1 != NULL);

-       assert("nikita-2841", c2 != NULL);

-

-       /* assertion to track changes in coord_t */

-       cassert(sizeof(*c1) == sizeof(c1->node) +

-               sizeof(c1->item_pos) +

-               sizeof(c1->unit_pos) +

-               sizeof(c1->iplugid) +

-               sizeof(c1->between) +

-               sizeof(c1->pad) +

-               sizeof(c1->offset) +

-               DEBUG_COORD_FIELDS);

-       return

-               c1->node == c2->node &&

-               c1->item_pos == c2->item_pos &&

-               c1->unit_pos == c2->unit_pos &&

-               c1->between == c2->between;

-}

-

-/* Returns true if two coordinates are consider equal.  Coordinates that are between units

-   or items are considered equal. */

-/* Audited by: green(2002.06.15) */

-reiser4_internal int

-coord_eq(const coord_t * c1, const coord_t * c2)

-{

-       assert("nikita-1807", c1 != NULL);

-       assert("nikita-1808", c2 != NULL);

-

-       if (coords_equal(c1, c2)) {

-               return 1;

-       }

-       if (c1->node != c2->node) {

-               return 0;

-       }

-

-       switch (c1->between) {

-       case INVALID_COORD:

-       case EMPTY_NODE:

-       case AT_UNIT:

-               return 0;

-

-       case BEFORE_UNIT:

-               /* c2 must be after the previous unit. */

-               return (c1->item_pos == c2->item_pos && c2->between == AFTER_UNIT && c2->unit_pos == c1->unit_pos - 1);

-

-       case AFTER_UNIT:

-               /* c2 must be before the next unit. */

-               return (c1->item_pos == c2->item_pos && c2->between == BEFORE_UNIT && c2->unit_pos == c1->unit_pos + 1);

-

-       case BEFORE_ITEM:

-               /* c2 must be after the previous item. */

-               return (c1->item_pos == c2->item_pos - 1 && c2->between == AFTER_ITEM);

-

-       case AFTER_ITEM:

-               /* c2 must be before the next item. */

-               return (c1->item_pos == c2->item_pos + 1 && c2->between == BEFORE_ITEM);

-       }

-

-       impossible("jmacd-9906", "unreachable");

-       return 0;

-}

-

 /* If coord_is_after_rightmost return NCOORD_ON_THE_RIGHT, if coord_is_after_leftmost

    return NCOORD_ON_THE_LEFT, otherwise return NCOORD_INSIDE. */

 /* Audited by: green(2002.06.15) */

-------------------------------------------------------------------------------------------------------------------------------------

More benchmarks when RAID 5 syncs.    :Smile: 

peace, Scott

----------

## Forse

Nice thread  :Smile:  I was dying to test reiser4, but I never could find a patches for my kernel (2.6.7-hardened-r10) then I saw the light http://kem.p.lodz.pl/~peter/cko/reiser4/ .

Anyway I can't say anything yet, except that I have a little issue. I can't seem to get notail to work with reiser4. I can't seem to mount reiser4 with notail option. Anyway any input on this?

P.S. Samba works a lot faster off reiser4 (I will benchmark once I have more time).

-Edit- I just noticed reiser4 ate 11gig off my 99gig partition -_-

----------

## tnt

What should I use in /etc/fstab ?

Whould I use some flags like noatime, notail, or so?

```
/dev/hda5       /mnt/proba      reiser4         noatime,notail  1 1
```

or what?

----------

## Forse

 *tnt wrote:*   

> What should I use in /etc/fstab ?
> 
> Whould I use some flags like noatime, notail, or so?
> 
> ```
> ...

 

My entry: 

```
/dev/hdg3               /stuff          reiser4         noatime                 0 0
```

As I said in my last post it seems you can't use notail option with reiser4 (correct me if I am wrong) I tried using notail and I got: 

```
reiser4[mount(10590)]: parse_options (fs/reiser4/vfs_ops.c:837)[nikita-2307]:

WARNING: Unrecognized option: "notail"
```

Anyway been running reiser4 for 4 days on my server which stress tested it...seems stable to me.

----------

## aquadog

```
aquadog@gentoo ~ $ mount

/dev/hda6 on / type reiser4 (rw,noatime,notail)
```

works here...

----------

## Forse

 *aquadog wrote:*   

> 
> 
> ```
> aquadog@gentoo ~ $ mount
> 
> ...

 

What kernel (aka sources) are u using and what version of reiser4 patches?

----------

## aquadog

im currently using the latest (2.6.9-cko3)CKO patchset:

http://kem.p.lodz.pl/~peter/cko/

----------

## tnt

 *aquadog wrote:*   

> 
> 
> ```
> aquadog@gentoo ~ $ mount
> 
> ...

 

And what is your fstab entry for reiser4? How to mount it with 'notail'? When I add 'notail' to my fstab, I can't mount that partition.

----------

## aquadog

my fstab entry is just a standard entry with notail and noatime added into the options.

----------

