Monday, May 18, 2009

Putting my hard disk to sleep on Pogoplug

Out of the box, pogoplug doesn't spin down my Maxtor OneTouch Plus hard disk. Like most other hard disk drives out there, my disk is used for relatively short period of time every day. This means keeping it running wastes the electricity and produces unnecessary heat.

That situation changed with Spindown - I just installed it using the source. It requires "sg3-utils" but that's already included in Optware, so a quick "ipkg install sg3-utils" took care of that dependency. Once I've installed spindown, and edited /opt/etc/spindown.conf to manage sda and sdb (I have two disks plugged onto pogoplug), my disk stays cool and silent all day. As is, it's almost perfect - all important bases are covered. 

Of course, there's always something more, and in this case, I'd like to get software RAID 1 working - which would be really awesome. It would be even more awesome if somehow there's a way to get ZFS working but I know that won't happen anytime soon, if ever. Probably it will take less time (and work) to get BTRFS working on my pogoplug :)

Wednesday, May 06, 2009

Finally, the working combo of cups and pogoplug

Finally I got the remote printing working with pogoplug.

As I explained in my previous post, I've installed cups and splix, and created a "raw" printer with the usb printer as the device. However, I couldn't get it working only with those.

Then Google pointed me to http://www.owlfish.com/thoughts/winipp-cups-2003-07-20.html. I've basically followed this all the way, but STILL it didn't work. It turns out the last trick was to use the specific driver for ML1740 instead of Samsung's universal driver. Somehow Samsung Universal driver didn't work on top of cups IPP printer.

I suspect I don't even need splix, since the printer is raw and the driver is on windows side. This probably means any USB printer will work, as long as there's a driver on the client side. All in all, I'm very happy that both samba and cups work now.

Saturday, May 02, 2009

Pogoplug performance

Now that I've hooked pogoplug onto a fully non-blocking gigabit switch, the network shouldn't be the bottleneck anymore (or if it still is, I'd be really happy) and so finally I have the setup to test pogoplug's performance. Feeling lazy about it, I decided to just run some file copy operations :)

Here's what I got:

First, I wanted to see pogoplug + Maxtor OneTouchPlus 750GB disk performance. The disk is formatted in NTFS, and is hooked up to pogoplug through a USB2 hub. 

I first ran a file copy inside pogoplug, that copies a single 1GB file onto the same disk (hence there's 1GB of read traffic and 1GB of write traffic onto the same disk). It took 232 seconds - this is sooooooo slow (only 2GB/232 ~= 8MB/sec). So I measured only the read speed by running "cat file > /dev/null" with the same 1GB file, and it only took 44s -- 1GB/44 > 20MB/s. 20MB/s read speed is quite reasonable :)

Now across the network, I ran "scp" from a windows box - this doesn't really test the pure network copy performance, as scp would require quite a bit of CPU power to encrypt the traffic. With scp, I got only about 2.2MB/s which I thought is somewhat abyssmal (this is on a gigabit network).  However, it turns out it isn't that bad, compared to samba. 

I tried copying over samba and gave up after waiting about a minute (at that point, the copy progress bar said 15 minutes left - this would mean nearly 1MB/s). So I tried pogoplug device (you know, the pogoplug's software that makes any drives on pogoplug show up as windows' local disk). It took 146 seconds to copy 1GB file from pogoplug to a Windows box - that's about 7MB/s. When I asked about samba to pogoplug support, they mentioned that their software is much faster than samba, and now I can believe that :)

While it's still not fast enough to hit 20MB/s disk speed bottleneck, 7MB/s is fast enough to saturate my 802.11g wireless network and probably fast enough to stream HD contents - I'll have to try that later to confirm. So all in all, I'm reasonably happy about the performance - when using pogoplug device directly at least - and looking forward to using it as a media streaming box :)


One good news and one bad news about pogoplug and cups

I've made some progress setting up cups on pogoplug. It's not working yet, but I feel like it's sooooo close. 

I first tried cups in optware packages, but somehow all binaries in the package gave me segfault.
So I downloaded cups-1.3.10 source, and compiled/installed it myself (after installing optware development tools - gcc, make, etc). Then I realized that the kernel has usblp driver, but somehow /dev/usblp0 isn't there (even when the printer is plugged in, and dmesg shows kernel recognizing it as a usb printer). So I created a device myself "mknod /dev/usblp0 c 180 0" - the major number and the minor number was taken from:
bash-3.2# cat /sys/bus/usb/devices/1-1.3/1-1.3\:1.0/usb\:lp0/dev
180:0
bash-3.2#
After this, cups backend recognizes the printer:
bash-3.2# /opt/lib/cups/backend/usb
direct usb://Samsung/ML-1740 "Samsung ML-1740" "Samsung ML-1740 USB #1" "MFG:Samsung;CMD:GDI;MDL:ML-1740;CLS:PRINTER;MODE:GDI;STATUS:IDLE;CODE:10001;"
bash-3.2#
I've installed splix as well. However, I've never setup cups manually before, and I was lost in setting up cups. After many trials and errors, I still don't have successful cups setup - I've tried two different paths, one setting up the printer as "raw", and have my windows box to install the printer driver on its side. And the other was to use splix and have windows recognize it as generic postscript printer. However, I couldn't get either of them working - generic postscript setup didn't work because cups was giving client-error-document-format-not-supported error with a message "unsupported format: application/postscript" or something like that. I don't understand why this is happening, as seemingly correct .ppd file is installed and configured for the printer... Then the raw mode somehow never worked either and I couldn't figure out why, and by the time I got to that stage, it was waaaay to late so had to sleep :/

If you're a cups hacker who can give some advice in this sitation, it would be awesome. It's so close to pogoplug nirvana....

Thursday, April 30, 2009

My samba config for pogoplug

Below is my samba config (for samba 2.2). No password, nor any protection other than IP address filter (see "hosts allow") so use with caution :)

[global]
workgroup = PARKNET
server string = Pogoplug Samba2 Server
hosts allow = 192.168.3.  127.
null passwords = yes
guest account = root
log file = /opt/var/log/samba/log.%m
max log size = 50
security = share
encrypt passwords = no
smb passwd file = /opt/etc/samba/smbpasswd
dns proxy = no
preserve case = yes

[ShareAll]
comment = Test share
path = /tmp/.cemnt
available = yes
public = yes
writable = yes
printable = no
create mask = 0777
guest ok = yes
browseable = yes

I know this is somewhat gross as far as samba configurations go, but hopefully it will be a working start :)

PS. Turns out "encrypt passwords = no" doesn't actually help, but prevents non-workgroup machines to connect without passwords (at least from a Windows XP machine). I've now set it to "yes".

Friday, April 24, 2009

대한민국은 미친공화국이다

한겨레 신문에 "교과부 심야학원 10시까지 법제화"라는 기사를 읽자니, 기가 막혀서 말이 안나온다. 이런 황당한 법을 만들겠다는 넘들이나, 그걸 지지하는 넘들, 내 블로그를 읽을리 절대 없겠지만, 혹시라도 읽는다면 잘 들어라.

도.대.체.  다른사람들이 자기 애들을 11시에 학원에 보내건, 12시에 보내건, 새벽 3시에 보내건, 그게 니들 사는데 무슨 방해가 되냐? 뭐가 "올바른" 행동인지 아닌지, 몇사람들이 정해서 법으로 만들어 다른사람들에게 강제시키겠다는 이런 발상은...계몽주의적을 넘어 국민을 애들 취급하겠다는 발상 이쟈너. 니덜은 미친놈들이다. 10시넘에 운영하는 학원을 문제라고 생각하는 것 까지는 그렇다고 치자. 그걸 강제적으로 이런식으로 해결하겠다는, 위에서 아래로 내려오는 상명하달식으로 밖에는 해결이 안될거라고 믿는, 그래서 거기에 회의 시간들 들여가며 돌아가지 않는 머리통들을 부딪히고 있는 니덜은 ... 미친넘들이다. 

밤늦게 학원에 보내려는 부모들이 보내고 싶지 않게, 보낼 필요가 없게 만들어서, 수요가 없어지게 하지 않는 이상, 아무리 단속을 하더라도 원하는 사람들은 하게 마련이다. 어떻게 하면 근본적인 문제부터 해결할까는 생각하지도 않으면서 이딴 쓸데없는데다가 시간을 쓰고있으니.... 혹시라도 이거 읽고 제정신이 돌아오거든 이 형님한테 감사하다고 인사나 해라.


About /dev/mtdblock3 on pogoplug

