parted
Create a single, aligned partition on a drive larger than 2TB.
% sudo parted /dev/sdx (parted)% mklabel gpt (parted)% mkpart primary 1 -1
Create a single, aligned partition on a drive larger than 2TB.
% sudo parted /dev/sdx (parted)% mklabel gpt (parted)% mkpart primary 1 -1
LVM allows you to hot add devices to expand volume space. It also allows you to hot remove devices, as long as there are enough free extents in the volume group (vgdisplay) to move data around. Here I’m going to replace a 400 GB drive (sdg) with a 750 GB one (sdf) from logical volume “backup” on volume group “disks”. It does not matter how many hard drives are in the volume group, and the filesystem can stay mounted.
1 | $ sudo pvcreate /dev/sdh1 |
1 | $ sudo vgextend disks /dev/sdh1 |
1 | $ sudo pvmove -v /dev/sdg1 |
1 | $ sudo vgreduce disks /dev/sdg1 |
1 | $ sudo lvextend -l+83463 /dev/disks/backup |
1 | $ sudo resize2fs /dev/disks/backup |
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:
1 2 3 | #!/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.
1 | 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”.
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
$ 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) MontyCheck 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
Instructions here.
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
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.
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.
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: