Category Archives: Live CDs

FreeNAS Network Attached Storage Server – Part 3


In Part 1 I covered installing FreeNAS

In Part 2 I covered basic FreeNAS configuration, including adding disks

In Part 3 I am now going to cover some of the more advanced topics:

  • Setting up Software RAID
  • Users & Groups
  • File Management and the File Editor
  • Backing up your System Configuration

Setting up a Software RAID

NOTE:

In Parts 1 & 2 I had 256Mb of RAM configured for our FreeNAS server. If you are creating a software RAID, you will need to have at least 512Mb of RAM, otherwise you may experience unpredictable behaviour when creating the RAID.

FreeNAS supports many types of disk RAID Arrays including:

  • RAID 0
  • RAID 1
  • RAID5
  • RAID 0/1/5

See Wikipedia for more information on what each of these types of RAID offer in terms of protection against failure and performance.

JBOD is also supported but is not RAID, it stands for Just a Bunch Of Disks.

In addition to the drive FreeNAS is installed on, we have two hard disks in our FreeNAS Server which we are going to set-up as a Software RAID.

Follow the instructions in Part 2 in the section titled Adding Disks to FreeNAS, but before clicking Add, change the Preformatted file system to Software RAID. It should look something like the following screen-shot for the first disk which I’ve called Disk1. The choice of name is up to you!

Click Add and then repeat for the second disk, the Disks Management window should now look like the following

Click Apply Changes to put the disks online.

We are now ready to create our RAID.

From the menu bar select Disks > Software RAID. With RAID 1 selected (see screen shot below)

click on the + sign to create a RAID array.

Give the RAID a name, we will call it Disk in this example (see note later on).

Select the drives you want to be added to the array and then check the box titled Create and initialised RAID

Click Add. You will be taken to the previous screen where you newly created array is displayed.

Click Apply Changes. You should now get the following screen displayed

Note: in the following screen shot the RAID name was changed from Disk to RAD1

As we have chosen RAID 1 (disk mirroring) even though we used 2 x 2Gb hard disks, only 2Gb is available as usable storage. This is a feature of RAID 1.

The RAID Array now needs to be formatted.

From the menu bar select Disks > Format.

For Disk, select the RAID we have just created from the drop down menu.

Now give the volume a label, I this example we will call it RAID1

Now click Format disk to format the disk.

You will be asked to confirm your choice, click OK.

You will now see formatting information below the Format disk button similar to that below

Done! will appear once formatting has completed.

The final thing left to do is to mount the disk.

From the menu bar select Disks > Mount Point

Click on the + sign on the far right to add a new mount point.

Select the disk to mount in the Disk field and in the Mount point name field give it a name, we will call it DataRAID.

Click Add.

You should see the following in Disk Mount Point Management window

Click Apply changes to mount the disk.

To check the disk is mounted, click on System on the menu bar. You will see something like the following

Note: Although my ‘live’ FreeNAS server is a re-cased Compaq DeskPro EN Pentium 3 800MHz PC with 512Mb RAM, for this tutorial I created a Virtual FreeNAS server in Virtualbox. Hence the rather higher CPU specification!

With the disk mounted, you can now share it. Information on how to do this can be found in Part 2 of this series of FreeNAS articles.

Setting up RAID 5 is very similar, the difference is that at least three disks are required. Gary Sims, author of Learning FreeNAS which can be purchased online, has created a great video which you can view here on how to set-up RAID5 in FreeNAS.


Users & Groups

In Part 2 I touched upon creating a user account in the section Setting up a User Account to Remotely Access the Share. I will now cover this in a bit more detail in relation access permissions to Disk Mount points.

When you create a disk mount point, there is a section called Access Restrictions.

The defaults can be seen above, this is for my mount point called NASDisk1.

The owner is by default the account which created the mount point, normally Admin in FreeNAS. The Group, in this case wheel, restricts which group of users can access the mount point. The Mode section determines which collection of access permissions (Read, Write or eXecute) each category of user has, be it Owner, Group or Others.

From The FreeNAS menu bar select Advanced > File Manager and if asked to login login with your Admin account and password.

As FreeNAS runs FreeBSD, disk mount points are located in the /mnt directory. Open the /mnt directory by clicking on it.

On my FreeNAS server I have two disk drives and therefore two mount mount points, which like any Unix/ Linux OS take the form of a directory.

In the Perm’s column (short for Permissions) you will see the standard Unix Linux file permissions for the directory

Owner

Group

Other

r

w

x

r

w

x

r

w

x

r = Read w = Write x = eXecute

