Feb 21 2011

Manually cleaning an Intel (or other TRIM-able) SSD with hdparm

Tag: LinuxNate @ 5:22 pm

Figured this might be a useful snippet of perl for other folks. When I rebuild my system last Nov, I wiped the drive with the following:
my $a = 0;
while ($a < 312581808) {
my $b = 60000;
if (($a + 60000) >= 312581808) { $b = ($a % 60000) - 1; }
print "\n$a: ";
`hdparm --trim-sector-ranges $a:$b --please-destroy-my-drive /dev/sdh`;
$a = $a + 60000;
}

To use, mount your SSD on another system (or use a system rescue CD or LiveCD with a new enough version of hdparm) and replace “312581808″ with your actual number of sectors (check with fdisk -l or similar) and /dev/sdh with your actual drive.

The tricky parts were:
(1) Figuring out the syntax, although I suspect that it’s better documented now.
(2) Figuring out the 60,000 sector limit (actually 64k/65,536? Dunno. 60,000 exactly worked.) I’m not sure if this is an hdparm limit or an Intel X25M limit.


Jul 12 2010

Manually installing JDKs on Gentoo

Tag: LinuxNate @ 2:57 pm

In case it’s useful for anyone else, if you run the ___.bin installer and see this:

bin/java -version
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object

Check if rt.jar exists in the unpacked directory. If it does not, check if rt.pack exists. If it does, it means that the installer is missing a step.

Rerunning with the command-line options:

"____.bin --accept-license --unpack"

…will fix what ails you by making it unpack those files. If you no longer have the installer, google indicates that there is a program out there called “unpack200″ to unpack the .pack files to .jar, but I have not had a chance to try it.


Jun 22 2010

Recovering deleted/truncated files on ext4

Tag: LinuxNate @ 2:05 am

Due to a bit of stupidity I spent a lot of time looking into how to recover deleted files on ext3/4 and I thought it would be useful to other folks to pass on the following points after the break.
Continue reading “Recovering deleted/truncated files on ext4″


Jul 25 2007

Hans Reiser in Wired

Tag: LinuxNate @ 11:49 am

Hans Reiser: Once a Linux Visionary, Now Accused of Murder

Interesting reading.


Jun 26 2006

An interesting night…

Tag: Linux,PersonalNate @ 10:26 pm
  • First, I discover this afternoon that my server has rebooted on an older Kernel and the SATA drives aren’t being recognized. No wonder it’s going so slow; the RAID is running in degraded mode (not inherently slower for RAID0/mirroring, but in practice it’s going to mean that the system does everything much more carefully wrt flushing buffers and stuff.) So I had to rebuild that tonight; the Linux mdadm tool made that surprisingly easy.
  • Second, the phone line has gone tonight. No DSL, no nuttin’ – I host my own server, so I can post this now, but who knows when y’all are going to get to see it. And I think I’m going into some minor case of internet-access withdrawal (no dialup backup, since the voice phone is down too, but at least I have my PDA thing… slow though it is at home.)

Dec 31 2005

Tech stuff.

Tag: Linux,Meta-bloggingNate @ 10:00 am

Two quick notes:
1) WordPress 2.0 is out. I plan to upgrade when I get back to the states; I’m not convinced it’s really going to be an improvement, but I need to keep up to date with the security patches, so there’s not much choice. Hopefully my old style/theme will still work. If not, expect a very bland defauly style until I have more time…

2) ReiserFS sucks for news spools, even with “notail” on, at least on RAID1. I’d wondered if that was it, and it appears to be the case. My leafnode spool runs to about 1.5 million articles, and 9GB; when I put in the mirrored drives, I put it on it’s own file system and switched it from ext3 to ReiserFS. I noticed then that it took about 6 hours every day to run texpire, which seemed long – but I hadn’t been checking since it had been growing. Well, “notail” sped it up a bit but it still took several hours…. so I got fed up, and with the wireless here, migrated it back to ext3. On ext3? (with dir_index on, data=”ordered”, and commit=60) it took a whopping 12 minuts… or a 40:1 improvement.


Oct 03 2005

I am so l33t!!!

Tag: Administrivia,LinuxNate @ 9:55 am

There was planned downtime this weekend. The server now has mirrored hard drives, using the software RAID1 driver. And a hopefully much faster news spool on its own partitition, but that is a separate issue most of you are unlikely to see (if you actually know me in person and don’t already have one, do feel free to ask for an account…)