• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1] 2
Author Topic: Moving from NSLU2 to the Plug?  (Read 5420 times)
feffer
Jr. Member
**

Karma: -1
Posts: 56


View Profile
« on: April 23, 2010, 09:26:05 PM »

I've been using the NSLU2 for two years, and want to transition to the Plug. I have a standard SheevaPlug and a GuruPlug+ on order (coming soon, I hope). Though I've been studying the wiki and forum about how to set my Plug up, I'm still confused. My NSLU2 is connected to a hdd which has Debian system files on a small partition and data files on a big one. The NSLU2 is always on, and the hdd spins up when used and spins down when inactive for 20 min. I mostly like this setup and hope to get something similar working on the Plug.

What I want to do with the Plug that I currently do on the NSLU2: 1) Backup server   2) Music server -- via daap  3) Print server.

New things I also want to do on the Plug:  1) File server   2) Mail server   3) Run Dropbox   4) VPN and/or SSH tunnel to remotely access mail and files   5) Possibly TwonkyMedia server for a PS3   6) Possibly a Bit torrent server 

I'm fine with using Ubuntu or Debian. From what I've read, it seems the base Debian/Ubuntu system could be fit on the Plug's internal flash (NAND?), but I don't think I have room for the other apps needed for the above services. These would fit on a USB stick, but I've read in several places that installing and getting that to work properly is flakey. Also I don't see much mention of users getting Debian/Ubuntu running on SD cards. Am I misinformed about either of these options? That leaves booting from an attached hdd. However on the wiki page about which hdd boot successfully, there were very few entries. Also the ones mentioned all were attached and powered directly by the Plug. Then I read about users doing this that burned out their Plug power supply! Can I install Debian/Ubuntu to an externally powered hdd like a WD MyBook 500 GB or 1 TB drive and have it boot the Plug? Is this a good or bad idea? Would it be better to fight through the issues of installing the OS to a USB stick and putting my data on an attached hdd? Thx for any suggestions!

Regards,
feffer
Logged

peter a
Full Member
***

Karma: 0
Posts: 132


View Profile
« Reply #1 on: April 24, 2010, 01:07:46 AM »

At this time there is no Arm version of Dropbox so that is a no go.
People have been asking for a non-x386 of Dropbox for over a year now and still it`s a no !!!.

Other than that I can`t see any problems with the rest , other than Don`t power the hard drive off the plug is a bad idea
Logged

feffer
Jr. Member
**

Karma: -1
Posts: 56


View Profile
« Reply #2 on: April 24, 2010, 11:20:41 PM »

thx for the reply. So, all of the services I want except Dropbox will work. My remaining question is whether to load the OS on a USB stick or externally powered USB drive. Is one better than the other for my proposed setup?

Also which OS is better, Ubuntu or Debian, or just a matter of choice. If Ubuntu am I limited to Jaunty because of ARM support? I'm presently using Debian stable on the NSLU2, but some wiki pages suggest Debian is "not quite there."

Any suggestions appreciated.

feffer
Logged

peter a
Full Member
***

Karma: 0
Posts: 132


View Profile
« Reply #3 on: April 25, 2010, 01:48:25 AM »

Quote
Also which OS is better ?

I think it is just a matter of choice, But I would go far Debian.
If you are running the plug as a NAS, I would boot from the drive just to save wear on the SD card.

BUT I think there are advantages from booting from the SD card too, like been able to swap the hard-drive and just mount the drive`s data to a mount point. 
Logged

feffer
Jr. Member
**

Karma: -1
Posts: 56


View Profile
« Reply #4 on: April 25, 2010, 11:05:02 AM »

I currently run my NSLU2 "always on" -- haven't rebooted in months. I want to do the same with the SheevaPlug. I guess I had dismissed the idea of running the OS and booting from an SD card -- maybe something I read about issues with that. This is all theoretical for me, so feedback from users who have similar systems working is greatly appreciated.

I use my client machines on and off during the day, so I want an attached hdd to spin down when not in use. I'll re-examine using an SD card to run the system. If I did that, could the SD card be cloned to a backup one?

thx for all the help,
feffer
Logged

cjm
Jr. Member
**

Karma: 6
Posts: 69


View Profile
« Reply #5 on: April 25, 2010, 11:50:24 AM »