The above is prefixed with a ‘d’ if it is a directory, as with all PC operating systems, a directory is just a special type of file

Where permissions are absent, as in the following example for a file

the earlier table would look like the following

Owner

Group

Other

r

w

x

r

w

x

r

w

x

r

w

x

r

w

r

Which looks like this in File Manager

So, how does this all relate to users?

Well by default, if you create a directory using File Manager logged in as Admin, the default permissions are

drwxrwxr-x

When you create a user in FreeNAS, your primary group is Guest and no additional group is defined by default. Because your account is not the account which created the mount point i.e. Admin, you are therefore not the Owner and so Owner permissions do not apply.

As your account belongs to the Group guest, the Group the mount point belongs to is wheel, therefore Group permissions do not apply which means your account falls into the Other category. In this case this only allows you to Read and eXecute files but does not allow you to write!

There are two ways round this problem:

Either:

A. Change the mount point to it’s group matches that of the user, or better still change the group membership of the user to match the mount point. So make the user a member of the group wheel..

Or:

B. Login to File Manager with the account with which you wish to access the shares remotely, in this way that account is the owner of the directory and therefore has rwx access by default.

Note: It would not be advisable, for security reasons to change the permissions for Other to Write unless you were confident that allowing write access to all users was not going to be a problem, now or in the future.

For more information on Linux/ Unix file system permissions see Wikipedia

File Management

As we have already touched on File Management, it is worth covering it a bit more although there isn’t a massive amount to cover as it is mainly self explanatory.

The File manager supplied with FreeNAS is QuiXplorer which is a simple web based file manager.

You can:

  • create, copy, move and delete files and directories
  • change file and directory permissions
  • browse the FreeNAS file system
  • search for files
  • change users permissions

The last item is probably the most interesting as you can manage user passwords, set whether the user can see hidden files and the level of permissions they have for managing users. An account can also be disabled from this option.

File Editor

Also in the main FreeNAS menu under Advanced is the File Editor, which allows you to browse for a file, Load it, edit it and then Save it. It is by no means advanced, but a useful addition to the toolbox should you feel brave enough to edit FreeNAS configuration files directly!

Backing up your System Configuration

Whilst it is great ‘tweaking’ your FreeNAS system configuration either via the menus or directly using the editor, mistakes do happen and things can go horribly wrong, So it is worth while to backup your system configuration on a regular basis.

From the main menu, click on System > Backup / Restore. The following screen will be displayed.

Click on Download configuration, this will allow you to save your configuration file locally to your PC. It will not save it to the FreeNAS server disks for obvious reasons!

To restore your configuration, browse to where your backup file is stored and click on Restore configuration.

Finally, if all else fails, rather than re-install FreeNAS you can reset the server back to Factory defaults by selecting System > Factory defaults.

Use with care and best to backup your configuration before resetting.

In part 4 of this article, I’ll be looking at e-Mail notification and some of the additional services FreeNAS can run like BitTorrent, which I had to leave out of this article due to space!

=-=-=-=-=
Powered by Blogilo

Using Clonezilla with FreeNAS or Network Share to Backup a Hard Disk


If you’ve used Symantec Ghost http://en.wikipedia.org/wiki/Symantec_Ghost or Acronis True Image http://en.wikipedia.org/wiki/Acronis_True_Image then you will know how useful they are for making images of computer hard disks. Great for backing up all your data or even for disaster recovery. The down side is they are both expensive programs to buy and for us Linux users, not free (as in beer or as in speech).

Clonezilla http://en.wikipedia.org/wiki/Clonezilla is in my view as good as, if not better than, the closed source competition and is highly regarded by IT professionals. I use Clonezilla regularly to image PCs before doing a distribution upgrade and I image both Linux and Windows partitions. I also use it for backing up hard disk and for migrating data between disks. For the latter I use Clonezilla along with GParted Live http://gparted.sourceforge.net/livecd.php. to resize partitions after the cloned image is restored to a new (larger) hard disk.

