Archive for the ‘Linux’ Category

Getting started with ZFS on Linux: starting the f’n thing

2009-09-27

I am running Ubuntu 08.10 (yeah, i know, waiting for 09-10) and just got a Rosewill RSV-S8 to replace my Drobo, and want to run ZFS on the disks in it, because ZFS is badass. I thought I had to run OpenSolaris or at least Nexenta (ubuntu on top of the solaris kernel, and yes, it’s real) but it turns out there’s a project called zfs-fuse which lets you run ZFS on Linux. FUSE is the “Filesystem in Userspace” project, which lets you run any filesystem as a regular system user. Fuse is necessary because ZFS licensing prohibits the GPL’d linux kernel from using its code, and normal linux filesystems need to be made a part of the kernel.

Now that the background is out of the way, I thought I’d start to pastedump the warnings I run into along the way, so that the greater googlenet may be able to search for them. (more…)

How to rename files in a directory to lowercase

2009-09-05

Ever want to take a massive tree of files and rename them all lowercase? (Ever work between case-sensitive and case-insensitive systems? :\) Here’s my first attempt:


find . -type f -and -not -type d -print0 | xargs -0 -n 1 echo | while read line; do target=$(echo $line | tr A-Z a-z); echo mv \"$line\" \"$target\"; done | less

which looks fine, until you realize that the path is made lowercase too, despite only looking at files. So I googled, and found a StackOverflow page: http://stackoverflow.com/questions/152514/how-to-rename-all-folders-and-files-to-lowercase-on-linux with this bit:


for SRC in `find my_root_dir -depth`
do
DST=`dirname "${SRC}"`/`basename "${SRC}" | tr '[A-Z]' '[a-z]'`
if [ "${SRC}" != "${DST}" ]
then
[ ! -e "${DST}" ] && mv -T "${SRC}" "${DST}" || echo "${SRC} was not renamed"
fi
done

which isn’t careful about spaces in the filename. But otherwise, it’s on to something with dirname and basename. Revisit mine!


find . -type f -and -not -type d -print0 | xargs -0 -n 1 echo | while read line; do target=$(basename "$line" | tr A-Z a-z); target=$(dirname "$line")/$target; mv "$line" "$target"; done

Drobo and my typical luck

2009-03-22

I’m not gonna lie; this is pretty dry and mostly here for google fodder. Still, this might tickle your nerd-bone.

Not-so-recently I bought a Drobo for storage. I was tired of fake on-motherboard RAID, and I didn’t want to spring for a 3ware RAID card and the associated learning curve. I heard about the Drobo from a friend, and got it and the DroboShare. After having a poor experience with the DroboShare (I wrote a review on NewEgg but the short version: it does less than a linux server) I decided I’d get rid of my existing file server and use my desktop and the Drobo as the server.

Eventually. I was about to move, had projects at work that needed love, and had some planned / unplanned time off. I did the rsync when I had the DroboShare, and didn’t get to play again on my linux box until recently.

I re-ran the rsync to get it back up-to-date. I noticed the rsync had file errors – all of the filenames with non-ascii characters (a not-insignificant amount of my music) always showed up in the transfer list. That was bad news, but I blamed the DroboShare. Who knows how it formatted the Drobo disk pack? Charset could be some obscure ext3 option, and I didn’t care to invest the time to find out. I reformatted using droboview in the linux drobo-utils package. For good measure, I set the LUN size to 4 (meaning the max size would be 4 TB, instead of segmenting into many virtual 2TB disks).

I mounted with errors=remount-ro and ran an rsync. After a couple dozen GB, I started to see “transfer failed – target is read only” and had a looksee in dmesg. Here’s what I got:


[131174.845284] kjournald starting. Commit interval 5 seconds
[131174.817576] EXT3 FS on sdb1, internal journal
[131174.817778] EXT3-fs: mounted filesystem with ordered data mode.
[136948.130539] journal_bmap: journal block not found at offset 12 on sdb1
[136948.130545] Aborting journal on device sdb1.
[136948.140801] EXT3-fs error (device sdb1) in ext3_new_blocks: Journal has aborted
[136948.140895] Remounting filesystem read-only
[136948.143414] __journal_remove_journal_head: freeing b_committed_data
[136948.143438] __journal_remove_journal_head: freeing b_committed_data
[136948.143454] __journal_remove_journal_head: freeing b_committed_data
[136952.123413] __journal_remove_journal_head: freeing b_committed_data
[136952.123672] __journal_remove_journal_head: freeing b_committed_data
[136952.123755] __journal_remove_journal_head: freeing b_committed_data
[136952.123831] __journal_remove_journal_head: freeing b_committed_data
[136952.123906] __journal_remove_journal_head: freeing b_committed_data
[136952.123975] __journal_remove_journal_head: freeing b_committed_data
[136952.123992] __journal_remove_journal_head: freeing b_committed_data
[136952.124006] __journal_remove_journal_head: freeing b_committed_data
[136952.124016] __journal_remove_journal_head: freeing b_committed_data
[136952.124030] __journal_remove_journal_head: freeing b_committed_data
[136952.124043] __journal_remove_journal_head: freeing b_committed_data
[136952.124191] __journal_remove_journal_head: freeing b_committed_data
[136952.124208] __journal_remove_journal_head: freeing b_committed_data
[136952.124280] __journal_remove_journal_head: freeing b_committed_data
[136952.124335] __journal_remove_journal_head: freeing b_committed_data
[136952.124345] __journal_remove_journal_head: freeing b_frozen_data
[136952.124350] __journal_remove_journal_head: freeing b_frozen_data
[136952.124354] __journal_remove_journal_head: freeing b_frozen_data

and this on re-mount:

mount: wrong fs type, bad option, bad superblock on /dev/sdb1,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

Aww, dammit. What did droboview do wrong? So i googled for EXT3-fs error dmesg drobo and got an authoritative sounding page with command-line instructions. I can get down with the hands-on version so I can scope out where breaks happen. But lo and behold, it worked just fine. The rsync ran fine, and it unmounted and re-mounted correctly. We’ll see how it goes in the long run, but it’s lookin good for now! If you hear nothing, then I heartily endorse this.

Linux Flash – pissed that Myspace kills it? Try Flash 10 Beta! (plus 64-bit tips)

2008-05-19

Oh yeah. So was I. The current version of Adobe Flash for Linux (9.0.124 for the intrepid) breaks as soon as you load the myspace music player. If you’re any kind of music fan, that kinda ruins 50% of new music availability. I got agitated enough to do something about it today, here’s how i installed the new flash 10 beta and fixed the issue.

(more…)

Unfail for Linux Network Manager

2008-02-01

I use ubuntu (now kubuntu, whatevs) and had the little network manager applet go AWOL on me – it was stuck with “manual configuration” and wouldn’t do its magic for me. Now, I’ve had to write my own nastiness for ifup/down scripts before, so I could cope, but it sucked. I have looked around, but only recently found [a page with the solution to the problem.](https://answers.launchpad.net/ubuntu/+source/knetworkmanager/+question/15308) Life is tastes better now.

Linux GRUB – autodetect, GUI, gimme something over here

2007-02-27

If you have used Mac OS (classic or X) you may not have used [Startup Disk][], but if you have ever have you know how essential it is. Well, Linux users are much more likely using multiple operating systems, but their bootloader, [GRUB](http://www.gnu.org/software/grub/), is slightly… *lacking*.

[Startup Disk]: http://mac.wikia.com/wiki/Startup_Disk_(System_Preferences)

There’re two parts to a bootloader: figuring out what can be booted, and letting the user select which of those bootable things to… boot. Startup Disk rocks at both of these. GRUB sucks at both of these.

(more…)

The Linux “Switch” (aka, Why My Next Computer Will be an Apple Again)

2006-09-29

For those of you just tuning into my blog and/or my life, I ["switched"](http://www.pauloppenheim.com/blog/2005/12/16/im-a-switcher/) my computing platform in a strange way – from Mac OS X to Linux. I have learned a lot in the past 9 months, and I would like to share some of my surprising discoveries.

(more…)

Digital Address Book portability

2006-01-18

Yeesh. So here we are, year 2006, and I have no idea how to share contact data between several connected computers. Every major OS has an address book API, and almost all of them use VCard formatted data. Well, how do you keep them synchromized? This isn’t a new-fangled Web 2.0 problem, this is the kind of thing it’s embarrasing to realize is unsolved.

(more…)

Happy New Year! Port and Linux.

2006-01-02

Happy new year friends and family, merry chrismas, happy hanukkah, fevstive solstice and all that as well. I’m sitting with my new Dell Inspiron 6000 laptop and a glass of port enjoying my day off work. I’m also configuring debian linux on this bad little boy.

(more…)

Linux Router on the Cheap

2005-12-11

[http://www.wi-fiplanet.com/tutorials/article.php/3562391](http://www.wi-fiplanet.com/tutorials/article.php/3562391)

Unfortunately this article doesn’t mention that Linksys *did* stop selling this unit. They sell a different unit (which does not run Linux) under the same name, and took the Linux version and [renamed it the WRT54GL](http://hardware.slashdot.org/article.pl?sid=05/12/01/2326222&from=rss) (the L is for Linux… GET IT?!?) and added $15 to the price. Because of this stupid maneuver I have to ship the one I bought back, and get the new one. Grrr. Hopefully the new firmware is as good as people say, because the WRT54G v5 that I bought (without Linux, with VxWorks) crashed every 4 hours for no reason.