Welcome! Log In Create A New Profile

Advanced

Build your own Pro NAS – Seagate Goflex Net with Debian Linux, RAID1 and OpenMediaVault

Posted by DonCharisma 
This is posted on my blog, but thought it would be useful here too. Here's the link on my blog - http://doncharisma.org/2013/09/22/build-your-own-pro-nas-seagate-goflex-net-with-debian-linux-raid1-and-openmediavault/

Thanks to all the guys here for maintaining the forum and all of the invaluable information posted here, without it, I wouldn't have been able to do this:)

Cheers, Don Charisma, http://DonCharisma.com

FROM MY BLOG

The result of spending copious hours and days, knee deep in Linux IS - a working and stable 2TB NAS with Debian Linux based on Seagate GoFlex NET. Persistence and Charisma eventually paid off, ended up being a labour of love, but it was WORTH IT. This is a guide on how to do the same the EASY WAY.

WHY?

I like saving money and being green at the same time is a bonus.

Seagate GoFlex Net has two SATA ports for portable hard drives, it has a 1.2GHz processor and runs on just a few watts of electricity. For it's size it's powerful, expandable and green. Free market prices vary obviously, at the time of writing it's not expensive around £29 in UK, I guess that's $40 in USA. Total of around £130 for a two disk RAID1 NAS with a web based GUI for administration, off the shelf alternatives are maybe £200-£250. Ability to install any of the 25000 debian packages, priceless.

Seagate package this device with built in software from Pogoplug. Seagate in my experience are THE BEST hard drive manufacturer. However they tend to suck big style on the software they include with their hardware. Pogoplug on GoFlex Net is like putting a lawnmower engine in a Ferrari. It's OK for some consumers who don't want to know anything about the technical side, but really it's not much use for anyone serious. Also it poses some security issues, such as sharing data on Windows network without any password, meaning anyone who has access to your local network has access to your shared files.

I wanted a semi-portable NAS. Seagate GoFlex Net weighs only a few hundred grammes, hand luggage for travelling.

I didn't want to mess around too much with circuit boards, a finished device in a nice case fits the bill. GoFlex Net has a nice moulded plastic case.

I wanted the device to be a NAS, that is accessible on the Network so I don't have to mess around plugging and unplugging USB cables. GoFlex Net has gigabit ethernet port.

As I don't want to spend all my time knee deep in Linux commands, I wanted some kind of easy-to-use management interface. OpenMediaVault fits the bill, everything in one place.

I wanted RAID1 for integrity of my data. GoFlex Net has 2 SATA ports, so RAID 0 and 1 and also spanning possible.

HOW?

Looking around on the internet, I looked at various different devices. Perhaps a Raspberry PI, but doesn't have case or SATA interface for drives. Pogoplug? expensive and cheaper models don't have SATA.

Seagate GoFlex Net was the best I could find on a miser's budget and having the possibility of doing what I want it to do. I like the way the hard drives hot plug into the top of the device. Just a great design.

Stock software on GoFlex Net is Pogoplug, basically it's Pogoplug with a Seagate label on it. Searching internet revealed that other's had installed Arch Linux and Debian Linux on the device, and personally I have a preference for Debian Linux as I use Ubuntu and that's based on Debian.

Enter Jeff Doozan's website, www.doozan.com . They have posts and pages about specifically what I wanted to do, Debian on GoFlex Net and other ARM devices such as Pogoplug and Zyxel NSA320. It all sounded oh so simple in my research.

But it's never as straightforward in real life is it ?

It's taken me a lot of hours, weeks in fact to get to the point of having stable GoFlex Net with Debian Linux, OpenMediaVault and RAID1. And many many failed attempts !

This is a guide for how to do it, and sharing what I learn't along the way. If you want to build a similar device, then you'll be able to using this guide, the EASY WAY, avoiding the mistakes I made, saving time and stress.

Obviously if you follow this guide you do so at your own risk, and it's your responsibility to make sure that you're doing things correctly, not mine. GoFlex Net can be broken (aka bricked, foobared, door-stopper) if you don't use care and caution, ESPECIALLY when doing anything to do with the inbuilt NAND flash memory. Take care in what you're doing and you won't have a problem. Check everything carefully and check the references I've given to external sites.

What you'll need to do this

Don Charisma, doncharisma.com Toolbox
Tools
Mandatory

Seagate GoFlex Net

USB Flash Drive (not camera card eg SD), I use Sandisk Cruzer and Cruzer Fit

Ubuntu or other flavour of Linux, either running direct on a PC/Laptop or in a Virtual Machine

An SSH client program, Ubuntu has one or on Windows I use BitVise SSH Client.

Some time and patience and willingness to learn. A little bit of Linux knowledge extremely beneficial.

Optional

gparted GUI partion editor on Ubuntu

Portable/2.5" Hard Drive(s) - Seagate Hard Drives recommended, Backup Plus 1TB are a good fit and cheap at around £50 each


This is how we do it

STEP 1 - Get ssh access to GoFlex Net
STEP 2 - Make a bootable "rootfs" on USB drive
STEP 3 - Update the GoFlex Net inbuilt bootloader to boot from USB
STEP 4 - First boot from USB
STEP 5 - Install rescue system (optional but HIGHLY recommended)
STEP 6 - Install netconsole (optional but HIGHLY recommended)
STEP 7 - Install OpenMediaVault to USB
STEP 8 - Migrate your rootfs to SATA hard drive (optional)
STEP 9 - Setup RAID1 (optional)
STEP 10 - Do some cool stuff with the LEDS (optional)
APPENDIX - for reference, chrooting for kernel upgrade/change or troubleshooting
STEP 1 - Get ssh access to GoFlex Net

In order to do anything with your GoFlex Net you'll need to get command line access via ssh to the "root" user.

See GR3YH0UND'S BLOG on Prepare SSH Connection - http://morschi.com/2012/10/05/seagate-goflex-net-debian/

Basically, you'll probably need to go to pogoplug website (https://goflexnet.pogoplug.com/) , register yourself and your device and switch ssh access on in the "Security Settings" page. You could try connecting via ssh on your GoFlex Net fresh out of the box, would save you a step.

