Freenas: howto partition a disk

Freenas: howto partition a disk

Freenas: howto partition a disk 150 150 Roderick Derks

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

Roderick Derks

Liefhebber van fietsen, van het oplossen van IT puzzels, en van het delen van informatie om anderen te helpen.

All stories by:Roderick Derks

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

    Your Name (required)

    Your Email (required)

    Subject

    Your Message

      Your Name (required)

      Your Email (required)

      Subject

      Your Message