A Project Blog

Start Folding@Home on Boot with Screen on Ubuntu Linux

by @ March 1, 2008. Filed under howto, shell

Quick instructions to get Folding@home (or any other program) to run at boot before user login on Ubuntu Linux. This probably works on other distros with an rc.local file too.

1. Install F@H client, mine is in /opt/folding

2. Create a simple script, I called mine folding.sh and is only has:

#!/bin/bash
cd /opt/folding
./fah6 -smp

3. Put the screen command in /etc/rc.local. This will execute as user nick (su nick -c), “-dmS” will create the session detached and name it folding, and “bash –rcfile” will allow the screen session to keep running even if folding quits.

su nick -c “screen -dmS folding bash –rcfile /home/nick/bin/folding.sh”

Folding@home now starts whenever the computer boots, before anyone logs in. Nick can reattach to it and  control it or watch the progress by running “screen -r folding”.

Tripwire on Ubuntu 6.06

by @ December 23, 2007. Filed under Uncategorized, howto, server

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

Find the Model Number of Your DVD Burner in Linux

by @ May 14, 2007. Filed under hardware, howto

$ cdrdao drive-info /dev/scd0

Cdrdao version 1.2.2 - (C) Andreas Mueller <andreas@daneb.de>
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 0×0000)

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

Install the Ubuntu Studio Theme in Ubuntu Feisty

by @ May 11, 2007. Filed under howto

Instructions here.

Download Ubuntu 7.04

by @ April 19, 2007. Filed under howto

Download all the Ubuntu i386 and AMD64 ISOs with one command.

wget ftp://mirrors.kernel.org/ubuntu-releases/7.04/ubuntu-7.04-{desktop,server,alternate}-{i386,amd64}.iso

Swap Hard Drives with Ubuntu 6.10

by @ January 16, 2007. Filed under file systems, howto