Cloning SD cards in a card reader is a snap -- a simple "cp -a" will do the job one you have set up the file system on the target SD card. However, SD cards have problems with their durability when used with typical Unix file systems because of frequent write accesses to a few sectors. There's a thread here that describes how to mount the SD card read-only most of the time, only making it read/write when installing software, etc. Log files and such are kept in a RAM disk and synched to the SD card periodically (and when shutting down).

Another option is to use a USB hard disk. The boot loader, u-boot, has various problems booting directly from a USB disk. As far as I remember, the main issues are boot partitions which are too large (I would recommend to stay below 2GB for older u-boot versions) and cold-start problems. I worked around those issues by booting from a 250MB partition on an SD card (i.e. my /boot mount point comes from an SD card). Other than that, a USB hard disk is best for reliability. I'm using Debian Squeeze on my SheevaPlug, BTW.

Please note that the SheevaPlug power supply dies quickly when hooking up a bus-power HD drive so it's strongly recommended to power the USB HD drive separately (e.g. by using a powerd USB hub, or an HD enclosure with separate power).

If your USB HD drive doesn't spin down automatically, you may want to check hd-idle.sf.net
« Last Edit: April 25, 2010, 11:53:20 AM by cjm » Logged

feffer
Jr. Member
**

Karma: -1
Posts: 56


View Profile
« Reply #6 on: April 25, 2010, 12:50:19 PM »

thx peter and cjm. I was similarly confused when first setting up the NSLU2, and there were fewer options! I've read a lot of information here and on the wiki, and as you know some of it conflicts (or at least there are some very different ways about setting up the Plug).

@cjm: I like your method of putting a Debian system on a powered USB hdd, but putting /boot on an SD card. How did you accomplish that exactly? Is there a link or howto?

As for a powered external hdd, I was thinking about a 500 GB or 1 TB WD MyBook. I've used these on my Dish PVR and they power up and down nicely. On the other hand, I used a Seagate FreeAgent hdd on the NSLU2 which was not as well behaved. So not all are created equal. Any experience with the WD MyBook or others? Any recommendations?

Sorry for all the newbie questions. I've been running linux for 5-6 years and have confidence to do this, but getting started in the right direction is half the battle, so thx much for the help.

feffer
Logged

cjm
Jr. Member
**

Karma: 6
Posts: 69


View Profile
« Reply #7 on: April 25, 2010, 11:07:47 PM »

It's been a few months now but I believe the Debian installer allows you to select partitions during the installation as ususal. If you have both the SD card and the USB HD connected, you can create the boot partition on the SD card and the remaining partitions on the USB HD. Once done, just set up the boot command in u-boot to boot from the SD card. I can't reboot the box right now so I can't tell you how my boot command looks exactly but it's relatively straight-forward. I started with the instructions on Martin Michmayr's web page at http://www.cyrius.com/debian/kirkwood/sheevaplug/install.html.


setenv bootargs_console console=ttyS0,115200
setenv bootcmd_mmc 'mmcinit; ext2load mmc 0 0x01100000 /uInitrd; ext2load mmc 0 0x00800000 /uImage'
setenv bootcmd 'setenv bootargs $(bootargs_console); run bootcmd_mmc; bootm 0x00800000 0x01100000'
saveenv


Regarding Martin's page: the recommendations for updating u-boot come with a warning for a good reason and doing so with a USB stick failed for me, resulting in a dead plug. The SheevaPlug allows restoring the internal flash even after such a mishap, using the built-in JTAG interface, but it's a bit tricky to run the SheevaPlug installar which can be found on this site. It worked for me at the end but since there's no 100% working u-boot image at this point, I would stay away from this and use the workaround of booting from the SD card until u-boot is so stable that the risk of updating it is worth it. Having said this, updating u-boot via TFPT seems to be much safer than doing so from a USB stick.

BTW, I copied the value of the original boot command into the variable "bootcmd_nand". If something goes wrong, I simply connect the serial terminal and type "run bootcmd_nand" to boot from the internal flash memory. A perfect rescue partition Wink

BTW2, the Debian kernel scripts sometimes fail to update the boot files properly after a kernel update. Simply run the script "flash-kernel" after a kernel update if this happens. It's part of Debian and automatically updates the files in your /boot partition as required by the plug (i.e. creates the uImage and uInitrd files in /boot).
Logged

peter a
Full Member
***

Karma: 0
Posts: 132


View Profile
« Reply #8 on: April 26, 2010, 07:24:41 AM »

Kernel upgrading is one thing which is got me stomped so far.

@cjm  :- You are not passing the bootargs_root  ? 

 Eg

