Creating an encrypted volume
I needed to meet my company's required security policy for taking source code offsite: 256bit AES encryption.
Since the source code I had on my laptop was within a Virtual Machine, I thought it would be a good solution to make an encrypted filesystem big enough for the VM, and only mount it when I wanted to work.
Here's my requirements:
- Encrypted FS that is (un)mountable whenever need be
- Passphrase to mount the filesystem
- 30GB of storage within the filesystem, to accomodate the 30GB VM disk.
Wiping a hard drive
Wiping a HardDrive is a common task at the workplace or whenever you're getting ready to sell a PC. There is a utility to do just such a thing in almost all Linux Bootdisks called shred.
Shred can be used to wipe files, or whole drives. To wipe a drive, the following parameters are good to know
-z After shredding, one more pass will be made to write all zeros to the drive, not necessary, but it hides the fact that the disk has been shredded
-v Display messages about progress, which is handy since shredding a drive takes a fair deal of time
-n x x is the number of passes you wish to make. 3 is a good number, and if you use the -z option it will be 3 shredding passes followed by a 4th pass to zero out all the data
Put it together and pass it a drive to wipe:
shred -zvn 3 /dev/sda
And voila, all your private data goes bye-bye
Restoring a lost RAID array
After an upgrade from Edgy to Feisty my RAID array disappeared (aka, I shit my pants).
Doing a 'cat /proc/mdstat' produced:
Personalities : [raid6] [raid5] [raid4]
<none>
Thankfully I had backups of my mdadm.conf and lvm.conf files so I knew that as long as I didn't alter the data on the drives I could always fall back to Edgy and still have my files.
After trying a few things with mdadm, all unsuccessfully, I decided to uninstall it entirely. So I made a (second) backup of my mdadm.conf and lvm.conf files, and did a:
apt-get --purge remove mdadm lvm2
This uninstalls the packages and also removes the config files (that's what the --purge option is there for).
After uninstalling them I verified the configs were gone and reinstalled the packages through Synaptic inside of GNOME. During the install it prompted which arrays were required to boot. On my failed upgrade I had configured it with "all" but I really didn't need my array at boot time, my root partition is on a standalone IDE drive, so this time I told it "none".
I expected to have more tinkering to do, but after the install I again did a "cat /proc/mdstat" and to my surprise my array was back! *yay*
Now I just had to get my lvm partitions back. I've found the Gentoo LVM2 installation guide very usefull, and a good resource for LVM, so I turned to it to see how to recover volumes. The commands to restore my volumes were:
vgscan
vgchange -a y
And voila, my array and it's partitions were good as new. A quick "mount -a" brought them all up without a glitch!
Edgy to Feisty Upgrade
I've been running Edgy as a deskop/mythTV box for several months, and have tried Feisty on a spare laptop at work. Feisty includes a large number of multimedia-integration improvements, so I thought I'd try it on my myth-machine.
The process is easy-as-pie. Just run "update-manager -c -d" and it's a simple walk-through process.
Obligatory Warning: Feisty won't be officially released until April, and it's still labeled an Alpha release, so be warned it has lots of bugs and is not stable--personally I see my gnome-panel crash quite often, as well as a number of other oddities. You've been warned