I've asked pogoplug support if they have any plan to use that extra partition, and the below was the answer:

We have left mtdblock3 for linux users to use at their discression.  We have reserved mtd0 for bootloader, mtd1 for kernel, mtd2 for root file system (and it is all we firmware update).  mtd3 and mtdblock3 are the majority of the NAND flash (~450MB) and we currently have no plans to use it at all.

One word: awesome! I'm feeling a lot better about buying pogoplug. Now if only I can get cups working. I haven't had time to fight with cups yet, but it seems that it's not the cups but something at the kernel level that's not working...

How to install samba on pogoplug

Below is roughly what I did to get samba running on pogoplug.

# remount the root partition for writing
mount -o remount,rw /

# mount the extra partition for the space
mkdir /opt
mount /dev/mtdblock3 /opt
cd /opt

# get the optware ipkg system
wget http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/ipkg-
opt_0.99.163-10_arm.ipk

# set it up
tar -xOvzf ipkg-opt_*_arm.ipk ./data.tar.gz | tar -C / -xzvf -
mkdir -p /opt/etc/ipkg
echo "src cross http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/uns
table" > /opt/etc/ipkg/armel-feed.conf
echo "src native http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/native/u
nstable" >> /opt/etc/ipkg/armel-feed.conf

# first update
/opt/bin/ipkg update

# install samba!
/opt/bin/ipkg install samba2

# edit samba config
vi /opt/etc/samba/smb.conf

# run it!
/opt/etc/init.d/S80samba start

Sunday, April 19, 2009

Pogoplug, and lots of images

If you have a disk that contains large number of image and video files, you may not want to attach it to pogoplug, at least yet. It seems that pogoplug wants to generate thumbnails for all video and image files on the disk (/tmp/hbplug.log shows invocation of ffmpeg), and since I attached the disk that contains all digital pictures I've ever took in the past 10 years or so - especially with two kids, I easily take thousands of pictures a year - it looks like the pogoplug is taking forever to process them all.