The login for your GoFlex Net is either "root/stxadmin" or "root/ceadmin" (pogoplug website - http://download.pogoplug.com/dev/linux.html)

In order to connect to GoFlex Net command line on ssh you'll need to either install an ssh client such as BitVise SSH (http://www.bitvise.com/ssh-client-download on Windows) or use ssh from a terminal window on Ubuntu (or however you want to do it !)

You'll need to IP address for your GoFlex Net, it will get one automatically from your router. You might see this if you explore the network in Windows (will have a name like "FADS265D34", or in your router's list of DHCP clients with an IP address on. For mine I have my router setup so it issues the same IP address to my GoFlex Net.

Once you've got ssh access, you can move to next step.

STEP 2 - Make a bootable "rootfs" on USB drive

First thing to note is that GoFlex Net is NOT supported with standard Debian kernel, in my experience it just won't boot. Also using either the Debian Squeeze or Wheezy install scripts (http://projects.doozan.com/debian/) from Doozan.com don't work and/or are broken, so just don't waste the hours trying, I did, and all I got was tired, frustrated and annoyed.

The MOST RELIABLE way I found of creating a bootable USB drive is to use rootfs from davygravy's post on doozan.com (http://forum.doozan.com/read.php?2,7806,7806,quote=1) download his package here - http://dl.dropbox.com/u/1015928/Kirkwood/rootfs_images/NSA320quickstart.tar.gz. You only need the "kirkwood-debian_rootfs.img" file, ignore the other files.

# to extract the archive in Ubuntu (or use WinRAR in Windows)
tar -xvzf NSA320quickstart.tar.gz
Next we need to prepare the USB Flash drive. Personally I reckon ext2 partition format is the best to use for flash drive. I think because of it's age it's the simplest and least likely to cause problems.

To do this I used gparted GUI on Ubuntu, you'll need to :

1. locate your USB drive in dropdown menu, will probably be /dev/sdb or /dev/sdc, be sure you've selected the correct drive !

2. delete existing paritions

3. create new partitions, I'd suggest first partition ext2 around 1GB (min 256MB) label "rootfs", second parition linux swap 256MB label "swap". You can move and resize these later if you so wish.

Now we need to put the rootfs onto the flash drive.

# On your Ubuntu/Linux machine , suppose your drive's partion1 /dev/sdb1 is mounted at /mntmount /dev/sdb1 /mnt
sudo -s
mkdir /media/debian
mount -o loop <path-to-kirkwood-debian-image_debian.img> /media/debian
cp -a /media/debian/* /mnt/umount /mnt
umount /media/debian
That's the USB drive created, with *working* rootfs, debian 3.3.2 kernel, Debian Squeeze distibution.

SIDE NOTE: It's possible to upgrade squeeze to wheezy on this installation with the 3.3.2 kernel. And I've also managed to install the 3.10.4 kernel by bodhi here. PLEASE DON'T UPGRADE KERNEL OR SQUEEZE TO WHEEZY IF YOU WANT TO INSTALL OPENMEDIAVAULT, Debian squeeze is needed by OpenMediaVault and the 3.3.2 kernel works fine.

STEP 3 - Update the GoFlex Net inbuilt bootloader to boot from USB

We need to do this so that we can boot from a USB flash drive, instead of being locked into Pogoplug software.

Update uboot

Be sure that you're ready and prepared for this stage as will actuall *WRITE* to the flash memory in the GoFlex Net. If you don't do it right you could brick your device here. So make sure power is on and will stay on during the procedure

# Procedure from "http://projects.doozan.com/uboot/
cd /tmp
wget http://projects.doozan.com/uboot/install_uboot_mtd0.sh
chmod +x install_uboot_mtd0.sh
./install_uboot_mtd0.sh
Restore old uBoot

This step is only for reference, DON'T ACTUALLY RUN IT NOW. Should you wish to revert to the original GoFlex Net/Pogoplug software, then you can use this procedure.

# Restore original uBoot
wget http://download.doozan.com/uboot/files/uboot/uboot.mtd0.goflexnet.original.kwb
flash_erase /dev/mtd0 0 4
nandwrite /dev/mtd0 uboot.mtd0.goflexnet.original.kwb
STEP 4 - First boot from USB

Take the USB Stick you've made and put into the USB port of the GoFlex Net. You'll need to power cycle the device.

If all's well you should see the GoFlex get an IP address from your router. In my router I have the IP address of the GoFlex Net mapped to a static IP address via the MAC address.

With the IP address you can see from router (or you've mapped against MAC address), connect via SSH client, login with "root/root".

Once your in you should see a prompt :

root@debian-kirkwood-wide:/#
Do a:

uname -a
this will show you the kernel version which should be davygravy's 3.3.2

You now have a working Debian Squeeze installtion, 3.3.2 kirkwood kernel.

If you're NOT ABLE TO BOOT, then it's possible BUT unlikely that you've bricked the device in STEP 3, if this is the case you'll need to get more involved with fixing this, and may involved UART or serial booting. I don't have any experience with this, so you'll need to sort this out, help can be found at forum.doozan.com, either post a question or look at other's questions.

More likely other reason why you're not able to boot are that your flash drive just doesn't work for whatever reason. I've had nothing but headache trying to boot from SD memory cards in generic reader, so not a good idea. From what I understand SD cards expect to be used with FAT16/FAT32 format and don't like working with any other filesystem, which seems to explain the problems I've had. I mentioned earlier that best results I've had from Sandisk Cruzer or Cruzer fit. These aren't the fastest devices but they do boot and seem to hold a Debian installation.

Another reason is that you've not created the rootfs properly. So I'd suggest try another flash drive and repeat the procedure for creating the rootfs on your USB drive.

STEP 5 - Install rescue system (optional but HIGHLY recommended)

If you don't install the rescue system, then you'll be forced to boot from the USB drive all the time. If the USB drive fails to boot then you will have to make another one to get into the device. My experience is that the USB drive installations will break after you've spent hours and hours configuring and installing. If you want any chance of repairing then booting into debian without a bootable USB drive would be a good idea. So this and a lot of frustrating hours are why I recommend you install the rescue system. For my purposes V2 rescue work fine. The procedure is described here by Jeff Doozan.

IMPORTANT, this procedure will write to the Flash in your GoFlex Net, so have everything ready advance and make sure power won't go off.

So either you're in your ssh from USB drive that's booted your davygravy's rootfs or you need to boot into it, then :

cd /tmp
wget http://jeff.doozan.com/debian/rescue/install_rescue.sh
chmod +x install_rescue.sh
./install_rescue.sh
Reboot without the USB stick attached and you should boot into the rescue system. Then reboot with the USB attached and you should boot into davygravy's rootfs.

STEP 6 - Install netconsole (optional but HIGHLY recommended)

Without netconsole, you can't monitor the boot process (well at least the bits up until Kernel is loaded). It's a bit of extra effort, but it will help you debug if the USB stick is not booting. Netconsole procedure is described by Jeff Doozan here - http://forum.doozan.com/read.php?3,14,14

Netconsole

On the Goflex NET, you'll need to setup some environment variables for the uBoot loader. These are written into the internal flash, so be VERY VERY careful you get this right. CHECK, DOUBLE CHECK and TRIPLE CHECK anytime you are flashing internal flash or doing anything with it.

On the GoFlex Net:

# serverip is the machine that you will monitor on, ipaddres is the address of your GoFlex Net
# my Ubuntu machine I use to monitor is 10.10.10.203 and my GoFlex Net is 10.10.10.231

fw_setenv serverip 10.10.10.203
fw_setenv ipaddr 10.10.10.231
fw_setenv if_netconsole 'ping $serverip'
fw_setenv start_netconsole 'setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;'
fw_setenv preboot 'run if_netconsole start_netconsole'
On the desktop machine (Ubuntu - 10.10.10.203)

nc -u -l 6666 &
nc -u 10.10.10.231
You'll need to reboot in order for these settings to take effect. I've got into the habit of doing this :

# for some linux installations
sync
shutdown -h now

# or on some other linux installations
sync
halt
Reason for doing this is to make sure any cached data is written to disk and propertly shutdown the operating system.

STEP 7 - Install OpenMediaVault to USB

OpenMediaVault installation was fairly straightforward, although had to do some digging around on forums ! This thread - http://forums.openmediavault.org/viewtopic.php?f=12&t=514 on OMV forum is now out of date, but forms that basis of how to do it.

Update sources.list file

It's good practice to do this on any installation of Debian, and will speed up any installations and updates because hopefully you'll find mirrors that are close to you. Please refer to Debian worldwide mirrors full list to get yours.

vi /etc/apt/sources.list
This is what yours will look like:

root@debian-kirkwood-wide:/# cat /etc/apt/sources.list
deb http://security.debian.org/ squeeze/updates main contrib non-free
deb-src http://security.debian.org/ squeeze/updates main contrib non-free
deb http://ftp.debian.org/debian/ squeeze main contrib non-free
deb-src http://ftp.debian.org/debian/ squeeze main contrib non-free
As I'm based in Asia, this is what mine looks like after editing:

deb http://ftp.th.debian.org/debian-security/ squeeze/updates main contrib non-free
deb-src http://ftp.th.debian.org/debian-security/ squeeze/updates main contrib non-free
deb http://ftp.th.debian.org/debian/ squeeze main contrib non-free
deb-src http://ftp.th.debian.org/debian/ squeeze main contrib non-free
Now we need to update the out Debian installation to latest version of Squeeze, and install xmlstartlet. For some reason the xmlstarlet used by OMV comes from debian Wheezy (but OMV isn't stable on Wheezy), so we also need to install xmlstarlet, then upgrade it to a later version manually.

apt-get update
apt-get upgrade
apt-get install xmlstarlet
Get xmlstarlet 1.5.0-1 and install it:

wget http://ftp.us.debian.org/debian/pool/main/x/xmlstarlet/xmlstarlet_1.5.0-1_armel.deb
dpkg -i xmlstarlet_1.5.0-1_armel.deb
Now do a HARD reboot, sync, shutdown and then power cycle.

sync
shutdown -h now
You should have rebooted and be back at your ssh prompt.

Now I change the hostname, my GoFlex Net is called "GoFlexNet1", you can call yours what you want.

root@debian-kirkwood-wide:~# cat /etc/hostname
debian-kirkwood-wide
root@debian-kirkwood-wide:~# echo "GoFlexNet1" > /etc/hostname
root@debian-kirkwood-wide:~# cat /etc/hostname
GoFlexNet1
Now we update our hosts file and tell it what out IP address is. I'd recommend setting this in your router as mentioned earlier. If you want a static IP address then you'll need to configure your /etc/network/interfaces or do it via the OMV interface.

root@debian-kirkwood-wide:~# cat /etc/hosts
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

root@debian-kirkwood-wide:~# vi /etc/hosts
root@debian-kirkwood-wide:~# cat /etc/hosts
127.0.0.1 localhost
10.10.10.231 GoFlexNet1
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
Now do a HARD reboot, sync, shutdown and then power cycle.

sync
shutdown -h now
Now we need to setup /etc/apt/sources.list.d/openmediavault.list so that OMV knows where to look for it's files, install the OMV keys, install OMV and restart the Apache server.

OMV installer will ask questions, so don't stray too far:

about mail server (I didn't bother will setup later)
RAID arrays, I don't think GoFlex can boot from RAID so no point starting the RAID early, if you are planning to use RAID then you'll need to start the arrays, OMV will do this for you
echo "deb http://packages.openmediavault.org/public fedaykin main" > /etc/apt/sources.list.d/openmediavault.list

# the first apt-get update will throw an error, thats why we install the openmediavault-keyring

apt-get update
apt-get install openmediavault-keyring
apt-get update
apt-get install openmediavault
service apache2 restart
DO NOT REBOOT, YET ! First we need to setup a couple of things, especially re-enabling the now disabled ssh.

First go to your internet browser firefox chrome etc, my page is http://10.10.10.231

Login to the OMV web interface using "admin/openmediavault", and setup the following :

enable ssh /permit root
general settings - session timeout 0 (nothing more annoying than having to re-login every 5 minutes)
date & time
*Shutdown using OMV web interface and power cycle.*

Go to browser and again login to OMV web interface and do:

update manager - update to 0.4.37
*Shutdown using OMV web interface and power cycle.*

At this stage I attached an SATA hard disc and tried to boot from USB. No joy, doesn't boot. This problem is described here reply here. Basically uBoot and the kernel loaded from USB disagree on where the rootfs is. The solution provided by bodhi is to force uBoot and the Kernel to boot from a partition called "rootfs".

So remove the SATA drive and reboot, then do this :

# USE CAUTION, updates internal flash
fw_setenv usb_bootcmd 'run usb_init; setenv usb_root LABEL=rootfs; run usb_set_bootargs; run usb_boot'
Now insert SATA drive again

*Shutdown using OMV web interface and power cycle.*

You should now have a working OpenMediaVault on your USB Flash Drive, that you can boot with SATA drives attached.

You may wish to leave configuration like this and continue booting off the USB flash drive, that's fine if you trust the USB flash drive and do regular backups of the USB drive. Advantage of booting from USB flash drive is that you can use the whole of your SATA drives for data and setting up RAID is slightly simpler, because you can RAID the whole drives. Disadvantage is that I'm not convinced of the longevity of a USB flash drive for linux installations, so it's possible it will break at some point. Also your USB port is now tied up, so attaching anything else to USB port is more complicated.

One solution to make this more reliable would be to boot off a USB hard disc, and you'd still be RAID the whole drives, but USB port still occupied.

My solution is to boot off of one of the SATA attached drives, which is what I'm not going on to describe next. Downside is that RAID has to be manually setup and so do the partitions.

STEP 8 - Migrate your rootfs to SATA hard drive (optional)

I've already given my reasons for wanting to do this, basically I believe that this is more stable and reliable.

First we need to partition the drive(s), I used gParted GUI in Ubuntu, but Linux heads feel free to command line it. I've made my rootfs just a bit smaller than a 4GB flash drive so that I could just copy it onto flash drive for backup, and also allows for logs to grow and any updates that may happen later. So here's my layout

Partition1 -> size=3800MiB -> format to ext3 -> label = "rootfs_hd"

Partition2 -> size=512MiB -> format to linux-swap -> label="swap"

Partition3 -> size=The rest of the disk -> unformatted -> label=""

Do the same for both disks if you have two, partition1 on second disk I labeled "backup_rootfs_hd". Also make a mental note of which disk is "master" (the one to boot from) and which is "backup"

Now you need to copy the rootfs that you've created on your USB flash drive to your "master" hard disk. Ubuntu is quite helpful in mounting drives so they may already be mounted, otherwise you'll need to do it manually

# assuming "master" hard disk rootfs is /dev/sdc1 and usb flash drive rootfs is /dev/sdd1
mkdir /media/hd_rootfs
mkdir /media/usb_rootfs
mount /dev/sdc1 /media/hd_rootfs
mount /dev/sdd1 /media/usb_rootfs
cp -a /media/usb_rootfs/* /media/hd_rootfs
So you should now in theory have a bootable hard drive. BUT there is one step left, your uBoot isn't yet configured for SATA booting. How to set this up was described by varkey here. Basically we need to set some variables for uBoot, so again be careful doing this.

fw_setenv sata_boot 'ide reset; mw 0x800000 0 1; ext2load ide 0:1 0x800000 /boot/uImage; if ext2load ide 0:1 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi'
fw_setenv sata_bootcmd 'run usb_set_bootargs; run sata_boot'
fw_setenv bootcmd 'usb start; run force_rescue_bootcmd; run ubifs_bootcmd; run usb_bootcmd; usb stop; run sata_bootcmd; run rescue_bootcmd; run pogo_bootcmd; reset'
Now that you've done that you can try to boot from the hard disk and it should work.

STEP 9 - Setup RAID1 (optional)

If you've got this far then well done !

My discs where mounted /dev/sda /dev/sdb. The partitions I wished to RAID1 where around 950GB each /dev/sda3 /dev/sdb3. I used &lt;a href="http://linuxconfig.org/linux-software-raid-1-setup"&gt;this guide&lt;/a&gt; here loosely as a reference for this, but note his is quite a different setup.

First of all find out what your partitions are labeled, and have a look where rootfs_hd is mounted which well tell you which is master and which is backup.


# list all partitions on disks
sfdisk -l

# check mounts, where rootfs is mounted
mount -l
Now the unformatted rest-of-disk partitions we created earlier need to have their partition type switched to "linux raid autodetect", and then list all partitions again so we know they've been updated.

#change partition type of partition 3 to fd (linux raid autodetect)
sfdisk -c /dev/sdb 3 fd

#change partition type of partition 3 to fd (linux raid autodetect)
sfdisk -c /dev/sda 3 fd

# list all partitions on disks
sfdisk -l
Now you're going to create the array. Once created it will immediately do a resync, and this will take 3-4 hours. I didn't think about it ahead of time so I had no choice but to wait, and I reckon it's not a bad idea to let the RAID system check the disks, as I don't want a bad disk in my array. If you know what you're doing and are confident about it, consider using the --assume-clean flag, which avoids doing a resync and saves time. The downside I reckon is that you don't get your disks checked. Up to you, see here for more details.

# create raid device (consider using --assume-clean)
#
mdadm --create md1 --level=1 --raid-devices=2 /dev/sda3 /dev/sdb3
mdadm: Note: this array has metadata at the start and
may not be suitable as a boot device. If you plan to
store '/boot' on this device please ensure that
your boot-loader understands md/v1.x metadata, or use
--metadata=0.90
Continue creating array? y
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md/md1 started.

RESYNC will take around 3-4 hours for 1TB drives, so be patient, montior and don't reboot or poweroff whilst it's being done. You can continue doing things, but anything you do on the drives will temporaily pause the resync and it will take longer. You can continue setting up filesystem etc, just don't copy a bunch of data in until the resync has finished.

As you can see my array is called /dev/md/md1 and also it seems /dev/md127 (not quite what I was expecting !). It seems that these device iditifiers are interchangable, OMV will use the md127 one.

These commands will tell you about the array and you'll be able to find your md127 device in "ls /dev"

ls /dev

#basic details of raid
mdadm /dev/md127

#detailed details of raid
# http://www.ducea.com/2009/03/08/mdadm-cheat-sheet/
mdadm --detail /dev/md127
#or
cat /proc/mdstat
Next we need to make the filesystem on the array

#make the file system ext3

mkfs.ext3 /dev/md127
Lastly as described here , label your array, I've called mine "raid1"

#label the raid 1 array
#
tune2fs -L raid1_data /dev/md127
Your RAID1 array should now be configured and "seeable" in OMV web interface. Obviously once it's finished resyncing power down using OMV and power cycle. Then you can start using it:)

Optional Bonus !

If you want to manually backup your live rootfs from one master to backup, you already have partitions in place for this. Use this procudure :

#backup rootfs
mkdir /tmp/backup
mount /dev/sdb1 /tmp/backup
cd /tmp/backup
mkdir rootfs_backup
rsync -aAXv /* /tmp/backup/rootfs_backup --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found}
This means that in the event that your master disk dies then you have a backup that you can boot into on the "backup" disc. I don't know how best to automate this, and whether wise to automate. Probably best to run prior to any updates, and maybe once a week or so.

STEP 10 - Do some cool stuff with the LEDS (optional)

Getting the LEDs giving some feedback about what's going on, seemed to be a nice-to-have, but since implimenting this I've found that it's invaluable. So I'd suggest strongly consider doing this. There's several things I wanted to get feedback on :

1. Disk and CPU activity

2. When is it "safe" to disconnect the power at shutdown

3. Network activity

I wasn't able to get network activity working, I think it may be possible with the "sar" command that comes with iostat. The method with iptables didn't work, I'm assuming because the davygravy kernel I'm using isn't setup for it. Happy for any readers to report back how to do this.

For Disk and CPU, the iostat command is perfect. I did a post on Doozan forum here -http://forum.doozan.com/read.php?2,13561. I use an awk command to process the output of iostat, and then feed this to the LEDs. You could change the position of the LEDs to suit your own particular scenario.

Here's what the LEDs are assigned to :

doncharisma, don charisma, Seagate GoFlex Net LEDs
Seagate GoFlex Net LEDs
Here's how we do it:

You'll need to install the systat package :

# for iostat
apt-get install sysstat
Now we need to edit the /etc/rc.local file like so :

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# For LED control on Seagate GoFlex Net that's been Debianised
# (c) Don Charisma 2013

iostat -z 1 | awk -W interactive '
BEGIN { sda="none";
		sda_prev="none";
		sdb="none";
		sdb_prev="none";
		md1="none";
		md1_prev="none";
		cpu20="none";
		cpu20_prev="none";
		cpu40="none";
		cpu40_prev="none";
		cpu60="none";
		cpu60_prev="none";
		cpu80="none";
		cpu80_prev="none";
		cpu_utilise=0
	  }
# if hard drives or RAID active, set flag for LED
/sda/ {	sda="timer"; }
/sdb/ {	sdb="timer"; }
/md1/ { md1="default-on"; }
# Find the line with CPU info, pick the last number = percentage idle
# subtract it from 100 to give CPU utilisation
/\..*\..*\..*\..*\..*\..*/  { cpu_utilise = 100 - $6;
				if (cpu_utilise >= 20.0) { cpu20="default-on"; }
				if (cpu_utilise >= 40.0) { cpu40="default-on"; }
				if (cpu_utilise >= 60.0) { cpu60="default-on"; }
				if (cpu_utilise >= 80.0) { cpu80="default-on"; }
				}
/Device:/ { if (sda != sda_prev)
				{ print sda > "/sys/class/leds/status:white:left0/trigger";
			      fflush( "/sys/class/leds/status:white:left0/trigger" );
				}

			if (sdb != sdb_prev)
				{ print sdb > "/sys/class/leds/status:white:left1/trigger";
				  fflush( "/sys/class/leds/status:white:left1/trigger" );
				}

			if (md1 != md1_prev)
				{ print md1 > "/sys/class/leds/status:white:left2/trigger";
				  fflush( "/sys/class/leds/status:white:left2/trigger" );
				  print md1 > "/sys/class/leds/status:white:left3/trigger";
				  fflush( "/sys/class/leds/status:white:left3/trigger" );

				}
			if (cpu20 != cpu20_prev)
				{ print cpu20 > "/sys/class/leds/status:white:right0/trigger";
				  fflush( "/sys/class/leds/status:white:right0/trigger" );
				}

			if (cpu40 != cpu40_prev)
				{ print cpu40 > "/sys/class/leds/status:white:right1/trigger";
				  fflush( "/sys/class/leds/status:white:right1/trigger" );
				}

			if (cpu60 != cpu60_prev)
				{ print cpu60 > "/sys/class/leds/status:white:right2/trigger";
				  fflush( "/sys/class/leds/status:white:right2/trigger" );
				}

			if (cpu80 != cpu80_prev)
				{ print cpu80 > "/sys/class/leds/status:white:right3/trigger";
				  fflush( "/sys/class/leds/status:white:right3/trigger" );
				}

			sda_prev=sda;
			sda="none";
			sdb_prev=sdb;
			sdb="none";
			md1_prev=md1;
			md1="none";
			cpu20_prev=cpu20;
			cpu20="none";
			cpu40_prev=cpu40;
			cpu40="none";
			cpu60_prev=cpu60;
			cpu60="none";
			cpu80_prev=cpu80;
			cpu80="none";

}
END { print "The end"; }
' &

exit 0
Now for shutdown/halt LEDs, to make green LED go off and the white LEDs to blink, we need to make a change to the /etc/init.d/halt file, here's how the section of mine that I changed looks :


# Make it possible to not shut down network interfaces,
# needed to use wake-on-lan
     netdown="-i"
     if [ "$NETDOWN" = "no" ]; then
     netdown=""
     fi

# for goflex green led
     echo none > /sys/class/leds/status\:green\:health/trigger

# for goflex white leds
     echo timer | tee /sys/class/leds/status\:white\:*/trigger > /dev/null

log_action_msg "Will now halt"
     halt -d -f $netdown $poweroff $hddown

}
That's it your done, enjoy:)