setenv bootargs_root 'root=/dev/sda2 rootdelay=10'
setenv bootcmd 'setenv bootargs $(bootargs_console) $(bootargs_root); run bootcmd_mmc; bootm 0x0800000

I can`t get my upgraded kernel to load it`s modules , and I think it`s a little unstable because I can`t get a USB hard drive to work.
( I`ve a boot partition full of files )
@feffer :- I think you get from Sheevaplug what you put into it, Most of computing as been on the Microsoft platform , so I`m a definitely  a newbie when it comes to Linux.

What I did with the Sheevaplug was more or less keep the Nand install untouched , which I use for cloning the drive, because you can`t clone a drive which is mounted .
To me the best hard drive is the biggest , eg   1 to 2 TB , but with low noise .
Logged

Blüto
Newbie
*

Karma: 5
Posts: 38


View Profile
« Reply #9 on: April 26, 2010, 08:13:57 AM »

General advice:

No battle plan ever survives contact with the enemy. That is, don't buy expensive accessories for your plug(s) until you've had some use of them and begin to wish you had something other than the parts you've already got on hand.

SD card advantages:

  • Gives the Sheeva an additional I/O interface for expansion cards -- SDIO WiFi, Bluetooth, etc.
  • Provides a source of removable, expandable, persistent storage (/etc, /home, encrypted volume(s), etc.)
  • Gives you the ability to create "personality packs" (NAS, surveillance camera, PBX, cloud server, firewall/router etc.) for instant repurposement of your plug.

SD card disadvantages:

  • No point in using SD solely as a boot device (you've got NAND for that if you need it).
  • For performance and reliability I believe you're better off running entirely from HD. Particularly on the GuruPlug, where you have a nice fast eSATA port for your primary drive. Furthermore, the GuruPlug is said to support port multipliers, which would make multi-drive external enclosures and/or mixed RAID modes both possible and attractive.
  • YMMV, but I wouldn't want to reserve any portion of my RAM for swap or a log buffer. Not when Apache, MySQL, Squid and Linux itself can make much better use of it.

PS: I looked up Dropbox, and it would seem that there are several alternatives that might work just as well, in fact better, because they allow you to host your own remote data access service on your own equipment:


See Freedom vs. The Cloud Log for a description of why self-hosting your data is such a desirable thing to do.


@peter a: Have you tried cbxbiker61's kernels? They're monolithic (you don't need an initramfs to boot from them), and any modules you need can be loaded after the plug comes up. (2.6.33 features sata, dmcrypt, IPV6, CIFS, NFS4, EXT3, EXT4, JFS, XFS, FUSE(for ntfs-3g), UBIFS, usb-serial, uvcvideo, iptables, appletalk, bluetooth, v4l and ppp)[/list]
« Last Edit: April 26, 2010, 09:14:24 AM by Blüto » Logged

cjm
Jr. Member
**

Karma: 6
Posts: 69


View Profile
« Reply #10 on: April 26, 2010, 09:13:24 AM »

Regarding boot arguments for Debian Squeeze: I don't set any root partition in bootargs_root. Actually, this variable still points to the NAND partitions (ubifs in my case because I restored the plug using the Sheevaplug Installer and this uses UBIFS). My boot args look like this:


$ sheeva-ubootenv-print | grep boot
bootargs_root=ubi.mtd=1 root=ubi0:rootfs rootfstype=ubifs
bootargs_console=console=ttyS0,115200
bootdelay=3
bootcmd_nand=setenv bootargs $(bootargs_console) $(mtdpartitions) $(bootargs_root); nand read.e 0x00800000 0x00100000 0x00400000; bootm 0x00800000
bootcmd_mmc=mmcinit; ext2load mmc 0 0x0800000 /uInitrd; ext2load mmc 0 0x400000 /uImage
bootcmd=setenv bootargs $(bootargs_console); run bootcmd_mmc; bootm 0x400000 0x0800000


The Debian initramfs scripts store a file in the initrd, /conf/conf.d/default_root, which points to the root partition. This is done in /usr/share/initramfs-tools/flash_kernel_set_root which scans /etc/fstab.

Peter, you might want to check the contents of your initrd. It's a gzipped cpio archive, thus you can extract it into a temporary directory using the commands


$ cd /tmp
$ mkdir initrd_test
$ cd initrd_test
$ gunzip </path/to/your/initrd | cpio -id


Just look into conf/conf.d and see whether there's something that overrides your root partition.

Blüto, you're absolutely right but there's one reason you didn't list why people might want to use SD cards in favor of the internal NAND: SD cards can be replaced when they are broken, the NAND can't. Unless you got experience in (un-)soldering SMD chips, that is...
« Last Edit: April 26, 2010, 09:16:18 AM by cjm » Logged

peter a
Full Member
***

Karma: 0
Posts: 132


View Profile
« Reply #11 on: April 26, 2010, 11:22:27 AM »

I`m Sorry about hijacking this topic, I started with the http://sheeva.with-linux.com/sheeva/ kernels, but I didn`t support my Esata plug.

Thank cjm , For a newbie I`m not doing too bad , I can pick the part I want and cross compile the kernel , install the modules, But can tell with the log files and my ftdi, the modules aren`t loading.

All in all Linux is a learning curve which I know that I will get there in the end 

/tmp/initrd_test# gunzip /boot/uInitrd | cpio -id
gzip: /boot/uInitrd: unknown suffix -- ignored
cpio: premature end of archive

« Last Edit: April 26, 2010, 11:44:35 AM by peter a » Logged

feffer
Jr. Member
**

Karma: -1
Posts: 56


View Profile
« Reply #12 on: April 26, 2010, 01:21:59 PM »

@Peter said: "I`m Sorry about hijacking this topic." No worries, I'm learning a lot, and besides those are related issues. Press on, if you need to!

@Blüto: thx for the pro/con discussion about where to boot from. This is exactly the kind of input I was hoping for. It's true that until I have my Plug in hand, this is a bit theoretical, but I should have them soon and want to have a good starting plan.

I've pretty much decided after playing a bit with the Plug as is, I want to install Debian Squeeze. I haven't quite decided how, so this discussion helps. From reading here, it seems there are two general install methods: 1)  Martin Michlmayr's method and; 2) Mark Gillespie's alternative method Since Martin Michlmayr was a Debian guru and has been helpful to me since my NSLU2 days, that path would be natural, but Mark Gillespie's method seems pretty straightforward too, and maybe easier.