Looking at .cedata/tn directory pogoplug created (which seems to be the directory for thumbnails), I see 3k immediate subdirectories under .cedata/tn, and total 23k files and directories recursively. *arg*. Life is never simple :(
I don't remember whether I formatted this disk in NTFS or FAT, but regardless, it seems like a bad design on pogoplug's part to use this many directories - you want to keep the number of directories reasonable, especially when the underlying filesystem is badly designed, like FAT.

Anyway, I've stopped "hbplug" process by "kill -STOP", so the disk is not thrashing. I should remember to re-enable hbplug process again.

Pogoplug, optware, samba

Finally I had a bit of extra time to play with Pogoplug. I've set up Optware ipkg on pogoplug, installed samba, configured it and it works beautifully :)
Optware comes with CUPS, so it shouldn't be too difficult to set the print server as well - though I first need aUSB2 hub to try hooking up the printer :)
Now it's time to sleep - if I get more time, I'll try to write down more details on Optware setup.

Saturday, April 11, 2009

Update on Pogoplug

After complaining loudly on their support page, I've got an excellent reply from Pogoplug:

Hi.
I spoke with our dev group and here's what's going on. They are working on a LAN discovery broadcast for the drive software, so that it will work without internet access. It should be available soon, and I'll update you when it's ready. We did not provide SMB/CIFS support because we wanted a consistent user experience for Mac and Windows, both in and out of the home. The protocol used by Pogoplug drive software is also a lot faster than SMB. Having said that, you can get full access to your Pogoplug and add any software that you want. We are just about to publish this on our site, but here's the info you'll need:

Pogoplug runs with Linux 2.6.22.18. and the full open source for the kernel, glibc, busybox, u-boot, and other user-mode processes will be available linked from our developer section. Pogoplug currently accepts SSH sessions for the root user (un: root, pw: ceadmin). The processor is a ARM processor with all firmware stored on the internal NAND flash device. The standard linux MTD device drive is used to manage this NAND device with JFFS2 filesystem. Once you SSH to the device, you can change the root file system, install a new kernel modules, etc.

We also support a 3.3v RS-232 UART connection on the main logic board. This UART connection gives low level access to the u-boot boot loader which allows for upgrading the main kernel image.

Please let me know if I can provide any additional information.

Thanks,

I haven't set up the cross compiler on my linux box yet, so haven't done any serious attempt of adding more functionality to it. But regardless, given this information, you definitely want to block ssh/telnet port at the firewall if you haven't done so already, and you shouldn't hook it up to the network you don't trust.

My brief performance testing (just copying some big file) seems to suggest that it is not particularly slower or faster. One issue I've encountered was BSOD - I tried playing .mkv from a windows box that has pogoplug software installed (hence the pogoplug shows up as a disk), and I've got BSOD (the first time in a few years since I've got that laptop). On the second attempt, it didn't crash, so it's not a definite evidence of a bug in their software, but nonetheless not a great sign.

So, it's still not useable as my main network storage. But there are some good signs that it may become one.

Wednesday, April 08, 2009

My Pogoplug arrived, and I'm disappointed.

This is a quick review of Pogoplug. I have preordered the box, and it has finally arrived. Unfortunately, I'm deeply disappointed, because it has so much potential that's being wasted.

Pogoplug is essentially a small embedded computer, with Marvell's low-power ARM processor core with some DRAM and flash memory, one ethernet port and one USB port.
I pre-ordered it, figuring there's not much to lose - I figured this would be a perfect device that I can play with, as a small home server, given that this little box was supposed to run linux.

Now that I've received the box, it has a few critical flaws that make it not very usable in its current state.
  1. No power saving mode for the disk - I've been using an old laptop running Windows XP as a file/print server. Naturally, when I don't use the disk, the disk doesn't do any "seeks", and it's configured so that it spins down the hard disk fairly quickly when idle. This means my external hard disk spends most of its time spinned down, not consuming much power. This is in great contrast to Pogoplug - it constantly spins the disk, and even when I'm not using it, it does bunch of seeks, consuming power and wearing down the disk. For a box that's meant to be on all the time, this is...deeply disappointing, to say it politely.
  2. No CIFS/SMB support nor NFS - I don't know what Pogoplug people are thinking, but they didn't enable this, and there's no way to "properly" access the files, except...
  3. A priorietary software on Windows and Mac that show the drive hooked to Pogoplug as a network disk. This software, confusingly also called Pogoplug, doesn't connect if your machine and your pogoplug can't talk to pogoplug's server. For example, if you lose your connection to your ISP, you can't connect to your disk hooked to Pogoplug. This means...
  4. Total dependence on the proprietary webservice - as is, the box is useless without pogoplug website. If the company folds, the box will essentially become a deadweight.
  5. No printer server support - given how easy it is to support print server, it's crazy not to support this.
  6. No ssh into the box - even though this is my computer, I don't have root access. It's not like the box doesn't have sshd running - it has the port open (crazily, it has the telnetd running on port 22 as well - whoever left telnetd running by default needs some serious education on the network security).
As you can see, all the flaws are software - the hardware itself is compact, silent, and low power, and just the right form factor and the price. It's just the software that's not allowing the little-box-that-can from doing all things it's meant to do.

And scanning through the pogoplug support forum and reading some responses, I don't see enough good signs that the company is willing to listen to the similar requests that's already made on the board.

Thursday, March 05, 2009

The Bay Model

This is the first time I heard of this, but looks amazing. It seems like a perfect place to visit during spring break...

Monday, March 02, 2009

Validation, and Rent-a-person

A friend of mine sent me a link to a movie called Validation (thanks Tom!). It's an awesome movie, and my wife and I thoroughly enjoyed it - and guess what ? It turns out the same directory made a movie called Rent-a-person. It's equally entertaining...and those two movies are separate yet entwined :)

Friday, January 09, 2009

Ever heard of beef that's over $150 per lb ?

Costco online now sells Japanese Wagyu Beef. Price? $2299.99 for 15 lbs. That's over $150 per lb. That's gotta be more expensive than a regular cow in whole...

Friday, December 26, 2008

Monday, December 15, 2008

Driving to the end of the rainbow...

We - the commuters driving to work - are the pursuers of the proverbial end of the rainbow for a pot of gold. But this morning, it was literally true:

Sunday, December 14, 2008

This storm's getting better :)

Well, NWS just updated the forecast, and it gets better and better:

* TOTAL SNOW ACCUMULATIONS THROUGH MONDAY NIGHT: 10 TO 20
INCHES...WITH 18 TO 30 INCHES ABOVE 7000 FEET.


Yes! Yes! Yes!