APPENDIX - for reference, chrooting for kernel upgrade/change or troubleshooting

This procedure was posted by tuxuser in doozan.com forums here - http://forum.doozan.com/read.php?2,9256,9957#msg-9957. I've made some slight edits.

In the event that your USB flash drive won't boot, you should still be able to get your GoFlex Net running via the rescue system. You can then chroot into the rootfs on your USB drive, and perhaps make repairs, look at logs, maybe fix the problem.

Also if you want to change kernel, it has to be done via chroot, you can't change a live kernel. The procedure here is for changing kernel, if you just want to chroot into your installation, stop once you're chroot'ed.

Once you've booted into the rescue system, this would be "a" procedure to change the kernel.

# Mount roofs
mkdir /tmp/wheezy
mount /dev/sda1 /tmp/wheezy
cd /tmp/wheezy
# Prepare chroot-environment
mount -t proc proc proc/
mount -t sysfs sys sys/
mount -o bind /dev dev/
mount -t devpts pts dev/pts/
chroot /tmp/wheezy /bin/bash

# Now here we go with the kernel install
#Dependencies for a https wget
apt-get update apt-get install dialog ca-certificates openssl
wget https://dl.dropbox.com/sh/nwt2kbvetvgvroo/661x9b5PLg/Kirkwood/kernel/linux-image-3.3.2-kirkwood-dg_1.1_armel.deb?dl=1 -O linux-image-3.3.2-kirkwood-dg_1.1_armel.deb

