Zones

Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Wednesday, December 19, 2012

Install Nas4Free on an USB Flash Drive in Ubuntu

This is a step by step description of how I installed Nas4Free on an USB Flash Drive.
Let's get down to business.

What you need:
Nas4Free
http://www.nas4free.org/
http://www.nas4free.org/downloads.html
I installed the latest version at the time this post was written:
http://sourceforge.net/projects/nas4free/files/NAS4Free-9.1.0.1/9.1.0.1.573/
2 * USB Stick
You will need 2 USB sticks, one for the LiveUSB for the installer and one to install NAS4Free to.
I have 4 or 5 USB Flash Stick lying around so this is the most straightforward method for me. And of course my NAS Box does not have an optical unit.

Instructions:

1. Download the Live USB or embedded *.img for your architecture.
I used NAS4Free-x64-LiveUSB-9.1.0.1.573.img and NAS4Free-x64-embedded-9.1.0.1.573.img in my tests

2. Insert the USB Key and write one of the images on it.
Be very careful what device you use for the output(of=) of the dd command used below.
To find out which device is your USB Drive please use
sudo parted -l
or
sudo fdisk -l
For me it was /dev/sdd
== NAS4Free-x64-LiveUSB-9.1.0.1.573.img ==
This is a raw USB image which can be used to install NAS4Free to another USB Drive or a HDD. It can be written directly to the USB Flash Drive using dd.
sudo dd if=NAS4Free-x64-LiveUSB-9.1.0.1.573.img of=/dev/sdd
I used this image.

== NAS4Free-x64-embedded-9.1.0.1.573.img ==
This is a compressed image which can be used for upgrading NAS4Free using the web interface. Use this image to run NAS4Free directly from the USB Drive you put it on. It must be decompressed before it is used with dd. For some strange reason gunzip did not like the file name so I had to pipe the fie from cat command output to gunzip. The -c parameter makes gunzip output to stdout.
cat NAS4Free-x64-embedded-9.1.0.1.573.img | gunzip -c | sudo dd of=/dev/sdd1

The comments of alexey123 (regarding the use of dd) from this forum post and others were very helpful for me. Thank you!

From this point on I will be describing what to do if you use the LiveUSB image.

3. Insert the USB Key with the Live USB Image (NAS4Free-x64-LiveUSB-9.1.0.1.573.img) into your NAS machine and configure it as a boot device from the BIOS.
The OS will boot in a minute or so and you will be presented with a numbered menu.
You will see the message "Now, the blank USB memory for installation can be inserted."
Insert you install target USB Drive, the system should notify you, and then choose the option "Install/Upgrade NAS4Free from LiveCD/LiveUSB" (it was 9 for me).
I chose the Embedded istall on a CF/USB Flash Drive option.
WARNING: All partitions on your selected USB Flash Drive will be erased.
Then choose the installation source and on the next page, the installation target (The second USB Drive you inserted).
The installation should take less than a minute. After it is finished, remove the LiveUSB Drive and reboot the machine.
Your new OS should happily boot.

That's it! Happy NASing!!.


Other useful tips:
To format a USB Drive using FAT32 you can issue the following commands:
sudo umount /dev/sdd
sudo mkdosfs -F 32 -n "Label" -I /dev/sdd
An alternative method is to use the visual tool GParted.

Wednesday, October 12, 2011

A Fix For The "device not managed" Problem In Ubuntu Network Manager

I have a laptop with two wired network cards. One of them is the builtin card and the other is a USB NIC. I use the USB card because the builtin one has a strange problem I haven't been able to solve (in both Windows and Linux).

Anyway, when I first installed Ubuntu 10.04 I had some problems with the Network Manager software. I had to use the same MAC on both the wired cards because my ISP's DHCP server used the MAC to assign IPs. NM refused to "work with" the second NIC. I was in a hurry and I replaced Network Manager with wicd. I've been using wicd until a few days ago when I decided I have to make NM work because I'm getting ready to install Ubuntu 11.10 on my new laptop. Meanwhile I changed my ISP and the NICs have different MACs.

After I reinstalled NM it showed me the "device not managed" message for both my wired NICs. I tried all the solutions I could find on the internet but none worked.

Here's how I solved the problem:
1. Run "sudo gedit /etc/network/interfaces" in a Terminal window.
- replace gedit with your favourite text editor
- the interfaces file should look like this:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet loopback

auto eth1
iface eth1 inet loopback


2. Delete (or commennt with #) everything in the interfaces file except

auto lo
iface lo inet loopback

- this is the loopback interface
- NM will refuse to "manage"  any network interface that has configuration options in this file

3. Go to Synaptic Package Manager and COMPLETELY Remove network-manager and network-manager-gnome packages

4. Restart

5. Now you probably don't have an active internet connection
Run "sudo dhclient eth0" in a Terminal window. Replace eth0 with the network interface you get your internet connection from. You can run "ifconfig -a" to see the names of your network interfaces. The DHCP client should acquire an IP address for your Network Interface.

6. Now reinstall Network Manager with Synaptic or Ubuntu Software Center or the command line.

7. Restart

8. Tada. Network Manager should now "manage" all your netwrk connections.

P.S.0 I'm starting to miss wicd. You could configure it to prefer a certain wired NI or to prefer the wired interfaces over the wireless ones.

P.S.1. If you now a faster way to make NM reset it's settings after step 2 please leave a comment. Thanks.