Increasing the size of a LUKS cryptfs partition

Warning: This guide assumes that the partition you’re expanding into is adjacent to a pool of free space. Things get a bit trickier if that isn’t the case (re-arranging your partitions is probably necessary).

The system that I performed this on: Fedora 16 KDE install, on a 120GB SSD installation (migrated from an 80GB SSD using Acronis True Image). Fedora doesn’t set encryption up via LVM in the installer, seemingly opting for a plain vanilla container.

Step 0: Boot into a live CD environment. I used a Fedora 16 KDE respin CD which had all these tools. Open a console (in KDE this was `konsole`).

Step 1: Blow away the partition itself. You’ll need to do this with `fdisk`. Make a new partition, with the cluster of free space included. Select Linux for type when prompted (usually 82 OR 83). Write changes to disk.

Step 2: Open your crypted filesystem:

# Replace /dev/sda2 with your own filesystem

# cryptsetup luksOpen /dev/sda2 root 

Step 3: Expand the crypted FS

# cryptsetup resize root

# e2fsck -f /dev/mapper/root

# resize2fs -p /dev/mapper/root

Step 4: Safety hat

# cryptsetup luksClose root

# sync; sync; reboot

Advertisements

Increasing the size of a LUKS cryptfs partition

Warning: This guide assumes that the partition you’re expanding into is adjacent to a pool of free space. Things get a bit trickier if that isn’t the case (re-arranging your partitions is probably necessary).

The system that I performed this on: Fedora 16 KDE install, on a 120GB SSD installation (migrated from an 80GB SSD using Acronis True Image). Fedora doesn’t set encryption up via LVM in the installer, seemingly opting for a plain vanilla container.

Step 0: Boot into a live CD environment. I used a Fedora 16 KDE respin CD which had all these tools. Open a console (in KDE this was `konsole`).

Step 1: Blow away the partition itself. You’ll need to do this with `fdisk`. Make a new partition, with the cluster of free space included. Select Linux for type when prompted (usually 82 OR 83). Write changes to disk.

Step 2: Open your crypted filesystem:

<code>

# Replace /dev/sda2 with your own filesystem

# cryptsetup luksOpen /dev/sda2 root 

</code>

Step 3: Expand the crypted FS

<code>

# cryptsetup resize root

# e2fsck -f /dev/mapper/root

# resize2fs -p /dev/mapper/root

</code>

Step 4: Safety hat

<code>

# cryptsetup luksClose root

# sync; sync; reboot

</code>

Team Fortress 2 Demo: Unknown command “demopauseafterinit”

Sometimes this error can pop up due to a corrupt file, or changes in the TF2 version. If you know that isn’t the case (the TF2 version is the same, etc), it is possible that the Demo Editor is causing problems.

Delete the .vdm files in the same folder as your demo. You’ll lose your edits, but the video will be playable again.

Adding an IP address to Debian/Ubuntu Linux

# sudo vi /etc/network/interfaces

Your original will look something like this:

# Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
# /usr/share/doc/ifupdown/examples for more information.

auto lo eth0

iface lo inet loopback

iface eth0 inet static
address XXX.XXX.XXX.XXX
netmask 255.255.255.255
broadcast 0.0.0.0

Add the following below it to add another address to the same interface:

auto eth0:1
iface eth0:1 inet static
address XXX.XXX.XXX.XXX
netmask 255.255.255.255
broadcast 0.0.0.0

Exit.

# sudo /etc/init.d/networking restart

Ping the interface and check to see if the IP is up.

Instaling Ubuntu Linux on the HP Pavilion tx25135cl

The HP Pavilion tx25135cl is a 12.1″ laptop tablet. It comes with an AMD Turion X2 RM-70 processor clocked at 2.0Ghz per core. Along with an ATi Radeon 3200 HD, this makes it a part of the AMD Puma platform. It has 3GB of RAM, a 250GB hard drive, and is usually pre-installed with Windows Vista Home Premium.

All installation work was done on the Ubuntu alternative installer.

