init slice zfs pool
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 8 Oct 2011 13:47:34 +0000 (15:47 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 8 Oct 2011 13:47:34 +0000 (15:47 +0200)
README
create-user.sh
dump-bdb.pl [new file with mode: 0755]
env.sh
quota-show.sh [new file with mode: 0755]

diff --git a/README b/README
index 447a0c8..9a70256 100644 (file)
--- a/README
+++ b/README
@@ -34,9 +34,11 @@ $ egrep '^(passwd|group):' /etc/nsswitch.conf
 passwd:         compat extrausers
 group:          compat extrausers
 
-Install default test user and first slice:
+Now you will want to end env.sh configuration for this slice
 
-$ sudo cp -v extrausers/* /var/lib/extrausers/
-`extrausers/group' -> `/var/lib/extrausers/group'
-`extrausers/passwd' -> `/var/lib/extrausers/passwd'
+$ vi env.sh
+
+And create ZFS filesystem and md5 pool in it:
+
+$ sudo ./bin/init-slice.sh
 
index 52bd56b..b3ead4d 100755 (executable)
@@ -24,7 +24,6 @@ else
                >> /var/lib/extrausers/passwd
 fi
 
-ZSLICE=`echo $SLICE | sed 's!^/!!'`
 if [ ! -e $SLICE/$uid ] ; then
        mkdir $SLICE/$uid
        chown $uid:$PORT $SLICE/$uid
diff --git a/dump-bdb.pl b/dump-bdb.pl
new file mode 100755 (executable)
index 0000000..bfe9884
--- /dev/null
@@ -0,0 +1,11 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+
+use BerkeleyDB;
+use Data::Dump qw(dump);
+
+my %h;
+tie %h, "BerkeleyDB::Hash", -Filename => $_[0];
+
+print dump( \%h );
diff --git a/env.sh b/env.sh
index 069707a..cf9453e 100644 (file)
--- a/env.sh
+++ b/env.sh
@@ -1,3 +1,6 @@
 export SLICE=/test/s1
 export IP=10.13.37.102
 export PORT=6501
+
+ZSLICE=`echo $SLICE | sed 's!^/!!'`
+export ZSLICE
diff --git a/quota-show.sh b/quota-show.sh
new file mode 100755 (executable)
index 0000000..1f555c2
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh -xe
+. ./env.sh
+sudo zfs userspace $ZSLICE