# Safety
cp -r /boot /boot-backup

# flash-kernel never installed for me successfully for me -> removing postinstall-script, otherways update-initramfs will bug around
rm /etc/kernel/postinst.d/zz-flash-kernel

# Install Kernel
dpkg -i linux-image-3.3.2-kirkwood-dg_1.1_armel.deb

# Build proper uboot images (neccessary because uBoot has to boot from images)
cd /boot
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-3.3.2 -d vmlinuz-3.3.2-kirkwood-dg uImage
mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initramfs-3.3.2-kirkwood-dg -d initrd.img-3.3.2-kirkwood-dg uInitrd

# Exit chroot
exit
# Unmount chroot-environment
umount /tmp/wheezy/dev/pts
umount /tmp/wheezy/dev
umount /tmp/wheezy/sys
umount /tmp/wheezy/proc cd /
umount /tmp/wheezy

#Reboot
init 6
TO DO

I'd like to get LEDs to respond to network traffic. I saw a post here - http://forum.doozan.com/read.php?2,4638,4645 relating to this, well I couldn't get the iptables thing to work, not sure why as yet. Wasn't able to think of another Linux tool to use to detect network traffic or not, since the iptables command gives an error. Perhaps the sar tool would do.

I think I will also try changing the RAID system to RAID10,f2 as described here - https://raid.wiki.kernel.org/index.php/Preventing_against_a_failing_disk. I wasn't aware when I started this of RAID10,f2, which is why I used RAID1. RAID1 has the possibility of being faster than a single disk for reads but in practice for a single client connection, you're reading off a single disk, probably the master. RAID10,f2 however can be setup on just 2 discs, and the data is organised in such a way that data can be read off of both disks at the same time to serve a single client.

Also like to get the swap partitions RAID'ed, maybe the rootfs, although there are reasons for not RAIDing the rootfs.

I might build my second unit the same, but use NTFS drives mirrored using rsync, for flexibility in plugging them into my Windows machines.

The netconsole is great up until the kernel starts booting, but then I'm not getting any messages from the booting system. It's possible to get these boot messages sent via netconsole, but requires fiddling with the kernel as described here - http://forum.doozan.com/read.php?2,9522,11046. I think I will try and add this as difficult to debug boot problems without it.

Confusion and Conclusion

In total I must have spent a month working on this, it looks easy but isn't. Hopefully this guide has taken out a lot of the donkey work and hair pulling, and you may be able to do it in a day:)

Building a NAS that's on a par with devices costing far more is entirely possible. Just a case of persistence and willingness to learn.

My GoFlex NET has now been running a couple of weeks and seems stable enough with OpenMediaVault and my two 1TB RAID1 disks. Performance wise I'm happy enough, only bottleneck I've found so far is the Samba daemon which is using a lot of CPU when I copy files over the network onto the RAID array. But still I'm getting around 20MB/s which is OK.

Thank you to all the guys at doozan.com forum, Jeff, vlad, davygravy, bohi, varkey, Gr3yh0und and others, your forum and blogs have been invaluable resources. Also a big thanks to the developers of OpenMediaVault, I really hope that their project is going to continue and get better and better, amazing work.

I'm happy to answer any questions, if I can, but best place to ask really is register at doozan.com forum and ask there, other people may have same problem and be looking on Jeff's forum.

If anyone from Seagate reads this, then yes I'd be happy to work as a consultant, build for you some decent software for your products.

Let me know of any feedback or errors, so that I can update this post.

Happy Debian'ing and NAS'ing:)

by Don Charisma

Resources and Sources

DonCharisma, LEDs on GoFlex Net - http://forum.doozan.com/read.php?2,13561

Davygravy's rootfs, (Zyxel NSA320 : basic support for Debian installation) - http://forum.doozan.com/read.php?2,7806

How to extract a .tar.gz file - http://askubuntu.com/questions/25347/what-command-do-i-need-to-unzip-extract-a-tar-gz-file

Gr3yh0und on Debian/GoFlex Net - http://morschi.com/2012/10/05/seagate-goflex-net-debian/

Rescue System v2 - http://forum.doozan.com/read.php?4,3896

Dockstar Rescue Linux - http://www.rudiswiki.de/wiki9/DockStarRescue

OMV on Pogoplug - http://forums.openmediavault.org/viewtopic.php?f=12&t=514

Debian Sources Mirrors Worlwide - http://www.debian.org/mirror/list-full

(In German) OMV on GoFlex - http://forums.openmediavault.org/viewtopic.php?f=12&t=2552

USB when hard drives attached boot issue, http://forum.doozan.com/read.php?3,9398

Varkey on booting Debian from SATA GoFlex Net - http://www.varkey.in/2011/06/boot-debian-from-sata-seagate-goflex-net/

A post about setting up linux RAID1 - http://linuxconfig.org/linux-software-raid-1-setup

A post about Inital Array Creation - https://raid.wiki.kernel.org/index.php/Initial_Array_Creation

Preventing against a failing disk, RAID 10,f2 - https://raid.wiki.kernel.org/index.php/Preventing_against_a_failing_disk

How to label linux partitions - http://www.cyberciti.biz/faq/linux-partition-howto-set-labels/

Chrooting - http://forum.doozan.com/read.php?2,9256,9957#msg-9957

Howto: Getting network LED working with firewall - http://forum.doozan.com/read.php?2,4638,4645

Howto: Create Debian rootfs image for your GoFlex/Dockstar via debootstrap on a Ubuntu/Debian PC - http://forum.doozan.com/read.php?2,5986,6221

GoFlex Net: Boot from USB while SATA disks connected - http://forum.doozan.com/read.php?3,9398

Full System Backup with rsync - https://wiki.archlinux.org/index.php/Full_System_Backup_with_rsync

DockstarDebianSqueeze (In German) - http://www.mikrocontroller.net/articles/DockstarDebianSqueeze

Front LED (In German) - http://www.mikrocontroller.net/articles/Dockstar#Front_LED_ansprechen

Newer uBoot as workaround to 3.2 kernel problem - http://forum.doozan.com/read.php?3,6965

