Tuesday, December 1, 2009

Installing a Samsung SCX-4521F in Linux - Ubuntu Hardy Heron actually

I've seen a lot of comments across the web about this particular printer and getting it and the scanning working in Ubuntu.

It was easy for me - here's my simple checklist
Note I'm using a USB interface.


  1. Get the Samsung Unified Driver version 3
  2. Install it via tar xvzf SamsungXXX.tar.gz && cd cdroot/Linux && sudo ./install.sh. I did it without using X at all, I gather there's a little GUI that doesn't ask anything text install doesn't.
  3. Curse Samsung for putting the freaking icon on your desktop and the root of your applications menu without asking
  4. Clean up the crap you just cursed about.UPDATE forgot to mention the specifics - /bin/Desktop /bin/.gnome-desktop /usr/sbin/Desktop /usr/sbin/.gnome-desktop Yes, that install script has some bugs in it!
  5. Try a test page. Samsung 'helpfully' decided to make the new printer the default, so lpr favourite.pdf should work fine.
  6. Try scanimage -L and see if you can see the printer. If not (bet you can't) try sudo scanimage -L. If that works, it's a permissions problem.
  7. Add all the appropriate users to the lp group. e.g. sudo addgroup joeUser lp. The installer says it's doing something like this, but whatever it does doesn't work. Ubuntu has the handy scanner group as well, but the lp group ends up owning /dev/usb/0. Rather than muck about with updated udev rules, I just added the users to both the scanner and lp groups and it works fine.
  8. Log out of that terminal session and start a new one. A terminal doesn't pick up updated group membership until it logs in the next time. Dunno whether that applies to the 'GUI' users and group tool or not. Let me know....
  9. Use scanimage -L to see if sane can see the scanner.

Wednesday, November 25, 2009

Large Drives and USB Enclosures

OK, this is definitely a talk to the rubber ducky kind of post.

I have an old Mandrake box that various clients send their backups to overnight. I hook up an external USB drive and run a script that basically rsyncs the various backups to the external drive to be taken off-site. Been doing it this way for a while now.

I've upgraded the size of the drive in the external enclosure a couple of times, 160G to 320G to 1TB recently. When I first got the 1TB enclosure, I partitioned it with an iMac, then remembered I couldn't format ext3 with the Mac, so I connected it to a linux box and formatted it, but left the partitioning alone. Turns out the iMac partitioned it GPT. I only realized this after I'd been using it for a couple of days. This is in the logs.
kernel: /dev/scsi/host39/bus0/target0/lun0:<4> Warning: Disk has a valid GPT signature but invalid PMBR.
kernel: Assuming this disk is *not* a GPT disk anymore.

It was working, I didn't have a handy spot to move the large amount of data on the disk to, and fixing it seemed like it would probably destroy data, so I left it for a bit. I tested restoring data from the drive to be sure, and everything was working fine.

A couple of weeks later, during a really busy spell, I noticed the daily rsync jobs turned deadly slow. Instead of 6MB/s I'm getting 300k or less. Almost like it was swapping to USB1.1 instead of 2.

I twiddled with it for a bit, and since it was somewhat intermittent I tried replacing the USB controller (it's an add on card) in the server. Over the next couple of days I tried another USB enclosure, another USB cable, and copying files from different server. The problem kind of came and went, so no one change seemed to be the fix.

Since this is the off-site backup, I had started using another (smaller) drive to copy the recent information to - this setup was working fine. I bought another 1TB drive and enclosure, both different brands than the existing units, partitioned and formatted it correctly from a linux box, and started using it. It was running fine at full speed. When I had time I started copying the older archive info that was only on the first TB drive over as well.

Now this morning that new drive started running slow....

The only thing that makes any sense at all to be at this point is some problem with USB enclosures and large drives - e.g. once it gets past 650meg or so they start having problems? But the two enclosures are completely different chipsets - one has IDE + SATA, the other is SATA only. It can't be that widespread an issue can it?

OK, so now I've typed all this out, the ducky still hasn't said anything...

Anybody else want to comment?

Wednesday, November 18, 2009

Finding OSX Aliases in a SMB/CIFS Share

Just a quick follow up to my previous post.

In case it wasn't obvious - if you want to find all those OSX alias files it's just a simple

grep -r XSym /path/to/smbshare/on/server


Updated:

If I had more of them I'd hack up a script to pull the path info out of them and create the symlinks automatically....


This is really hacky, but you can make symlinks out of alias files with it.
If a dragon appears and demands a dumptruck for a four-wheeler, don't blame it on me!


read NAME && LINK=$(tail -n 2 $NAME | head -n 1) && rm -v $NAME && ln -sv "$LINK" "$NAME"