Tripwire on Ubuntu 6.06

Quick instructions to getting Tripwire installed and running on Ubuntu 6.06 LTS (Dapper Drake). For more detailed instructions check out this site.

1. Install Tripwire. Say Yes to everything, and create some passwords.

% sudo apt-get install tripwire
% sudo tripwire -m i

2. Fix the policy. I was getting many errors that looked like:

### Warning: File system error.
### Filename: /root/.Xauthority
### No such file or directory

I removed the non-existent files from the policy file with the following commands:

% sudo cp /etc/tripwire/twpol.txt /etc/tripwire/twpol.txt.bak
% sudo vim /etc/tripwire/twpol.txt
% sudo tripwire --update-policy -Z low /etc/tripwire/twpol.txt

Later, when you need to update the database, such as after running updates (adjust the date and number from then end of the file, or sometimes you can just drop the whole -r flag):

% sudo tripwire -m u -r /var/lib/tripwire/report/closetbox64-20071223-133927.twr

By default, Tripwire will be set to email whenever it sees changes. To quickly check the status, run:

% sudo tripwire --check

Run a Command on Boot for Ubuntu

I used this to start fetchmail on an Ubuntu 7.10 server running Request Tracker.

Edit /etc/rc.local, add your command, make sure it doesn’t create any output. This is my command:

su rt -c “fetchmail -d 300” > /dev/null 2>&1

It starts a background fetchmail process as the “rt” user, just as the Request Tracker documentation states.

MDADM Versions

distro kernel version mdadm version
Ubuntu 6.06 LTS 2.6.15 1.12.0
Ubuntu 7.04 2.6.20 2.5.6
Ubuntu 8.04 LTS 2.6.24 2.6.3
Ubuntu 8.10 2.6.27 2.6.7
Ubuntu 9.04 2.6.28 2.6.7.1
Ubuntu 10.04 LTS 2.6.32 2.6.7.1
Ubuntu 10.10 2.6.35 2.6.7.1
Ubuntu 11.04 2.6.38 3.1.4
Ubuntu 12.04 3.2.0 3.2.3
CentOS 4.5 2.6.9 1.12.0
CentOS 5.0 2.6.18 2.5.4
CentOS 6.0 2.6.32 3.1.3
Debian 4.0 2.6.18 2.5.6
Debian 5.0 2.6.26 2.6.7.2
Debian 6.0 2.6.32 3.1.4
Fedora 7 2.6.21 2.6.1
Fedora 15 2.6.38 3.1.5

MDADM 2.x on kernels >2.6.17 supports online resizing of RAID 5 arrays :)

Speed Up Rebuilding Linux Software RAID Arrarys

# cat /proc/mdstat

md0 : active raid5 sdf1[7] sdb1[0] sde1[5] sdg1[4] sdh1[3] sdd1[2] sdc1[1]
1465175424 blocks level 5, 64k chunk, algorithm 2 [7/6] [UUUUUU_]
[>………………..] recovery = 1.3% (3331200/244195904) finish=2357.0min speed=1700K/sec

Ouch. Two files are used to control the speed of rebuilding RAID arrays in Linux.

/proc/sys/dev/raid/speed_limit_min
/proc/sys/dev/raid/speed_limit_max

Even though my _max file is set to 200,000K/sec and my system is not doing anything, my RAID 5 rebuild process is hovering around the _min rebuild speed, of 1,000K/sec. With my setup this will take approximately 40 hours to complete, which is too long for me to wait. So, I pushed the _min speed up to 10,000K/sec, which will now take 6 hours to finish, and use slightly more of my system’s idle resources.

root# echo “10000” > /proc/sys/dev/raid/speed_limit_min

Later I set _min to 50,000K/sec, and the rebuild speed topped out at 25,000K/sec.

#cat /proc/mdstat

Personalities : [raid5]
md0 : active raid5 sdf1[7] sdb1[0] sde1[5] sdg1[4] sdh1[3] sdd1[2] sdc1[1]
1465175424 blocks level 5, 64k chunk, algorithm 2 [7/6] [UUUUUU_]
[=>……………….] recovery = 5.1% (12661840/244195904) finish=149.9min speed=25726K/sec

The rebuild took less than 3 hours, down from the original 40.

Find the Model Number of Your DVD Burner in Linux

$ cdrdao drive-info /dev/scd0

Cdrdao version 1.2.2 – (C) Andreas Mueller <[email protected]>
SCSI interface library – (C) Joerg Schilling
Paranoia DAE library – (C) Monty

Check http://cdrdao.sourceforge.net/drives.html#dt for current driver tables.

Using libscg version ‘ubuntu-0.8ubuntu1’

/dev/cdrw: LITE-ON DVDRW LH-20A1S Rev: 9L02
Using driver: Generic SCSI-3/MMC – Version 2.0 (options 0x0000)

Maximum reading speed: 8467 kB/s
Current reading speed: 8467 kB/s
Maximum writing speed: 8467 kB/s
Current writing speed: 8467 kB/s
BurnProof supported: yes
JustLink supported: no
JustSpeed supported: yes

Ubuntu Feisty Fawn Supports Hot Plugging SATA Disks!

I plugged in a 250 GB Seagate 7200.10 hard drive into my Feisty box this evening, and to my surprise, /dev/sdd appeared along with a bunch of stuff in my dmesg output. This is on an NVIDIA Nforce 4 motherboard.

[189006.364000] ata3: exception Emask 0x10 SAct 0x0 SErr 0x150000 action 0x2 frozen
[189006.364000] ata3: hard resetting port
[189013.280000] ata3: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[189013.328000] ata3.00: ata_hpa_resize 1: sectors = 488397168, hpa_sectors = 488397168
[189013.328000] ata3.00: ATA-7: ST3250620AS, 3.AAJ, max UDMA/133
[189013.328000] ata3.00: 488397168 sectors, multi 0: LBA48 NCQ (depth 31/32)
[189013.392000] ata3.00: ata_hpa_resize 1: sectors = 488397168, hpa_sectors = 488397168
[189013.392000] ata3.00: configured for UDMA/133
[189013.392000] ata3: EH pending after completion, repeating EH (cnt=4)
[189013.392000] ata3: EH complete
[189013.396000] scsi 2:0:0:0: Direct-Access     ATA      ST3250620AS      3.AA PQ: 0 ANSI: 5
[189013.396000] ata3: bounce limit 0xFFFFFFFFFFFFFFFF, segment boundary 0xFFFFFFFF, hw segs 61
[189013.400000] SCSI device sdd: 488397168 512-byte hdwr sectors (250059 MB)
[189013.404000] sdd: Write Protect is off
[189013.404000] sdd: Mode Sense: 00 3a 00 00
[189013.408000] SCSI device sdd: write cache: enabled, read cache: enabled, doesn’t support DPO or FUA
[189013.412000] SCSI device sdd: 488397168 512-byte hdwr sectors (250059 MB)
[189013.412000] sdd: Write Protect is off
[189013.412000] sdd: Mode Sense: 00 3a 00 00
[189013.416000] SCSI device sdd: write cache: enabled, read cache: enabled, doesn’t support DPO or FUA
[189013.416000]  sdd: unknown partition table
[189013.432000] sd 2:0:0:0: Attached scsi disk sdd
[189013.432000] sd 2:0:0:0: Attached scsi generic sg4 type 0