Because it runs from a ‘live’ CD (ISO image obtainable from http://tinyurl.com/c2myn8) and will read most hard disk formats including NTFS, Clonezilla is OS agnostic. It can backup at partition level to another hard disk or to a USB hard disk, and as we shall see it can also back up to a network share, or in our case to a FreeNAS storage server*.

*See my earlier blog posts on installing and configuring FreeNAS http://preview.tinyurl.com/2eglwrm and http://preview.tinyurl.com/2978jqv .

Cloning a Hard Disk

Insert the Clonezilla ‘Live CD’ and boot the PC off the CD.

The following menu will be displayed.

Select the default option, and press the Enter key. Clonezilla will boot.

Eventually displaying the following “choose language” screen.

Select your language, then press the Enter key.

The “configuring console data” screen will appear

Accept the default and press the Enter key.

You will now be given two options, as we don’t want the command prompt, choose the default option Start Clonezilla and press the Enter key.

You will now get a screen asking if you wish to work with images or clone from one physical disk to another (duplicate). Choose the device-image option and press the Enter key.

You will now be asked where you are going to save the image to, as FreeNAS runs Samba, we will choose samba_server.

Press the Enter key.

Note: If you are not using FreeNAS, but are instead saving to a Windows or Linux Samba share, then you would still select this option.

You will now be asked to set-up a network IP address for Clonezilla so that it can connect to the network share.

As we have a DHCP server (in my case it is my DSL router) I’m going to select dhcp.

Press the Enter key to continue.

Once Clonezilla has obtained an IP address from the DHCP server, you will be asked for the IP address of the Samba server which contains the file share you wish to connect.

In my case the address is of the FreeNAS server is 192.168.1.252, yours is probably different.

Once you have entered the address, press the Enter key to continue.

You will be asked to provide the domain name, if you don’t have a domain name set you can leave this blank. In my case mine is called workgroup.

Press the Enter key to continue.

You will now be asked for a username to connect to the FreeNAS server, the offered name is Administrator. Replace this with a valid username for your network share. In my case I have a username of fernsm1 set-up on my FreeNAS server.

Press the Enter key.

You will then be asked for the destination directory, and will be offered the directory name of /images. Replace this with the name of your network share and the directory within that share you wish to save the image in to.

In my case this is /NASDisk1/images, remember that Unix and Linux operating systems are case sensitive. So if the share name is in upper case, make sure you write it in upper case!

UPDATE: 15/12/10

You can also enter the share name. So in my example the Samba/ CIFS share name is /DiskImages and you just enter what I’ve put in bold text. You may find this more reliable than specifying the actual path.

When done, press the Enter key.

The following screen will be displayed. This is a summary of what you have entered so far, and warns that you will now be asked to enter the password.

Press the Enter key.

At the bottom of the screen the following will appear.

The above is the command string being used to connect Clonezilla to the share.

Type in your password and press Enter.

If the following will be displayed, this means that Clonezilla has successfully connected to the FreeNAS server/ network share. if you get an error message at this stage, check the share name and/ or username/ password and start again.

Press the Enter key.

You now need to select the mode you wish to run Clonezilla in, a list of choices will be displayed

As we are creating an image of the PC, we will use the savedisk option. Select and press the Enter key.

You will then be asked for a name to give the image. By default Clonezilla gives a unique file name based on the date and time. When you have give a file name for the saved image, press the Enter key to continue.

You will now be asked to select the hard disk on the PC which you wish to clone. If you only have one hard disk, just press the Enter key. Otherwise use the cursor keys and space-bar to select/ deselect a disk..

You will now go through a number of screens offering “advanced extra parameters”. Accept the defaults on all.

Once completed, Clonezilla builds a command string should use wish to use it again without having to go through all the menus. In our case it should look similar to the following

Press the Enter key to continue.

Clonezilla will now start the cloning process, telling you what it is about to do and giving you the option to cancel.

If you are happy with the summary it provided, press y followed by the Enter key to continue.

Clonezilla will check the file system of the source PC to ensure okay and determine the cloning method it will use before it starts to clone the hard disk. If satisfied, it will then commence the cloning process.

Once the disk has been cloned, you will see something like this

Congratulations, you have successfully cloned your PCs hard disk to your FreeNAS network share.

Pressing Enter, will give you an options menu:

  1. Poweroff
  2. Reboot
  3. Enter command line prompt
  4. Start over

Warning: The default is option 2.

 

=-=-=-=-=
Powered by Blogilo

FreeNAS Network Attached Storage Server – Part 2: Configuration


In Part 1 we installed our FreeNAS Server on an old PC gathering dust in the corner of the office. In my case this is a Pentium III 800MHz Compaq Deskpro EN tower, maxed out with 512Mb of RAM and a Promise PCI SATA/ IDE card to manage large 250Gb+ hard disks. For FreeNAS this is quite a high spec PC as it can run with 256Mb RAM and a Pentium II CPU!

In Part 2 we are going to configure this PC into to a fully fledged NAS Server.

Configuring FreeNAS Server

Changing the Admin Password

This is the first thing we need to do, now the server is up and running.

From the FreeNAS menu bar, click on System > General and select the Password tab. Your old password is already entered for you, so enter your new password (twice) in the fields provided.

When done, click Save.

The following message will be displayed.

Note:

If you wish you can also change the username from Admin to something else, this can be done from the General tab under WebGUI section. In the Username field enter the name of the username you wish to use, go to the bottom of the page and click Save.

Set-up the File Sharing Service (CIFS/ SMB)

From the FreeNAS menu bar, click on Services > CIFS/ SMB.

Note:

SMB http://en.wikipedia.org/wiki/Samba_%28software%29 and CIFS http://en.wikipedia.org/wiki/Cifs allow Unix/ Linux, Apple OSX and Windows PCs to access the share.

Tick the Enable check box (top right of screen)

Scroll to the bottom of the screen and click on Save and Restart.

The screen should refresh and you should see

Adding the Disk(s) to FreeNAS

From the FreeNAS menu bar, click on Disks > Management, the following screen will be displayed

As we are adding a disk, click on the + symbol on the right.

Now from the Add window, click on the drop-down in Disk field, this will display all your “disk” devices including removable media, like my DVD ROM drive. FreeBSD (Unix) labels disks differently to Linux. ATA type disks (IDE/ SATA) are prefixed with ‘a’, followed by ‘d’ short for disk, CD devices are followed by ‘cd’. A number is allocated for each device, and the device information read to help you identify which device you are selecting.

In the above example, ad1 is a 8Gb IBM hard disk of which 128Mb was allocated to FreeNAS in part 1, the rest is available to use. The remaining ad devices are a 250Gb Hitachi SATA hard disk (ad6) and a 300Gb Maxtor IDE hard disk (ad8). We will select ad6 as our first disk to mount.

As I don’t wish my disks to spin when not in use (it’s good to try to save energy when setting up a NAS box), I’m going to set the Hard disk standby time to 10 minutes.

I’m also going to activate S.M.A.R.T. Hard disk monitoring as I will not be using a software RAID disk in this NAS configuration as I want to maximise my available disk space. Tick Activate S.M.A.R.T monitoring for this device.

Click Add to save the settings, you will be returned to the Disk Management screen. An information box will advise you to click Apply to apply the changes to the disk. Once clicked, the disk status will change from initialising to ONLINE.

Under the File System column, you will notice that the disk is showing as unformatted.

Format the Disk

To format the disk, from the FreeNAS menu bar select Disk > Format.

In the Disk field, select the disk you wish to format, in our example only one is listed because only one disk has been added to FreeNAS.

Give the disk a Volume label, this will be used to identify the disk. In our example, I’m calling this disk NAS1.

The completed screen should look like the following

As you will notice, I’ve headed the warning at the bottom of the screen and have kept the default UFS (Unix File System). You are now ready to format the disk, so press Format disk. You will be asked to confirm, click Okay.

The disk will be formatted and the lower half of the screen will fill the output of the format command (sets of random numbers). Once formatting has completed the word Done! will appear at the bottom of the list.

From the FreeNAS menu bar, click on Disks > Management, under the File System column, you will notice that the disk is now showing a UFS file system.

Mounting the Disk

Although the disk is online, and formatted it is not available to use as it has yet to be mounted. To mount a disk from the FreeNAS menu bar, click on Disks > Mount Point.


Click on the ‘+‘ sign on the far right, as you are going to add a disk. In the Mount Point Add screen, in the Disk section under Settings, select the hard disk you have just formatted. Now give it a Mount point name, I’m going to call it in this example NASDisk1.

If you wish you can also give it a description, in the description filed below.

Likewise, you can set the normal Unix/ Linux Read Write and eXecute permissions for different groups of users, set the owner, default is always root (administrator), and add the disk to a group. For our purposes, we will leave this as per the defaults.

See completed screen below

Click Add, you will be returned to the Mount Point Management window, where the disk will show a status of initialising. Click Apply Changes, the disk will be mounted and the status will change to OK.

Whilst in the window, you may notice there are two other tabs, Tools and Fsck. The former allows you to mount or umount (unmount) a disk and the latter which stands for File System Check is used to check the consistency of the Unix/ Linux file system, similar to chkdsk in DOS/ Windows.

Sharing the Disk

From the FreeNAS menu bar, click on Services > CIFS/ SMB. Click on the Shares tab, we are now going to share the disk so that it is available to access over the network.

Click on the ‘+‘ sign on the far right, as you are going to add a share.

Give a Comment for the share, this can be anything useful.

Give the share a name e.g. NASShare1.

In the Path field, you are now going to create the share. Click the browse button, a window similar to the following should appear

NASDisk1 is the mount point for the disk we created earlier. Click on it to select, and then click Okay.

The resulting screen should look something like

Click Apply changes.

You have now created your share on the network.

Accessing the Share over the Network

Now browser the network for the samba share using your file manager:

For Linux

In KDE Dolphin, or in GNOME Nautilus you can either browse your network for the Samba share or enter smb://192.168.1.252/NASShare1/ .

It is also possible to automatically mount a Samba share, for more information see https://help.ubuntu.com/community/SettingUpSamba .

For Windows

Open Windows Explorer or Start > Run and enter \\192.168.1.252\NASShare1.

As we have not set-up security on the share, no password is required, and therefore you should be able to browse you FreeNAS share, add and remove files.

You have now set-up your FreeNAS server Samba share.

Setting up a User Account to Remotely Access the Share

Whilst you can get away with having no user account set-up for remote access to the share, some programs expect a user account. One of them is Clonezilla, which I will be using in my next blog to image up a PC to the FreeNAS server.

To set-up the user account

From the FreeNAS menu bar, click on Access > Users and Groups. Click on the ‘+‘ sign on the far right, as you are going to add a new user.

In the Name field, enter the login name for this account.

In the Full Name field either give the users full name or a description of the purpose of this account

In the Password field, enter a password, (twice)

When complete click Add.

The above screen will appear, click Apply changes. You have now created an account to remotely access the share.

In Part 3, I will be looking at configuring some of the other more advanced features available in FreeNAS, including setting up a software RAID and configuring FreeNAS as a Bittorrent server.

=-=-=-=-=
Powered by Blogilo

How to Add Kernel Parameters to a CloneZilla ISO


CloneZilla is a great disk imaging distribution which uses a live CD. If you are a Windows (or ex-Windows) user and have used Norton Ghost then consider this to be the OpenSource version will knobs on!

The CloneZilla website can be found at http://clonezilla.org/.

As you will see from my earlier post “Linux Hell…..”, Linux has very poor support for the Via VT8251 SATA II controller which is very popular on AMD 64 bit Athlon motherboards. Whilst in most Linux distributions you can add boot parameters to the Kernel to overcome such issues, this is not possible with the CloneZilla ISOLINUX Live CD as there is no option (a possible oversight?).

The objective of this post is to add pci=nopmsi to the CloneZilla Linux kernel on boot to overcome the VT8251 compatibility issue and therefore use SATA II devices to run the Live CD and to save images on SATA II disks.

I’m going to break this tutorial down into two sections. Those who already have a Live CD and want to edit it, and those who already have an ISO image of the Live CD.

If you have the Live CD do part A and then Part B. If you already have the ISO file just do part B

PART A – Live CD!

We first need to convert the Live CD back to an ISO image file.

To do this we need to know the name of the device the CD is mounted from. An easy way to find out is to enter from terminal

nano /etc/fstab

You should see something like:

/dev/sdc0 /media/cdrom0 udf,iso9660……..

Exit Nano and with the above information enter:

dd if=/dev/scd0 of=$HOME/whatever.iso

change /dev/scd0 to whatever device the cd is in and whatever.iso to what you need to name it. $HOME means the image will be created in the root of your home directory. If you want to find out more about the dd (dataset definition) command see http://en.wikipedia.org/wiki/Dd_(Unix)

Press Enter to start the ISO file creation process.

When complete, go to the root of your home directory where the ISO image was created

PART B – EDIT the ISO using ISO Master

Installing ISO Master

If you don’t already have this program installed then enter from terminal

sudo apt-get install isomaster

Instructions on how to use it can be found on the Ubuntu Geek blog, it is very straightforward!

Note:

If you are using KDE, you will need to change the editor from mousepad to Kate by going into Tools > Options and changing the editor to kate.

Using ISO Master

  1. Choose the ISO image file you wish to edit, by selecting from the menu bar File > Open.
  2. Navigate to the /isolinux/isolinux.cfg file, right click on it and select Edit.
  3. Now search for the first line with initrd=.
  4. At the end of the line add pci=nomsi,
  5. Repeat step 4 for all lines until you get to the label FreeDOS.
  6. Stop and save the file.
  7. Close your editor.
  8. You will now need to save your modified ISO image file, so from the menu bar select File > Save As and give it a different name to the original. Once saved close ISO Master.
  9. Now burn the modified ISO image saved above to a CD or CD RW disk.

All being well, CloneZilla will now be compatible with the dreaded VT8251 controller, and you will be able to use your SATA II disks.

Enjoy!!

=-=-=-=-=
Powered by Bilbo Blogger