Yoooder.com Just another WordPress weblog

6Oct/070

Recovery from a dead FAT32 Windows drive

My landlord's old PC has suffered several failures over the years, including several fans and power supplies and at least one hard drive. When I moved in a year ago they called me over to replace yet another PSU for them, and a few months later to figure out why the machine would not even begin to boot.

The suspect was immediately either the IDE controller or both of its drive. After transplanting the drives to a seperate machine and failing to find their partitions, and after trying a new drive in the machine it was looking as though possibly all were fried.

A couple months have passed and my landlord has had me build him a new computer and the day has come to try to recover his data... Below is the process I've used to diagnose and recover his files.

6Oct/070

Determining / Recovering a Partition’s UUID (Univeral Unique Identifier)

I made a boo-boo after reinstalling my base Ubuntu system, and accidently copied over the entirety of the fresh installation's /etc/fstab file with my old /etc/fstab.

The UUIDs of my new installation were lost, so after a little Googling I found that there's a helpful little utility called "vol_id" specifically for determining this type of info...

vol_id [partition]

and voila, I've got my fstab back in fine shape :-)

19Mar/070

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.

19Mar/070

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

Filed under: Linux, Security, Tips No Comments
18Mar/070

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!

Filed under: Linux, Tips, Ubuntu No Comments
18Mar/070

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

Filed under: Linux, Tips, Ubuntu No Comments