You are not logged in.

#1 2010-01-10 21:17:35

milomouse
Member
Registered: 2009-03-24
Posts: 940
Website

[SOLVED] Change default hash for reiserfs?

I know you can change the hash for reiserfs (v3) via the command line, which is what I did when I created all my partitions, but I was wondering if there's a file I can edit or if I can recompile it to use a different hash as default. The only reason I'm asking is because I make all my reiserfs partitions use the hash "tea" instead of the current default "r5" and also I use a randomly encrypted /tmp partition as reiserfs but whenever it mounts it recreates the reiserfs on /tmp (/dev/sda6) using the default hash of "r5". Here's my fstab entry for /tmp:

/dev/sda6 /tmp reiserfs defaults,nodev,nosuid,loop=/dev/loop6,encryption=AES256,phash=random/1777 0 0

So as you see it recreates the reiser-filesystem on /tmp at each mount while encrypting it via AES256 using a random encryption hash. The problem is the default settings for reiserfs are to use "r5" instead of "tea" for it's own hash so it creates /tmp with "r5" instead of "tea". I hate to sound like a fickle-penny but I just want it to change the default settings for mkreiserfs (mkfs.reiserfs) but I checked what reiserfsprogs installed and there's no files to change and I can't seem to find anything via search engines. I checked the mke2progs.conf file but there's no entry for reiserfs only the ext2/3/4 filesystems. Any ideas?

Last edited by milomouse (2010-01-27 16:24:38)

Offline

#2 2010-01-10 23:12:56

kjon
Member
From: Temuco, Chile
Registered: 2008-04-16
Posts: 398

Re: [SOLVED] Change default hash for reiserfs?

nope. My boredom hasn't reached those levels yet smile

(just joking ... tongue )


They say that if you play a Win cd backward you hear satanic messages. That's nothing! 'cause if you play it forwards, it installs windows.

Offline

#3 2010-01-10 23:25:46

milomouse
Member
Registered: 2009-03-24
Posts: 940
Website

Re: [SOLVED] Change default hash for reiserfs?

So that's a definite "no"? hmm If so, I guess having "r5" on /tmp isn't so bad since it's always recreated anyway so there's no real need to worry about hash collisions, plus it's a little faster. Still, it'd be nice to have control over those things.

Offline

#4 2010-01-27 16:24:14

milomouse
Member
Registered: 2009-03-24
Posts: 940
Website

Re: [SOLVED] Change default hash for reiserfs?

I decided to look into this again and was examining the source code where I finally found the default hash setting. I modified the code, recompiled, installed and restarted my computer to confirm that Tea was in fact changed to default. It was. My automatically re-created partitions (that I talked about in first post) now have the Tea hash instead of R5.

So, I'm not sure if I'm "allowed" to distribute this but I changed the PKGBUILD around, also adding the largefile support (which I'm surprised I didn't look into before since it's on all my partitions) just in case anyone else wants to use it. I mostly did this for myself so nobody else has to use this if they don't want to. Just thought I'd share how I solved this.

pkgname=reiserfsprogs
pkgver=3.6.21
pkgrel=2
pkgdesc="Reiserfs utilities with largefile support and Tea default hash"
arch=(i686 x86_64)
url=http://www.kernel.org/pub/linux/utils/fs/reiserfs/README
license=('GPL')
groups=('base')
depends=('util-linux-ng>=2.16')
source=(http://www.kernel.org/pub/linux/utils/fs/reiserfs/reiserfsprogs-${pkgver}.tar.bz2)
md5sums=('0639cefac8f8150536cfa7531c2aa2d2')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  echo ""
  echo ">>> Changing default hash setting from R5 to Tea."
  echo ""
  sed -i 's|DEFAULT_HASH .*|DEFAULT_HASH TEA_HASH|g' include/reiserfs_fs.h
  ./configure --prefix=/usr --sbindir=/sbin --enable-largefile || return 1
  make || return 1
  make DESTDIR="${pkgdir}" install || return 1
  ln -s reiserfsck "${pkgdir}/sbin/fsck.reiserfs"
  ln -s mkreiserfs "${pkgdir}/sbin/mkfs.reiserfs"
}

Marking this as Solved.

Offline

Board footer

Powered by FluxBB