OBIHOERNCHEN'S BLOG, Posts tagged GoFlex (see for LED info) - http://obihoernchen.net/wordpress/tag/goflex/

Redirect stdin stdout to multiple files - http://www.unix.com/unix-dummies-questions-answers/124609-redirect-stdin-stdout-multiple-files.html

How can I send stdout to multiple commands? - http://unix.stackexchange.com/questions/28503/how-can-i-send-stdout-to-multiple-commands

want leds to change to hard drive activity - http://archlinuxarm.org/forum/viewtopic.php?t=2899

Ten(ish) steps to set up a dockstar - http://archlinuxarm.org/forum/viewtopic.php?f=18&t=289

Pogoplug root password (Linux Developers) - http://download.pogoplug.com/dev/linux.html

Review Seagate FreeAgent GoFlex Net Media Sharing Device - http://www.notebookcheck.net/Review-Seagate-FreeAgent-GoFlex-Net-Media-Sharing-Device.37033.0.html

Linux Kernel 3.10.4 Kirkwood package and rootfs (Non Flattened Device Tree) - http://forum.doozan.com/read.php?2,12096

Use netconsole to troubleshoot uBoot without a serial cable - http://forum.doozan.com/read.php?3,14,14

Kernel install fails with Wheezy script - http://forum.doozan.com/read.php?2,9256

Howto: Getting network LED working with firewall - http://forum.doozan.com/read.php?2,4638

[How To] Use netconsole to troubleshoot Debian kernel booting - http://forum.doozan.com/read.php?2,9522

Proper LED Setup - http://dev.shyd.de/2012/01/kernel-3-1-10-ready-to-use/



Edited 4 time(s). Last edit at 09/28/2015 03:25PM by DonCharisma.
very nice article! thanks a lot!
My pleasure, happy it's useful:)
i've had 0.4 running on the goflex home for a while. i like the new 0.5 version and am trying to install it to run on the gfh. i worked my way through the procedure an get as far as installing omv but it fails for unmet dependencies: php5-proctitle

the php5-proctitle deb package is available for x64 and i386 but not armel. i found what I think is the source code for php5-proctitle on the omv site.

any ideas how to get it to work with omv 0.5?
is it possible to compile and package php5-proctitle on the goflex without having to cross-compile?
any suggestions?
any ideals?
any help with compiling php5-proctitle?

and i suspect php5-proctitle won't be the only package that is missing for armel.

root@GoFlexHome:~# apt-get install openmediavault
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 openmediavault : Depends: php5-proctitle but it is not installable
E: Broken packages

in case someone should ask: my reason for wanting to do this is jollies
Reposted from http://DonCharisma.com

Hey maihoaomv,

Don't worry about posting in multiple places, the info for this is very much distributed anyway and no one would blame:)

Interestingly I had the *exact* same problem with OMV 0.5 in my attempt to install. In short the conclusion I came to was that it isn't at this moment compatible with armel. ie I gave in, in favour of a working solution, against a distant perhaps possible solution.

Solutions :

1. Wait until Debian make php5-proctitle available for armel. You could pester them, maybe it's almost done ?
2. Ask OMV guys if they know a work around, or whether OMV would use a different package, or be hacked not to use php5-proctitle
3. Compile to package yourself for armel ... sorry I don't know how to do this, but I suspect it's possible, don't know how hard or how long it would take. Only experience I have with Linux compilation is the reg.db for wireless, which wasn't too difficult with a tutorial. There are guides I know on doozan.com for recompile kernel, but don't know if compiling the php5-proctitle package would be similar procedure. Best source of help with this probably doozan.com

Very hard to say at this stage whether php5-proctitle is the only obstacle, it was probably 5-6am when I gave in and didn't plan on re-exploring !

I will repost this doozan.com and OMV forums, hopefully someone who knows more than me will chip in:)

Cheers

Don Charisma
Re: Build your own Pro NAS – Seagate Goflex Net with Debian Linux, RAID1 and OpenMediaVault
September 28, 2013 04:57PM
Do you guys have link for source code for php5-proctitle ? it should be doable.

-bodhi
===========================
Forum Wiki
bodhi's corner
hi bodhi
with some help from the guys over on the omv forum i was able to compile and build the php5-proctitle package on the goflex home. in order to install pph5-proctitle it requires the installation of pph5. once i did that it installs and fixes that problem but i ran into another problem towards the end (i think) with mdadm arrays and collectd configure. don't know what is going on yet. i told the install script not to configure an array or try to start it but for some reason it fails. i didn't have this problem when i installed it in the virtual machine or on the i386 hardware. the collectd conf file looked virtually the same as the ones on both working installs.

currently i'm looking at how a deb package is structured in hopes that i can get a clue as to what may be going wrong and how i might be able fix or get around the problem. deb packaging is unfamiliar to me so i'm kinda hacking my way through it.

anyway enough rambling ............ this is the error i get now.

Quote

update-initramfs: deferring update (trigger activated)
Setting up libdevmapper1.02.1 (2:1.02.48-5) ...
Setting up libparted0debian1 (2.3-5) ...
Setting up lvm2 (2.02.66-5) ...
Setting up LVM Volume Groups[ 1560.335679] device-mapper: uevent: version 1.0.3
[ 1560.341496] device-mapper: ioctl: 4.22.0-ioctl (2011-10-19) initialised: dm-devel@redhat.com
Reading all physical volumes. This may take a while...
No volume groups found
No volume groups found
No volume groups found
.
update-initramfs: deferring update (trigger activated)
Setting up parted (2.3-5) ...
Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-3.3.2-kirkwood-dg
W: mdadm: /etc/mdadm/mdadm.conf defines no arrays.
[ 1572.881652] scsi_verify_blk_ioctl: 26 callbacks suppressed
[ 1572.887171] mdadm: sending ioctl 1261 to a partition!
[ 1572.892289] mdadm: sending ioctl 1261 to a partition!
[ 1572.906830] mdadm: sending ioctl 1261 to a partition!
[ 1572.911943] mdadm: sending ioctl 1261 to a partition!
[ 1572.917528] mdadm: sending ioctl 1261 to a partition!
[ 1572.922624] mdadm: sending ioctl 1261 to a partition!
[ 1572.938067] mdadm: sending ioctl 1261 to a partition!
[ 1572.943145] mdadm: sending ioctl 1261 to a partition!
[ 1572.949013] mdadm: sending ioctl 800c0910 to a partition!
[ 1572.954437] mdadm: sending ioctl 800c0910 to a partition!
W: mdadm: no arrays defined in configuration file.
Errors were encountered while processing:
collectd
openmediavault
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@GoFlexHome:~# ^C
root@GoFlexHome:~# dpkg -l |grep openmedia
iU openmediavault 0.5.11 Open network attached storage solution
ii openmediavault-keyring 0.2 GnuPG archive keys of the OpenMediaVault archive
root@GoFlexHome:~#
root@GoFlexHome:~#
root@GoFlexHome:~#

**************************** AND WHEN I TRIED TO RESTART IT ****************************

Quote


root@GoFlexHome:~# apt-get install openmediavault
Reading package lists... Done
Building dependency tree
Reading state information... Done
openmediavault is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]?
Setting up collectd (4.10.1-1+squeeze2) ...
Restarting statistics collection and monitoring daemon: collectdNot restarting collectd.
invoke-rc.d: initscript collectd, action "restart" failed.
dpkg: error processing collectd (--configure):
subprocess installed post-installation script returned error exit status 1
configured to not write apport reports
dpkg: dependency problems prevent configuration of openmediavault:
openmediavault depends on collectd; however:
Package collectd is not configured yet.
dpkg: error processing openmediavault (--configure):
dependency problems - leaving unconfigured
configured to not write apport reports
Errors were encountered while processing:
collectd
openmediavault
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@GoFlexHome:~#