Things that need fixing:
Installation:
You will need to pass nolapic and acpi=off as kernel options, both for installation and normal boot. Not doing this results in a thermal warning (and subsequently a forced shutdown). Specifying other combinations is prone to causing a kernel panic (and subsequently a hard system lockup as a result).

Ethernet:
Realtek Ethernet is severely broken with the RTL8111/816B that gets loaded as stock.
A bug report for this is here: https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.22/+bug/141343

The fastest way to fix this is to use Jameson William’s fixup. You will want to load the file there onto a USB stick. From a fresh Hardy install (alternative installer), the patch program was not installed, so you may need to grab a deb as well.

Grab the fixup here (read the instructions for it and install): http://www.jamesonwilliams.com/hardy-r8168.html
If you end up needing the patch utility, you can find it here: http://us.archive.ubuntu.com/ubuntu/pool/main/p/patch/
Select the appropriate architecture, download it onto your USB stick, and as root on the affected computer, issue a `dpkg -i patch_[version here]_[architecture here].deb` to install it.

Wireless:
Broadcom BCM4328 a/b/g/n

This Broadcom chipset is VERY nice, it does 802.11 a/b/g/n. However it doesn’t get recognized as stock, and thus it falls over on itself:

https://help.ubuntu.com/community/WifiDocs/Driver/bcm43xx/Feisty_No-Fluff#Testimonials

This did not work for me on the cl, even though others with similar configurations had working wireless configurations. This may change in the future.

At this point, I decided to return the laptop due to time constraints (I was not able to get to work on the video or tablet features). Hopefully this post helps somebody out.

Buying Steam games using Wine

When you get an error that Firefox doesn’t know how to handle the Steam protocol, and you’re buying using PayPal, do the following in the same directory the Steam.exe executable is in. (This is usually ~/.wine/drive_c/Program Files/Steam/)

$ wine Steam.exe steam://paypal/return

This will cause your current Wine’d Steam to continue along properly to complete the purchase.

When setting up a Hadoop cluster..

Make sure you clear out your /etc/hosts. I had plenty of hunting trying to figure out why the dfs daemon kept binding to localhost and how to unbind it.

For those interested in setting up a Hadoop cluster, go
here

Enabling SSH keys on OpenWRT

Your SSH keys should go into /etc/dropbear, and not into ~/.ssh/.

More documentation here, including how to generate DSA public/private keys.

Update: Keep in mind that regular users you create (by editing /etc/passwd), have their ssh keys in their home directories.

PXE booting with OpenWRT Kamikaze

As a small appliance fan, I really like OpenWRT. I use it almost everywhere on my home network because it is agile, flexible, and opens up new possibilities for what used to be just a box that connected you to the Internet. With some of the newer models, like the WRTSL54GS, you can attach external storage or devices which opens up even more possibilities.

I spent some part of my waking hours today figuring out how to perform PXE booting to install OpenBSD (to save burning an ISO). If you’re not using the Kamikaze release, dnsmasq, as far as I am aware has not changed greatly so the following should still work. By the way, the great thing is that a dedicated tftp daemon is not required for all of this either. dnsmasq has it all built-in.

In order to enable PXE booting:
1. Log in as root
2. Add to /etc/dnsmasq.conf the following configuration options 1:

# PXE Booting (For installs):
enable-tftp
# Define your own tftp-root, the user/group for this directory was
# nobody:nogroup from a leftover atftpd install
tftp-root=/tmp/mnt/shared
# This is the file that will be tftp'd across
dhcp-boot=pxeboot

3. Restart dnsmasq. In Kamikzae, the init scripts allow you to do:
/etc/init.d/dnsmasq restart

For older releases, you may need to find the process with `ps` and either send a SIGHUP `kill $pid -HUP`, or SIGTERM `kill $pid`, then restart it. Either one works.

4. For OpenBSD, drop `pxeboot` and `bsd.rd` into the tftp-root directory. Both can be found here.

5. Since the `pxeboot` image looks for `bsd` to slurp, you may need to create a symlink from bsd.rd to bsd:
`ln -s bsd.rd bsd`

6. Reconfigure the target host for installation to boot from LAN, and that should be it.

1More documentation is available here: http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html