Installing And Using ZFS In Linux Mint / Ubuntu – Part 7

Share on FacebookShare on Google+Tweet about this on TwitterPin on PinterestShare on RedditPrint this page

Continuing from part 6, we’ll conclude the series with a recipe for implementing an iSCSI based storage with ZFS in Linux Mint (This tutorial assumes that you don’t have ZFS installed on your system, if you already do, skip to step 4):

1. Issue the following command at the terminal to add ubuntu-zfs repository to the system –

sudo add-apt-repository ppa:zfs-native/stable

2. Now, update your package lists –

sudo apt-get update

3. Install the ubuntu-zfs package –

sudo apt-get install ubuntu-zfs

4. Now, create a ZFS pool as per your requirement –

sudo zpool create myPool <RAID level> <devices>

5. Now, create a ZFS data set of desirable capacity (in this case the ZFS pool name is ‘myPool’ and we are creating a new ZFS data set ‘iscsivol’ as well as setting a quota of 500 GB on the new ZFS data set) –

sudo zfs create -V 500g myPool/iscsivol

6. Now, edit the ‘iscsitarget’ file (you can use nano/vi/gedit for this as per your preference) –

sudo gedit /etc/default/iscsitarget

Make sure that the following statement is included in the file –

ISCSITARGET_ENABLE=true

Save and close the file.

7. Now, edit the ‘ietd.conf’ file (you can use nano/vi/gedit for this as per your preference) –

sudo gedit /etc/iet/ietd.conf

Make sure the following statements are included in the file –

Target iqn.2012-11.myPool:storage.iscsivol

Lun 0 Path=/dev/zd0,Type=fileio

Note that the ‘Target’ name should be unique. For simplicity, you can use the following format –

iqn.<year in YYYY format>-<month in MM format>.<ZFS pool name>:storage.<ZFS data set name>

Save and close the file when done.

8. Now, restart the iSCSI target service –

sudo /etc/init.d/iscsitarget restart

9. If everything was done correctly, you should see the iSCSI target after executing the following command –

iscsiadm -m discovery -t st -p <system IP>

 

This concludes the ZFS on Linux Mint tutorials.

Comments are closed.