I recently upgrade my main workstation’s hard drive under Ubuntu 6.10 and noticed a couple things changed during the process. Here are my instructions for a fast and reliably hard drive swap. I’m using SATA drives without LVM using the default Ubuntu install and partition options for this howto.

  1. Prepare
    1. Shutdown your machine and install your new hard drive. Don’t mess with your current hard drive (yet)
    2. Find a LiveCD, I used the Ubuntu 6.10 LiveCD, it matched my OS, but it doesn’t have to. Knoppix should work fine.
    3. Boot using your LiveCD
    4. After booting, open a terminal and “sudo su” to become root
  2. Setup your new drive
    1. Use cfdisk /dev/sda to look at your partitions on your current drive. I have sda1 of type linux as most of my current drive, and a 6 GB sda5 as linux swap at the end
    2. Duplicate this on your new drive using cfdisk /dev/sdb, adjusting for space as necessary. I created a new primary partition using cfdisk using all but 6 GB of space, then a new logical partition using the rest of the space. You must create the partitions in this order to get the right numbering
    3. make the primary partition to bootable
    4. set the swap partition as type 82 (linux swap)
    5. save and quit
    6. create filesystems on the new partitions using mkfs.ext3 /dev/sdb1 and mkswap /dev/sdb5
  3. Copy data
    1. Make directories to mount your old and new partitions, in this case, /mnt/sda1 and /mnt/sdb1
    2. Mount your drives to these partitions using mount /dev/sda1 /mnt/sda1 and mount /dev/sdb1 /mnt/sdb1
    3. Copy all your data from your old drive to your new drive using cp -a /mnt/sda1/* /mnt/sdb1/ . The -a will preserve owners, permissions, date, etc.
    4. Get up and do something else. It took 70 minutes for my machine to copy about 150 GB of data from one drive to the other
  4. Fix the boot options
    1. This is where Ubuntu 6.10 differs from previous versions. Fstab and menu.lst both use UUID numbers to find partitions. To get the UUID number of your new partitions, run vol_id /dev/sdb1 and vol_id /dev/sdb5 . Copy these numbers into their appropriate places in your /mnt/sdb1/etc/fstab and /mnt/sdb1/boot/grub/menu.lst files. You may need to dig around the menu.lst to find all the entries.
    2. Now install grub onto the MBR of the new drive to make it bootable. To do this I first chroot into my new system using chroot /mnt/sdb1 /bin/bash . Now that you’re in the new system, run grub. Inside grub, run setup (hd1,0) then root (hd1) . This will differ if you have a different drive setup. Quit grub (quit).
  5. Finish up
    1. Logout of your chroot (logout), unmount your mounted drives umount /dev/sda1 and umount /dev/sdb1, and shutdown your computer. Disconnect your old drive, plug your new drive into the old drive’s cable, and start your computer back up. If everything went well, it will boot back up as if nothing happened.

A Couple Ways to Run FSCK on Ubuntu

by @ November 19, 2006. Filed under file systems, howto

My server decided that an executable file didn’t really exist on the file system, or so I thought. Lack of sleep was the main problem, but here are some things I did to check my file system for errors. I setup this file system on a Ubuntu 6.06 AMD64 install with LVM, so everything is in LVM instead of standard partitions.

# sudo e2fsck -n /dev/mapper/Ubuntu-root

This was showing errors, but I ran it while the system was mounted and running, so there were open files, so this was normal. The -n kept e2fsck from attempting to fix anything, which was good because later I ran the command after booting from an Ubuntu LiveCD and found no errors.

Before booting from the LiveCD I tried to get the system to fix itself by running fsck on boot. Two methods I used to do this on Ubuntu were running these from the live system before rebooting, they both accomplish the same thing, so only one was really needed.

# sudo touch /forcefsck

# sudo tune2fs -C 40 /dev/mapper/Ubuntu-root

These appeared to have no affect, probably because the filesystem was fine, but I took down the system and ran fsck from a LiveCD instead. Of course, this wasn’t as simple as it should have been, the LiveCD did not detect my LVM volumes, so /dev/mapper/Ubuntu-root was missing. The fix was to install LVM2 and start it up.

# sudo apt-get install lvm2
# sudo /etc/init.d/lvm start

The /dev/mapper/ entries then appeared and I could run all the fscks I wanted. At this point my fsck checks were coming out clean, so file system corruption was not to blame.

Ruby on Rails on Ubuntu Edgy

by @ September 30, 2006. Filed under howto, rails

I updated my laptop to Ubuntu 6.10 Beta (Edgy Eft) and it’s working great. So far I’ve had less problems than the beta of Dapper, but it has only been two day. My first experience off the tested path of synaptic packages is ruby on rails. Edgy comes with a rails package, but like Dapper, no gems. So here is the install of gems, and the rails from withing gems, on Ubuntu 6.10 Edgy Eft.

# sudo apt-get install ruby ruby1.8-dev irb rdoc
# wget http://rubyforge.org/frs/download.php/11289/rubygems-0.9.0.tgz
# tar xvfz rubygems-0.9.0.tgz
# cd rubygems-0.9.0
# sudo ruby setup.rb
# sudo gem install rails

I did get an rdoc error, but everything else installed fine, so I ignored it and continued on. This error is fixed by adding rdoc to the apt-get command above. It is here for historical purposes, and perhaps will help someone.

/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require’: no such file to load — rdoc/rdoc (LoadError)

Other Notes:

Subversion Primer

by @ September 26, 2006. Filed under howto

This is a guide for a single user to setup a barebones SVN repository quickly and without any extra confusing instructions.

The following steps will show how to 1.setup a repository for a project, 2. import files into the repo, 3. pull them out into a different folder, and 4. submit changes back to the repo. Before starting, make sure you have subversion installed (sudo apt-get install subversion) on all the computers you will be using. For this howto I’ll be using the server “closetbox” and the client “icebox”. Both are running Ubuntu Linux.

  1. Create an SVN repository for a project on the server.

nick@closetbox:# sudo mkdir /var/svn
nick@closetbox:# sudo svnadmin create /var/svn/frozenindustries
nick@closetbox:# sudo chmod 770 /var/svn/frozenindustries
nick@closetbox:# sudo chown nick:nick /var/svn/frozenindustries

  1. Import files into the repository. I’m going to send over a wordpress blog which is sitting in a folder called “htdocs” on my desktop. This is only done once, after this files are updated using “ci”.

nick@icebox:# svn import -m “look, i’m importing” htdocs/ svn+ssh://closetbox/var/svn/frozenindustries/trunk

  1. Get your data back out of SVN an put it in a folder on the client where you’ll work on it.

nick@icebox:# svn co svn+ssh://closetbox/var/svn/frozenindustries/trunk fi/

  1. After making changes to files in fi, send the changes back to the server. SVN knows which server you checked out from by saving data in a .svn folder. It’ll pop open your default text editor to show the changes. Since we’re trying to be as simple as possible, just assume everything is correct, quit the text editor, and say “c)ontinue”

nick@icebox:# svn ci fi/

That’s it. Repeat steps 3 and 4 to grab copies of you project and submit changes.

Add a Drive to an LVM Volume

by @ September 25, 2006. Filed under file systems, howto

This guide shows how to add a drive to an existing LVM volume.

  1. Erase the partition table on drive /dev/hdd and create the Physical volume

# dd if=/dev/zero of=/dev/hdd bs=1024k count=1
# pvcreate /dev/hdd

  1. Look at the current volume group, for fun

# sudo vgdisplay -A

— Volume group —
VG Name disks
System ID
Format lvm2
Metadata Areas 7
Metadata Sequence No 2
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 7
Act PV 7
VG Size 859.70 GB
PE Size 4.00 MB
Total PE 220084
Alloc PE / Size 220084 / 859.70 GB
Free PE / Size 0 / 0

VG UUID N4TcI6-DIRS-3edy-FAa0-tdUL-MTSX-bs2lJE

  1. Add the Physical Volume to the existing Volume Group, which I creatively named “disks”

# sudo vgextend disks /dev/hdd

  1. Look at the current Volume Group again, my how it has grown

# sudo vgdisplay -A

— Volume group —
-snip-
VG Size 1.11 TB
PE Size 4.00 MB
Total PE 291625
Alloc PE / Size 220084 / 859.70 GB
Free PE / Size 71541 / 279.46 GB

  1. Extend the Logical Volume, this time named “backup”, use the free extents reported by vgdisplay

# sudo lvextend -l+71541 /dev/disks/backup

Extending logical volume backup to 1.11 TB
Logical volume backup successfully resized

  1. And then look at vgdisplay again, whee

# sudo vgdisplay -A

— Volume group —
-snip-
VG Size 1.11 TB
PE Size 4.00 MB
Total PE 291625
Alloc PE / Size 291625 / 1.11 TB
Free PE / Size 0 / 0

  1. Now the final and most exciting step, expanding the filesystem. You’re using XFS right? And here’s a surprise, it should be mounted when you resize it. xfs_growfs will automatically resize the XFS filesystem to use all the available free space, and do it in less than a second.

# sudo xfs_growfs /backup

« Previous

Copyright ©2005-2007 Nicholas Brand. All rights reserved.
powered by WordPress.

categories:

links:

blogroll:

search:

archives:

November 2008
M T W T F S S
« Mar    
 12
3456789
10111213141516
17181920212223
24252627282930

other:

computers:

  • backupbox
  • closetbox
  • icebox
  • thinkpad
  • minibox
  • briefcasebox
  • summary
  • mythbox
  • other devices:

  • tivo
  • nokia 770
  • personal:

    Digg
    Amazon Wishlist
    Last.FM
    del.icio.us

    24 queries. 0.275 seconds