Also, I'm still considering where to install the OS. There is the issue of space if installing directly on the NAND. Given the services I want to employ, would I run out of room? I know the base Debian system is pretty small, but if I want a file-server, printserver, mtd-daap, twonkymedia etc, these require supporting apps like samba, cups etc. Also, I usually edit in vim, but hate tiny-vim. Presently on my NSLU2, my Debian Lenny install is on a hdd and takes up 766 MB -- too big for the Plug NAND. Of course, I haven't had to be careful about space, so I wasn't. I'm tending towards installing on a WD MyBook 1TB. They are reasonably priced and I can use elsewhere if it doesn't work out for the Plug. Haven't ruled anything out though, just looking for a starting plan.

also @ Blüto: your points about alternates to Dropbox were well taken. Ultimately, I'd like to set up something like "cloud backup with a buddy" through tunneled ssh or vpn, but that's after getting everything else set up -- I'll check your links. As I mentioned in the first post, I also pre-ordered the GuruPlug+ (in February). Unfortunately GT has not sent me the standard Plug yet. Guess they want to save shipping and send them together Sad

feffer
Logged

fragfutter
Sr. Member
****

Karma: 12
Posts: 280


View Profile
« Reply #13 on: April 26, 2010, 01:45:56 PM »

i would initially install to an sd-card. This allows you to have an external (rotating) disk that can spin down if not in use. This is easier if the root-filesystem is not on the disk (linux normaly writes stuff when idle, so you would need to fidle with laptop mode, etc).

If you want to move your system to nand later you can migrate it, modify u-boot and reboot. This can be done for either boot or the complete rootfs. If you use ubifs as nand filesystem, you will get integrated filecompression, so your 750MB filesystem should fit into nand.
Logged

peter a
Full Member
***

Karma: 0
Posts: 132


View Profile
« Reply #14 on: April 26, 2010, 03:20:30 PM »

The good thing about making plans is that they can easy be changed.

I started off installing to a SD card as per :- http://www.cyrius.com/debian/kirkwood/sheevaplug/unpack.html
And mounted the hard drive to a user mount point , THEN clone the data from the SD card to a USB drive , THEN cloned the data from that small Pata drive to a 1.5TB Esata and booted off Esata, NOW I`ve cloned the root partition back to the SD card .
So I have the same install which I started 4 months ago, it`s just keeps walking around.

The important bit is what do you want to use the plug for and what programs do you want to install .
Logged

Pages: [1] 2
Print
Jump to: