Freenas: howto partition a disk PDF Print E-mail
Wednesday, 26 May 2010 10:44

I'm using a 1TB disk on Freenas 0.71 that I will divide into several partitions.

#unmount partitions created earlier
umount /dev/da1p1
umount /dev/da1p2
umount /dev/da1p3

# clean the disk
gpt destroy /dev/da1

# create a primary disk
gpt create /dev/da1

# Create the partitions.
# You need 2097152 sectors per GB(for standard disk/512 bytes per sector).
# i.e. for 120GB we do the math 2097152 * 120 = 251658240:

# Add first partition (da1p1) 500GB
gpt add -s 1048576000 /dev/da1
newfs -L DATA /dev/da1p1

# Add second partition (da1p2) 200GB
gpt add -s 419430400 /dev/da1
newfs -L BACKUP /dev/da1p2

# What's left over is for the third partition (da1p3)
gpt add /dev/da1
newfs -L iSCSI /dev/da1p3

You can adjust and run this as a script.

Then go to the webgui and:

  1. add the disk
  2. mount the three partitions (I just used default settings)

Now you can:

  1. Create a SMB share on a partition
  2. Create a iSCSI target on a partition. This one needs more explanation:
    - create a SMB share on the partition
    - create an empty file (ie names iscsi)
    - create a portal group and initiator group
    - create an iSCSI extend that points to the file you created earlier
    - create an iSCSI target
 

Comments  

 
-1 #2 christian 2011-05-17 08:27
Thanks!!

your text help me a lot!

bye
Quote
 
 
-1 #1 Chifoo 2011-05-01 00:32
You cant use gpt anymore, gpart insdead.
Quote
 

More KB Articles