i discovered that purging mdadm resets it and will cause the install to start at the beginning but it reinstalls mdadm and i get the same error.

thanks
m

9/30/2013 -this problem is solved. adding the following line to the /etc/hosts file fixed the problem (for me) and will allow omv to install to completion without failure except for php5 and php5-proctitle (which can be pre-installed prior to installing omv:

127.0.1.1 GoFlexHome.localdomain GoFlexHome

the /etc/hosts file should look something like this:

root@GoFlexHome:~# cat /etc/hosts
# This configuration file is auto-generated.
# WARNING: Do not edit this file, your changes will be lost.
127.0.0.1 localhost

#add this line to fix collecd failure
127.0.1.1 GoFlexHome.localdomain GoFlexHome

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts


where GoFlexHome would be your hostname.




Edited 1 time(s). Last edit at 09/30/2013 11:18AM by maihoaomv.
Yea!!! Got openmediavault 0.5 sardaukar to work on the GoFlex Home. The mdadm is actually a warning as Don Charisma pointed out. The real problem is the /etc/collectd/collectd.conf file. For some reason it is not being correctly configured during installation of omv. I cheated and copied the contents of collectd.conf from the virtual machine into the collectd.conf on the GoFlex and the installation completed successfully.

Once I had the WebGUI up and logged I was able to do the minimum configuration. Samba, NFS, and SSH is working. I couldn't get Plugins to work though. I get a communication error. Still don't know why collectd isn't configured correctly. Maybe someone on the omv forum can tell me.
bodhi
i found the source code for php5-proctitle here.

http://sourceforge.net/p/openmediavault/code/HEAD/tree/trunk/deb/php5-proctitle/


and the instructions for building it is here
http://forums.openmediavault.org/viewtopic.php?f=12&t=2734&p=18729#p18685

it only takes a few minutes to build.



Edited 2 time(s). Last edit at 09/28/2013 11:46PM by maihoaomv.
Thank you for this very helpful tutorial. But is there a way to get it working in wheezy?

And how much RAM does a running OMV instance take?

Thanks in advance.
Re: Build your own Pro NAS – Seagate Goflex Net with Debian Linux, RAID1 and OpenMediaVault
October 01, 2013 01:51AM
maihoaomv Wrote:
-------------------------------------------------------
> bodhi
> i found the source code for php5-proctitle here.
>
> http://sourceforge.net/p/openmediavault/code/HEAD/
> tree/trunk/deb/php5-proctitle/
>
>
> and the instructions for building it is here
> http://forums.openmediavault.org/viewtopic.php?f=1
> 2&t=2734&p=18729#p18685
>
> it only takes a few minutes to build.

Thanks for the link maihoamv!

-bodhi
===========================
Forum Wiki
bodhi's corner
BigRon,

wheezy isn't officially supported on OMV before 0.6, so you can try and do it yourself, but you're on your own I'm afraid. I'm fairly sure it's possible, bust just watch out for collectd buggering up your booting.

My system runs about 30Mb RAM usage on idle.

I didn't find any performance advantage Ubuntu -> GoFlex Net on NFS, so reverted to Samba, as NFS I couldn't get to work with Windows. NFS might use less memory reason I mention it.

Also I have no idea how to tune a debian box with RAID, so don't know if this could be reduced, or what kind of memory usage is "normal" for a GoFlex Net box running debian squeeze.

Performance wise I'm happy, Samba responds quickly on my PC, and I get sustained writes of around 20MB/s which is fine for me.

One thing I'd have liked to added to the guide was how to get the boot messages (after Debian takes over from uboot) from Debian onto netconsole, does anyone know how to do that ?

Cheers

Don Charisma
http://DonCharisma.com
Re: Build your own Pro NAS – Seagate Goflex Net with Debian Linux, RAID1 and OpenMediaVault
October 04, 2013 03:33PM
Don,

See this post:
http://forum.doozan.com/read.php?2,9522,9522#msg-9522

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 1 time(s). Last edit at 10/04/2013 03:34PM by bodhi.
Hey Bodhi.

Thanks dude, I'll give that a try when I get a minute. The remake of the image file is necessary to incorporate the extra variable ?

Cheers
Don Charisma & Don Charisma



Edited 1 time(s). Last edit at 10/08/2013 09:54PM by DonCharisma.
Re: Build your own Pro NAS – Seagate Goflex Net with Debian Linux, RAID1 and OpenMediaVault
October 09, 2013 12:10AM
Don,

You're welcome! it is necessary because it makes sure that netconsole is loaded at the earliest possible time in kernel booting (if you look at dmesg, eth0 was forced loaded because of netconsole module). By default, netconsole is not loaded. Note that you only need to do this once. Later whenever you ugrade rootfs, it is already there.

-bodhi
===========================
Forum Wiki
bodhi's corner
Hey Don , Shouldn't the install rescue system would be earlier step ?
I actually wanted to use the SATA drive as main and only drive with 2 partitions and i see in your instructions you mentioned you should use USB also my drive is ext4
dinjo1, I think you may get "kernel too old" problem in installing rescue earlier. I haven't tried installing it earlier and don't have a current project, so unable to confirm. Try having a look at the threads on this forum about rescue system v2

I'm unclear what you are asking about SATA drive. SATA drive can be used connected to SATA port and booted from. I used EXT3. I don't know if EXT4 will work. Try it and let us know :)

Cheers

Don Charisma
http://DonCharisma.org
http://DonCharisma.com
Thanks I was able to mount as ext4 with SATA successfully thanks to bodhi on it.
Hello Don!

thanks for the wonderfully detailed post! i was able to prepare a flash-drive accordingly. however, when i plug it in my goflex home, power it up, and SSH into it, it logs me in to the rescue system instead (using 'root/root'). any idea on what could i be doing wrong?
Hello, I hope someone on here is able/willing to help me. I was running Arch Linux on my GoFlex Home, then came across Jeffs method for getting Debian loaded, which seemed a good idea. A few beers later and I managed to make a complete mess of it and ended up with only NC working. I came across this post (DonCharisma) and tried following it, used the same kirkwood image etc, but it only gets as far as "Starting kernel" before freezing up with a green light on the front.

U-Boot 2011.12 (Apr 18 2012 - 23:08:20)
Seagate GoFlexNet
arm-none-linux-gnueabi-gcc (Sourcery G++ Lite 2009q3-67) 4.4.1
GNU ld (Sourcery G++ Lite 2009q3-67) 2.19.51.20090709
Hit any key to stop autoboot:  0 
(Re)start USB...
USB:   Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... 2 USB Device(s) found
       scanning bus for storage devices... 1 Storage Device(s) found
Loading file "/rescueme" from usb device 0:1 (usbda1)
** File not found /rescueme
reading /rescueme.txt

** Unable to read "/rescueme.txt" from usb 0:1 **
Creating 1 MTD partitions on "nand0":
0x000002500000-0x000010000000 : "mtd=3"
UBI: attaching mtd1 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    129024 bytes
UBI: smallest flash I/O unit:    2048
UBI: sub-page size:              512
UBI: VID header offset:          512 (aligned 512)
UBI: data offset:                2048
UBI error: validate_ec_hdr: bad VID header offset 2048, expected 512
UBI error: validate_ec_hdr: bad EC header
UBI error: ubi_io_read_ec_hdr: validation failed for PEB 0
UBI error: ubi_init: cannot attach mtd1
UBI error: ubi_init: UBI error: cannot initialize UBI, error -22
UBI init error 22
Loading file "/boot/uImage" from usb device 0:1 (usbda1)
1 bytes read
Found bootable drive on usb 0:1
Loading file "/boot/uImage" from usb device 0:1 (usbda1)
2279256 bytes read
Loading file "/boot/uInitrd" from usb device 0:1 (usbda1)
7004538 bytes read
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-3.3.2
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2279192 Bytes = 2.2 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 01100000 ...
   Image Name:   initramfs-3.3.2-kirkwood-dg
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    7004474 Bytes = 6.7 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...


