Make simple SAMBA file storage based on Minnowboard
We are using Minnowboard with Intel Atom E640T (http://www.minnowboard.org).
SATA 2.5" HDD HITACHI HTS542516K9A300 @ 160GB connected to Minnowboard (possible to connect 2 SATA).
At first, let's install SAMBA.
opkg install samba
After installing SAMBA, let's backup configs /etc/samba/smb.conf to /etc/samba/smb.conf_backup
cp /etc/samba/smb.conf /etc/samba/smb.conf_backup
Next step is configuring SAMBA with smb.conf ("how to" you can easely find in searching engines)
Next step is managing SATA HDD:
Welcome to fdisk (util-linux 2.23.1). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Command (m for help):
Need to press "d" button for select and delete partition.
After that, need to create GPT partition by pressing "g" button.
Need to create Linux partition. For that need to press "n" button and point whole size of HDD drive.
After last step, need to press "w" button and fdisk will save changes and close.
Now need to create ext3 file system. We used mkfs.ext3 command for that.
Now HDD ready for mount it.
mount /dev/sda1 /media/hdd
Let's create automatic mount point with /etc/fstab.
Need to add to end of file next string:
/dev/sda1 /media/hdd ext3 defaults 0 0
Do not forget to do "sync" command before press "Reset" button :)
Making Software RAID on Minnowboard.
For Software RAID we are used mdadm utility.
It has not in standard packages from Minnowboard Angstrom Linux repo, so we will build it on the board.
So we need to download sources of mdadm
.. and save to /home/root/ than unpack
tar -xzf mdadm-3.3.tar.gz
Than need to go to mdadm-3.3 dir and do "make" and "make install".
(Then we used this article as reference http://www.cyberciti.biz/faq/linux-creating-software-raid-one-arrays/)
How Do I Create RAID1 Using mdadm?
Type the following command to create RAID1 using /dev/sdc1 and /dev/sdd1 (20GB size each). First run fdisk on /dev/sdc and /dev/sdd with "Software Raid" type i.e. type 0xfd:
# fdisk /dev/sdc # fdisk /dev/sdd
See fdisk(8) man page to setup partition type. Do not format partition. Just create the same. Now, create RAID-1 as follows.
If the device contains a valid md superblock, the block is overwritten with zeros:
# mdadm --zero-superblock /dev/sdc /dev/sdd
Create RAID1 using /dev/sdc1 and /dev/sdd1
# mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdc1 /dev/sdd1
Format /dev/md0 as ext3:
# mkfs.ext3 /dev/md0
# mkdir /raid1 # mount /dev/md0 /raid1 # df -H
Make sure RAID1 get mounted automatically. Edit /etc/fstab and append the following line:
/dev/md0 /raid1 ext3 noatime,rw 0 0
Save and close the file.
How Do I See RAID Array Building Progress and Current Status?
Type the following command:
# watch -n 2 cat /proc/mdstat
# tail -f /proc/mdstat
Update /etc/mdadm.conf File
Update or edit /etc/mdadm/mdadm.conf or /etc/mdadm.conf (distro specific location) file as follows:
ARRAY /dev/md0 devices=/dev/sdc1,/dev/sdd1 level=1 num-devices=2 auto=yes
This config file lists which devices may be scanned to see if they contain MD super block, and gives identifying information (e.g. UUID) about known MD arrays. Please note that Linux kernel v2.6.xx above can use both /dev/mdX or /dev/md/XX names. You can also create partitions for /dev/md/XX as /dev/md/d1/p2.
How Do I Get Information On Existing Array?
Type the following command
# mdadm --query /dev/md0