leif's blog

Swap and UUID

I recently had to repartition a disk (using parted), to resize some partitions. This meant redoing the swap partition. In my /etc/fstab, all mounts are done via UUID's, including the swap. So, poking around a bit to figure out what the UUID is/was for my new swap partition, I did the following:

root@jake 272/0 # mkswap  /dev/sda4
Setting up swapspace version 1, size = 3894268 KiB
no label, UUID=7d0f43ed-85f9-4e05-be8f-42cf12104bad
root@jake 273/0 # blkid
/dev/sda2: UUID="7b0741cd-a19a-4111-a3fe-3ed4d74706ba" TYPE="ext4"
/dev/sda3: UUID="49fac9f3-3547-420f-afc0-88dfac70459f" TYPE="ext4"
/dev/sda4: UUID="7d0f43ed-85f9-4e05-be8f-42cf12104bad" TYPE="swap"

Then it's just a matter of using the new UUID for the swap partition (/dev/sda4) in /etc/fstab, e.g.

UUID=49fac9f3-3547-420f-afc0-88dfac70459f /                       ext4    defaults        1 1
UUID=7b0741cd-a19a-4111-a3fe-3ed4d74706ba /boot                   ext4    defaults        1 2
UUID=7d0f43ed-85f9-4e05-be8f-42cf12104bad swap                    swap    defaults        0 0
tmpfs                                     /mnt/tmpfs              tmpfs   size=192m,noatime 0 0

My desktop

Recently, I decided to simplify my office setup: Software, hardware, email folders, everything! As such, i decided to only keep my two MacBook's in the office, and move everything to the basement (for now). I also replaced the three 24" monitors with one 30" monster Dell. This is what the new setup looks like:

 

So what's here? The laptop to the right is a MacBook Pro, with 8GB and (soon) a 240GB SSD drive. This connects to the Dell 30" using a mini-DisplayPort to DisplayPort, running at 2560x1600 resolution. The laptop screen resolution is 1440x900. Next to this laptop is also my Chumby! This replaces all my old Linux desktop use, long term, I'm planning to build a combined file server and Virtual Machine server to have just one high power box running 24x7. I'm not there quite yet, but next hardware upgrade will be a monster box with lots of disk and lots of RAM and CPU.

The laptop to the left is a MacBook Air with 4GB RAM (sigh, Apple, why, why?) and 256GB SSD. This is my primary Go Daddy work laptop (thanks to my manager, who somehow managed to pull that through IT). This is also my main travel laptop at this point, it has everything I need, and it's lightweight, and fast!

The keyboard is a Gouldtouch "split keyboard", for Mac. Love it!

Missing emacs symlink on Fedora Core

I just finished installing Fedora Core 16 on a new router I'm planinng on installing up in our little cabin. Things went mostly well, except the symlink to Emacs was missing. The horror! The RPM was most certainly install, but no emacs in my path was to be found. Well, it turns out, for some reason (who knows why ...), the installer did not finish creating the Emacs symlink. It's quite possible it missed other links too, but Emacs was obviously the number one priority. Poking around a little, it was easy to restore life as we know it:

sudo alternatives --install /usr/bin/emacs emacs /usr/bin/emacs-23.3 10

Hacking: 

Clearing page caches in Linux

Brian France pointed this out to me, it's useful stuff, particularly when benchmarking I/O.

To free pagecache:

  • echo 1 > /proc/sys/vm/drop_caches

To free dentries and inodes:

  • echo 2 > /proc/sys/vm/drop_caches

To free pagecache, dentries and inodes:

  • echo 3 > /proc/sys/vm/drop_caches

It's a good idea to sync first, to assure that all dirty page caches are dropped.

Ubuntu upgrades and BTRFS snapshots

One of my VMs is running Ubuntu with BTRFS on the boot disk. During an Ubuntu upgrade, I noticed a significant increase in disk space usage, and it turns out Ubuntu created a snapshot on my BTRFS volumes. Now, this is pretty neat, but once I verified everything was working fine, I wanted to delete the old snapshot. It turned out to be a bit more trickier than I though, but with some help from Sami Haahtinen, I got it to work. First, to list the sub volumes, I did

ubuntu-server (16:07) 3/0 $ sudo btrfs subvolume list /
ID 256 top level 5 path @
ID 257 top level 5 path @home
ID 258 top level 5 path @apt-snapshot-release-upgrade-oneiric-2011-10-13_12:41:44

The next step, which was crucial, is to "mount" the full disk BTRFS is using, without specifying a sub-volume:

ubuntu-server (16:09) 4/0 $ sudo mount /dev/mapper/ubuntu--server-slash /mnt

Your disk name will obviously differ (most likely), but after this, you can now delete this sub-volume:

ubuntu-server (16:09) 5/0 $ cd /mnt
ubuntu-server (16:10) 6/0 $ sudo btrfs subvolume delete '@apt-snapshot-release-upgrade-oneiric-2011-10-13_12:41:44'

Hacking: 

Upgrading Ubuntu from command line

Ubuntu 11.10 was just released, and I eagerly decided to upgrade my "server' VM to "Oneiric Ocelot". My installation has no GUI, so I could not use the normal tools I'd use to do the live upgrade. So instead, I had to figure out the command line tools to use. Now, this is well documented, but is still worthwhile to repeat.

$ sudo apt-get install update-manager-core
$ do-release-upgrade -d

That's pretty much it, just follow the destructions on the screen (oh, and recommended not to do this over an ssh session).

Hacking: 

Moab 2011: Day 4

Today we went through Chicken Corners:

P1000373 P1000371

Everything was mostly great, except when my extra fuel bladder (tank) dislodged and hooked up into the rear break. Not fun! We got a good 45 miles on the bikes in the morning, and I didn't even run out of fuel like last year. The EFI tuner must be helping. As usual, we decided to take a few shots goofing around as well:

P1000337 P1000363-EDIT

In the afternoon, we decided to do Slickrock, but only got a few miles on it, and then turned around. Everyone was tired, and Ted banged up his ankle again. Better save the energy, and ankles, for tomorrow. Only two videos uploaded today:

http://contour.com/stories/moab-day-4-2

http://contour.com/stories/moab-day-4-1

Moab 2011: Day 3

Finally a full days worth of riding, no broken bikes! Well, at least that's how it started... We went to 7 Mile Rim in the morning, getting a good ~18 miles in with a lot of fun riding. This is me to the left, on the Husqvarna, and Randy to the right on his Yamaha:

P1000291 P1000284

Randy's dad, Ted, of course had to be a showoff, and did a nice wipeout:

P1000289

We moved on to Wipeout Hill, which Randy of course decided to run. This thing is really steep, and he almost had it... But not quite.

P1000311 P1000313

After lunch break, we spent the afternoon doing Porcupine Rim, Porcupine Trail, and parts of Fins and Things again. We rode for about 22 miles, and a good time was had by everyone. The bikes still works well, mostly, we're off to the Yamaha store tomorrow morning, to buy a new bark buster for Randy... Here are a few movies from the day as well:

http://contour.com/stories/moab-day-3-1

http://contour.com/stories/moab-day-3-2

http://contour.com/stories/moab-day-3-3

http://contour.com/stories/moab-day-3-4

Misc: 

Moab 2011: Day 2

With Randy's bike being basically in pieces, and not having the right tools to get it fixed, we decided to drop it off at the local Yamaha dealer here in Moab. They were great, took in the bike immediately, and promised to have it done today. After that, and the mandatory Egg McMuffin, we went and rode Fins and Things and Porcupine Trail. I of course forgot the battery for the Lumix camera that I brought, so no good pictures of the great views, but here's one shot taken with the video camera:

FILE0040

We rode around for a couple of hours, and got a solid ~21 miles on the bikes again. In the afternoon, Ted (Randy's dad) arrived, and we all hung out waiting for Randy's bike to be fixed. We picked it up around 5.30pm, and went out for another 7 miles of "test riding" it, and viola, we have three bikes again! I've uploaded a few more movies to my Contour account, here are a few links again:

http://contour.com/stories/moab-day-2-1

http://contour.com/stories/moab-day-2-2

http://contour.com/stories/moab-day-2-3

http://contour.com/stories/moab-day-2-4

Looking forward to a good, long day of riding tomorrow, with no broken bikes (or bones).

Misc: 

Pages

Subscribe to RSS - leif's blog