Changes between Initial Version and Version 1 of ZFSConfiguration

Show
Ignore:
Timestamp:
11/21/08 14:18:28 (10 years ago)
Author:
ibaldin (IP: 152.54.9.131)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ZFSConfiguration

    v1 v1  
     1== ZFS Server Installation and Configuration == 
     2 
     31. Install OpenSolaris. OpenSolaris will create a default ZFS pool called '''rpool'''. 
     4 
     52. You must create the following ZFS hierarchy: 
     6 
     7{{{ 
     8zfs create rpool/images 
     9zfs create rpool/images/orca 
     10zfs create rpool/images/orca/base 
     11zfs create rpool/images/orca/clone 
     12}}} 
     13 
     14We will use orca/base for template images and orca/clone for cloned filesystems. 
     15 
     163. You must enable NFS sharing for rpool/images/orca 
     17 
     18zfs set sharenfs=rw=@192.168.0.0/16,root=@192.168.0.0/16 rpool/images/orca 
     19 
     20This command enables mount (and root mount) from 192.168.0.0/16 
     21 
     22== ZFS Driver Preparation == 
     23 
     241. Create a user '''sharp''' on the ZFS server 
     25 
     26{{{ 
     27useradd -d /export/home/sharp -m -s /bin/bash sharp 
     28passwd sharp 
     29}}} 
     30 
     312. Generate a keypair for user sharp 
     32 
     33Login as sharp and invoke: 
     34 
     35{{{ 
     36ssh-keygen -b 1024 -t dsa 
     37}}} 
     38 
     39Select the default location. When prompted for key password press enter (no password). 
     40 
     413. Enable password-less ssh login for user sharp 
     42 
     43{{{ 
     44cd ~/.ssh 
     45cat id_dsa.pub > authorized_keys 
     46}}} 
     47 
     48To test your setup: 
     49{{{ 
     50ssh localhost 
     51}}} 
     52 
     53This command should succeed without requiring a password. 
     54 
     554. Copy /root/.ssh/id_dsa to your build machine. We will refer to this key 
     56as sharp_dsa. 
     57 
     58 
     595. Enable user sharp to invoke zfs 
     60 
     61Add this to ~sharp/.profile 
     62{{{ 
     63export PATH=${PATH}:/usr/sbin/ 
     64}}} 
     65 
     666. As root install sudo: 
     67 
     68{{{ 
     69wget ftp://ftp.sunfreeware.com/pub/freeware/intel/10/sudo-1.6.9p18-sol10-x86-local.gz 
     70wget ftp://ftp.sunfreeware.com/pub/freeware/intel/10/libintl-3.4.0-sol10-x86-local.gz 
     71wget ftp://ftp.sunfreeware.com/pub/freeware/intel/10/libiconv-1.11-sol10-x86-local.gz 
     72wget ftp://ftp.sunfreeware.com/pub/freeware/intel/10/libgcc-3.3-sol10-intel-local.gz 
     73 
     74gunzip sudo-1.6.9p18-sol10-x86-local.gz 
     75gunzip libintl-3.4.0-sol10-x86-local.gz 
     76gunzip libiconv-1.11-sol10-x86-local.gz 
     77gunzip libgcc-3.3-sol10-intel-local.gz 
     78 
     79pkgadd -d sudo-1.6.9p18-sol10-x86-local  
     80pkgadd -d libintl-3.4.0-sol10-x86-local 
     81pkgadd -d libiconv-1.11-sol10-x86-local 
     82pkgadd -d libgcc-3.3-sol10-intel-local 
     83 
     84}}} 
     85 
     86Answer yes to all prompts during the installation. 
     87 
     88Create symbolic links: 
     89 
     90{{{ 
     91ln -s -f /usr/local/bin/sudo /usr/bin/sudo 
     92ln -s -f /usr/local/etc/sudoers /etc/sudoers 
     93}}} 
     94 
     95Invoking sudo should produce output similar to this one: 
     96 
     97{{{ 
     98-sh-3.2$ sudo 
     99usage: sudo -K | -L | -V | -h | -k | -l | -v 
     100usage: sudo [-HPSb] [-p prompt] [-u username|#uid] 
     101            { -e file [...] | -i | -s | <command> } 
     102}}} 
     103 
     104 
     1057. Edit the sudoers file to enable sharp to invoke zfs 
     106 
     107          
     108Make /etc/sudoers writable: 
     109 
     110{{{ 
     111chmod u+w /etc/sudoers 
     112}}} 
     113 
     114Edit /etc/sudoers and add the following line: 
     115 
     116{{{ 
     117sharp   ALL=NOPASSWD:/usr/sbin/zfs 
     118}}} 
     119 
     120Change the permissions on /etc/sudoers back: 
     121 
     122{{{ 
     123chmod 0440 /etc/sudoers 
     124}}} 
     125 
     126Now login as sharp and test with the following command: 
     127 
     128{{{ 
     129sudo zfs list 
     130}}}