Here is my "printenv" output:
GoFlexNet> printenv
printenv
arcNumber=3338
baudrate=115200
bootcmd=usb start; run force_rescue_bootcmd; run ubifs_bootcmd; run usb_bootcmd; usb stop; run rescue_bootcmd; run pogo_bootcmd; reset
bootdelay=10
console=ttyS0,115200
ethact=egiga0
ethaddr=02:50:43:1e:91:fa
force_rescue=0
force_rescue_bootcmd=if test $force_rescue -eq 1 || ext2load usb 0:1 0x1700000 /rescueme 1 || fatload usb 0:1 0x1700000 /rescueme.txt 1; then run rescue_bootcmd; fi
if_netconsole=ping $serverip
ipaddr=192.168.0.10
led_error=orange blinking
led_exit=green off
led_init=green blinking
mainlineLinux=yes
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
ncip=192.168.0.3
partition=nand0,2
pogo_bootcmd=if fsload uboot-original-mtd0.kwb; then go 0x800200; fi
preboot=run if_netconsole start_netconsole
rescue_bootcmd=if test $rescue_installed -eq 1; then run rescue_set_bootargs; nand read.e 0x800000 0x100000 0x400000; bootm 0x800000; else run pogo_bootcmd; fi
rescue_installed=0
rescue_set_bootargs=setenv bootargs console=$console ubi.mtd=2 root=ubi0:rootfs ro rootfstype=ubifs $mtdparts $rescue_custom_params
serverip=192.168.0.3
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
stderr=nc
stdin=nc
stdout=nc
ubifs_bootcmd=run ubifs_set_bootargs; if ubi part data && ubifsmount rootfs && ubifsload 0x800000 /boot/uImage && ubifsload 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; fi
ubifs_mtd=3
ubifs_set_bootargs=setenv bootargs console=$console ubi.mtd=$ubifs_mtd root=ubi0:rootfs rootfstype=ubifs $mtdparts $ubifs_custom_params
usb_boot=mw 0x800000 0 1; ext2load usb $usb_device 0x800000 /boot/uImage; if ext2load usb $usb_device 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi
usb_bootcmd=run usb_init; setenv usb_root LABEL=rootfs; run usb_set_bootargs; run usb_boot
usb_device=0:1
usb_init=run usb_scan
usb_root=/dev/sda1
usb_rootdelay=10
usb_rootfstype=ext2
usb_scan=usb_scan_done=0;for scan in $usb_scan_list; do run usb_scan_$scan; if test $usb_scan_done -eq 0 && ext2load usb $usb 0x800000 /boot/uImage 1; then usb_scan_done=1; echo "Found bootable drive on usb $usb"; setenv usb_device $usb; setenv usb_root /dev/$dev; fi; done
usb_scan_1=usb=0:1 dev=sda1
usb_scan_2=usb=1:1 dev=sdb1
usb_scan_3=usb=2:1 dev=sdc1
usb_scan_4=usb=3:1 dev=sdd1
usb_scan_list=1 2 3 4
usb_set_bootargs=setenv bootargs console=$console root=$usb_root rootdelay=$usb_rootdelay rootfstype=$usb_rootfstype $mtdparts $usb_custom_params

Environment size: 2626/131068 bytes
GoFlexNet>


I've spent hours Googling this, and tried so many different things that are Greek to me, so I figured to try asking here before I end up making things worse - Any advice would be greatly appreciated.

Cheers,
Ian
Re: Build your own Pro NAS – Seagate Goflex Net with Debian Linux, RAID1 and OpenMediaVault
September 17, 2014 02:00PM
Ian,

Usually netcosole output stops there. LED green solid is good. So look for the plug on the network (your router web page, or use nmap tool to scan the network).

Btw, your u-boot and kernel versions are a lttle old. See the latest u-boot and kernel in my signature.

-bodhi
===========================
Forum Wiki
bodhi's corner
Wow, thanks for the quick response !

I checked both my router web page & nmap - nothing :(
The lights on the ethernet port flash every few seconds, but the green one in front is stuck solid.

Thanks,
Ian
Updated to Kirkwood 3.16, same issue:
...
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-3.16.0-kirkwood-tld-2
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2755976 Bytes = 2.6 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 01100000 ...
   Image Name:   initramfs-3.16.0-kirkwood-tld-2
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    6032401 Bytes = 5.8 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Cheers,
Ian
Re: Build your own Pro NAS – Seagate Goflex Net with Debian Linux, RAID1 and OpenMediaVault
September 17, 2014 04:40PM
Ian,

This is the problem with mounting rootfs. The kernel was loaded ok. Try these possible remedies, in order:

- take the USB drive to another Linux box and check for file system error with fsck. Plug it back in and power up.
- make sure the USB file system format is Ext2 or Ext3 (because your rootfstype is Ext2).
- if the above did not help, download the latest Kirkwood rootfs tarball (see my signature) and extract it to a freshly formatted Ext3 Usb drive, boot with it.

-bodhi
===========================
Forum Wiki
bodhi's corner
bodhi,

I will try this over the weekend and get back to you.

Thanks again,
Ian
yes, do try the last step suggested by bodhi. even i had problem booting in using Jeff's method as well as with davygravy's img, while the front LED on my GFH stayed solid green (though i hadn't set up NC at that time). i then later used bodhi's rootfs, plus update the uboot to the latest one uploaded by bodhi, and haven't looked back since! now am engaged in performing all sorts of packages-jugglery on the dock!
Ok, I've tried 3 different usb drives with various combinations of etx2 & ext3(updated accordingly in uBoot), with DavyGravy & Bohdis' images, with the SATA disk plugged in or not... still nothing.
I'm wondering now if my USB drives are too old/unsuitable, so I will buy a new one this comming week and try that out instead.

Thanks guys.
IanD Wrote:
-------------------------------------------------------
> Ok, I've tried 3 different usb drives with various
> combinations of etx2 & ext3(updated accordingly in
> uBoot), with DavyGravy & Bohdis' images, with the
> SATA disk plugged in or not... still nothing.
> I'm wondering now if my USB drives are too
> old/unsuitable, so I will buy a new one this
> comming week and try that out instead.
>
> Thanks guys.

try to get sandisk cruzer blade. i have read that they fare very well. am using them on my router too.
Hi - firstly thanks for a comprehensive guide - very helpful and I've got a pretty healthy GFN with two 3.5" satas, 2 USB sata and a spare USB port for occasional external drives. However, i'd like to move the bootfs onto one of the sata disks, but following procedure in step 8 seemed to fail and can't work out why.

netconsole reports booting to kernel from sata ok:

Loading file "/boot/uImage" from ide device 0:1 (hda1)
2279256 bytes read
Loading file "/boot/uInitrd" from ide device 0:1 (hda1)
7004538 bytes read
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-3.3.2
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2279192 Bytes = 2.2 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 01100000 ...
   Image Name:   initramfs-3.3.2-kirkwood-dg
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    7004474 Bytes = 6.7 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...


I get a solid green light, but no shell, www, or shared file access. Have I missed something? (i assume so) GFN pops happily back when USB is reinserted and power cycled.

Thanks and let me know if there's more info needed
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: