Update Ubuntu Rackspace Cloud Server

Assuming you’ve already “spun-up” a Linux cloud server of your choice, the first thing to do is update the system. Here I’m using Ubuntu Server 13.10.

SSH onto your box with the below command, replacing the IP address with that of your server. You will need to accept the key when prompted.

andy@work-pc:~$ ssh root@
The authenticity of host ' (' can't be established.
ECDSA key fingerprint is 12:af:51:e2:bf:ed:b8:2c:dc:89:de:ca:55:a7:36:6a.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '' (ECDSA) to the list of known hosts.
root@'s password: 

Then update the system and reboot if needed.

root@apache:~# apt-get update
root@apache:~# apt-get upgrade
root@apache:~# reboot


A collection of Gentoo specific information.

Installing Gentoo

Gentoo: List of Issues After an Installation
Gentoo: Making Sense of Portage
Installing Xorg on Gentoo with the nouveau Driver


Fix a Broken Gentoo Installation
Recompile the Gentoo Linux Kernel
Gentoo: Upgrade the Linux Kernel
Required Kernel Options
Gentoo: Amend Global USE Flags


Firefox on Gentoo
Installing a File Manager
Connect to a NFS Share with Gentoo

Firefox on Gentoo

I recently setup Firefox sync on my work machine which runs Ubuntu, then did the same on my home desktop which runs Gentoo. Before I knew it, all my work add-ons appeared on my home desktop. This was a cool feature that I didn’t know Firefox sync had. However, upon closer inspection, I noticed that only half off my add-ons were working, the other half disabled with.

... is incompatible with Aurora 17.0.9

For those that don’t know, Aurora is the bleeding-edge beta version of Firefox. I knew I was using this but until now it had not been a problem and I experienced no issues with stability.

Replace Aurora with Firefox

To replace Aurora with Firefox, we need to recompile it after disabling the bindist USE flag.

To see what USE flags a program was compiled with, use the following command.

emerge --info firefox

This will show you information like this (and a lot more besides).

                        Package Settings

www-client/firefox-17.0.9 was built with the following:
USE="alsa bindist dbus gstreamer jit libnotify minimal (multilib) startup-notification -custom-cflags -custom-optimization -debug (-pgo) (-selinux) -system-sqlite -wifi" ABI_X86="64" LINGUAS="-af -ak -ar -as -ast -be -bg -bn_BD -bn_IN -br -bs -ca -cs -csb -cy -da -de -el -en_GB -en_ZA -eo -es_AR -es_CL -es_ES -es_MX -et -eu -fa -fi -fr -fy_NL -ga_IE -gd -gl -gu_IN -he -hi_IN -hr -hu -hy_AM -id -is -it -ja -kk -km -kn -ko -ku -lg -lt -lv -mai -mk -ml -mr -nb_NO -nl -nn_NO -nso -or -pa_IN -pl -pt_BR -pt_PT -rm -ro -ru -si -sk -sl -son -sq -sr -sv_SE -ta -ta_LK -te -th -tr -uk -vi -zh_CN -zh_TW -zu"
CFLAGS="-pipe -march=native -mno-avx"
CXXFLAGS="-pipe -march=native -mno-avx"

storm ~ # 

Here you can see bindist included. To disable this for Firefox.

echo "www-client/firefox -bindist" >> /etc/portage/package.use
emerge --ask --update --deep --with-bdeps=y --newuse world
emerge --ask --depclean

This worked! Kind of.

I now have Firefox and not Aurora, but the same add-ons are still disabled.

Incompatible Firefox Extensions
Incompatible Firefox Extensions

This time with the message.

... is incompatible with Firefox 17.0.9

After some digging, it appears that version 17.0.9 is the current stable release. The three disabled plugin seem to be for more recent versions of Firefox.

Stable or Unstable?

As you can see from gentoo.org, version 17.0.9 is the current stable release and version 24.0-r1 is the current unstable release. If I want to get my add-ons working, I would need to do something like the below.

echo "www-client     ~amd64" >> /etc/portage/package.keyword
emerge --ask --update --deep --with-bdeps=y --newuse world
emerge --ask --depclean

Note, currently I’m not too fussed about these add-ons so will stick with the stable release for now.

Delete Unused Rackspace Cloud Servers

To avoid any unnecessarily high Rackspace bills, make sure you delete any unused cloud servers or products.

Here I have three servers. One is in production, another is occasionally used for testing and development. I am half-way through setting the last one up but it is not yet in production.

You might think that you can just power-off the server to stop being billed for it….but you’d be wrong! If you simply shut down the server, you will still be billed per hour for it’s use.

If like me, you have any servers that are not currently in use, either by you or your customers, it makes sense to take an image of the device and then delete it. You can always spin up a new server from the image you create.

Take an Image

To take an image, click the cog icon next to the server. That will create a drop-down menu. Within there, you will see “Create Image” – select that.

Taking an image
Taking an image

You will then be asked to give the saved image a name. If you hover over the small pound sign symbol, you will also see the associated costs.

Give the image a name.
Give the image a name.

Delete Server

Before I delete a server I might come to rely on later, I like to first make sure the image was created successfully. To do that, navigate to the “Saved Images” section/tab.

Saving images.
Saving images.

Once imaged, simply select the servers you wish to delete and click on the “Delete” button.

Deleting servers
Deleting servers

Rebuild Server from an Image

When you next require the deleted server, we can spin up a new server from the image we took.

One downside to this is that the newly created server will have a different public IP address than it did previously. If this is an issue for you, I would recommend creating a load-balancer to sit in front of the device. It is possible to have a load-balancer with one node behind it. Load-balancers IP addresses do not change.

To spin up a new server from an existing image, simply navigate to the “Saved Images” section of the server tab. Click on the cog next to the image you wish to use and select “Create Server with Image...“.

Then simply give the server a name, select a flavour and/or alter any other details. Then click on “Create Server“.

You will be given a new password for the server. Make a note of this and “Dismiss Password” when ready.

Root Admin Password
Root Admin Password

You can monitor the progress from the cloud servers tab.

Cloud Server Rebuilding
Cloud Server Rebuilding

Job done!

Fix a Broken Gentoo Installation

Here is how I gain access to my broken environment…

mount /dev/mapper/vg--ssd-lv--root /mnt/gentoo/

mount -v /dev/mapper/vg--ssd-lv--boot /mnt/gentoo/boot/
mount -v /dev/mapper/vg--hdd-lv--home /mnt/gentoo/home/
mount -v /dev/mapper/vg--hdd-lv--var /mnt/gentoo/var/
mount -v /dev/mapper/vg--hdd-lv--usrportage /mnt/gentoo/usr/portage/
mount -v /dev/mapper/vg--hdd-lv--vhdd /mnt/gentoo/vhdd/
mount -t proc none /mnt/gentoo/proc
mount --rbind /sys /mnt/gentoo/sys
mount --rbind /dev /mnt/gentoo/dev

ls /mnt/gentoo/ /mnt/gentoo/boot/ /mnt/gentoo/home/ /mnt/gentoo/var/ /mnt/gentoo/usr/portage/ /mnt/gentoo/vhdd/ /mnt/gentoo/proc /mnt/gentoo/sys /mnt/gentoo/dev

swapon -p 1 /dev/sdc1 && \
swapon -p 1 /dev/sdd1 && \
swapon -v -s

chroot /mnt/gentoo /bin/bash
source /etc/profile
export PS1="(chroot) $PS1"

Fix what your gonna fix, un-mount and reboot. Fingers crossed!

umount -lv /mnt/gentoo/dev{/shm,/pts,}
umount -lv /mnt/gentoo{/boot,/proc,}

Gentoo: List of Issues After an Installation

Pretty much every time I install Gentoo I hit a new minor issue that requires my attention. Sometimes its caused by a new version of a particular package, sometimes I’ve simply forgot to configure something correctly. Either way, here is an on-going list of issues that I’ve faced after a new installation.

Networking Interfaces Renamed

The networking interfaces were renamed from eth0 to enp10s0 and enp09s0. While this did not make any difference as to whether or not they work, it is annoying!

storm ~ # ifconfig
enp10s0: flags=4163  mtu 1500
        inet  netmask  broadcast
        inet6 fe80::223:8cff:fe7b:5f0g  prefixlen 64  scopeid 0x20
        ether 00:23:8c:7b:5f:0g  txqueuelen 1000  (Ethernet)
        RX packets 2161  bytes 226082 (220.7 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 96  bytes 16270 (15.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp9s0: flags=4099  mtu 1500
        ether 00:21:7c:7b:60:ff  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


To fix, just run the following command (as root) and then reboot.

storm ~ #  touch /etc/udev/rules.d/80-net-name-slot.rules 

RAID Devices Renamed

The RAID devices work renamed from /dev/md0, /dev/md1 and /dev/md2 to /dev/md126, /dev/md127 and /dev/md128. Again they work, but quite annoying!


If you are affected by this issue (and it bothers you), you may need to alter your /etc/mdadm.conf file to include a map between the UUID and the device name. In which case you first need to make a note of the UUID, which you can find with mdadm --detail /dev/md126 and then add an entry similar to the below.

Obviously you need to make sure the right UUID matches the right device name!

nano /etc/mdadm.conf

ARRAY /dev/md0 uuid=bffb1668:11863a10:bf3af795:0aa37b76
ARRAY /dev/md1 uuid=147ec32e:2721ff1a:3769d3d6:285e5546
ARRAY /dev/md2 uuid=0a3417f5:885e6352:c56063cf:7cc765e3

You may also need to edit the /etc/genkernel.conf file.

nano /etc/genkernel.conf

And add the following if needed.


You still need to run the following. Pay close attention to the output to make sure it is picking up and using the /etc/mdadm.conf file.

genkernel --lvm --mdadm initramfs
grub2-mkconfig -o /boot/grub2/grub.cfg

Hopefully that worked! If you get strange output from watch cat /proc/mdstat, make sure you give it long enough time to sync.


Required Kernel Options

General Kernel Options

Enable GPT support.

-*- Enable the block layer  --->
      Partition Types  --->
      [*]   EFI GUID Partition support
      [*]   Windows Logical Disk Manager (Dynamic Disk) support

I also select dynamic disks just in case I need to use disks that were partitioned using XP, Vista, etc.

Processor type and features  --->
   [*] Symmetric multi-processing support
   [*] Machine Check / overheating reporting 
   [*]   Intel MCE Features
   [*]   AMD MCE Features
  Processor family (Generic-x86-64)  --->
    ( ) Opteron/Athlon64/Hammer/K8
    ( ) Intel P4 / older Netburst based Xeon
    (X) Core 2/newer Xeon
    ( ) Intel Atom
    ( ) Generic-x86-64
Executable file formats / Emulations  --->
    [*] IA32 Emulation
Device Drivers --->
  Generic Driver Options --->
    [*] Maintain a devtmpfs filesystem to mount at /dev
    [ ]   Automount devtmpfs at /dev, after the kernel mounted the rootfs
File systems --->
  <*> Second extended fs support
  [*]   Ext2 extended attributes 
  [*]     Ext2 POSIX Access Control Lists
  [*]     Ext2 Security Labels
  [ ]   Ext2 execute in place support (NEW)
  <*> Ext3 journalling file system support
  [*]   Default to 'data=ordered' in ext3 (NEW)
  [*]   Ext3 extended attributes (NEW)
  [*]     Ext3 POSIX Access Control List
  [*]     Ext3 Security Labels
  <*> The Extended 4 (ext4) filesystem
  [*]   Ext4 POSIX Access Control Lists
  [*]   Ext4 Security Labels
  [ ]   EXT4 debugging support (NEW)
  [ ] JBD (ext3) debugging support (NEW)
  [ ] JBD2 (ext4) debugging support (NEW)
  < > Reiserfs support (NEW)
  < > JFS filesystem support (NEW)
  < > XFS filesystem support (NEW)
  < > GFS2 file system support (NEW)
  < > Btrfs filesystem support (NEW)
  < > NILFS2 file system support (NEW)
  [*] Dnotify support (NEW)
  [*] Inotify support for userspace (NEW)
  [*] Filesystem wide access notification
  [ ]   fanotify permissions checking (NEW)
  [*] Quota support
  [*] Report quota messages through netlink interface
  [ ] Print quota warnings to console (OBSOLETE)
  [ ] Additional quota sanity checks (NEW)
  < > Old quota format support (NEW)
  <*> Quota format vfsv0 and vfsv1 support
  <*> Kernel automounter version 4 support (also supports v3)
  <*> FUSE (Filesystem in Userspace) support
  <*>   Character device in Userspace support
      Caches  --->
      CD-ROM/DVD Filesystems  --->
        <*> ISO 9660 CDROM file system support
        [*]   Microsoft Joliet CDROM extensions
        [*]   Transparent decompression extension
        <*> UDF file system support (NEW)
      DOS/FAT/NT Filesystems  --->
        <*> MSDOS fs support
        <*> VFAT (Windows-95) fs support
        (437) Default codepage for FAT (NEW)
        (iso8859-1) Default iocharset for FAT (NEW)
        <*> NTFS file system support
        [ ]   NTFS debugging support (NEW)
        [*]   NTFS write support
      Pseudo filesystems  --->
        -*- /proc file system support
        [*]    /proc/kcore support
        [*]    /proc/vmcore support
        -*- Tmpfs virtual memory file system support (former shm fs)
        [*]    Tmpfs POSIX Access Control Lists
        -*-    Tmpfs extended attributes
        [*] HugeTLB file system support
        <*> Userspace-driven configuration filesystem
  [*] Miscellaneous filesystems (NEW)  --->
  [*] Network File Systems (NEW)  --->
  -*- Native language support  --->

USB support.

Device Drivers --->
  [*] USB support  --->
    <*>   Support for Host-side USB
    [*]   USB verbose debug messages
    [*]   USB announce new devices
Device Drivers --->
  <*> Multimedia support  --->

For RAID and LVM2 support.



Device Drivers  --->
   [*] Multiple devices driver support (RAID and LVM)  --->
       <*>   RAID support
       [*]     Autodetect RAID arrays during kernel boot (NEW)
       <*>     Linear (append) mode
       <*>     RAID-0 (striping) mode
       <*>     RAID-1 (mirroring) mode
       <*>     RAID-10 (mirrored striping) mode
       <*>     RAID-4/RAID-5/RAID-6 mode
       < >     Multipath I/O support (NEW)
       < >     Faulty test module for MD (NEW)
       <*>   Block device as cache
       [ ]     Bcache debugging (NEW)
       [ ]     Extended runtime checks (NEW)
       [ ]     Debug closures (NEW)
       <*>   Device mapper support
       [ ]     Device mapper debugging support (NEW)
       <*>     Crypt target support
       <*>     Snapshot target
       < >     Thin provisioning target (NEW)
       <*>     Cache target (EXPERIMENTAL)
       <*>       MQ Cache Policy (EXPERIMENTAL) (NEW)
       <*>       Cleaner Cache Policy (EXPERIMENTAL) (NEW)
       <*>     Mirror target
       < >     RAID 1/4/5/6/10 target (NEW)
       < >   Mirror userspace logging (NEW)
       <*>   Zero target
       <*>   Multipath target
       <*>     I/O Path Selector based on the number of in-flight I/Os
       <*>     I/O Path Selector based on the service time
       < >   I/O delaying target (NEW)
       [*]   DM uevents
       < >   Flakey target (NEW)
       < >   Verity target support (NEW)
Device Drivers  --->
  [*] Network device support --->
      [*] Ethernet driver support --->
         <*>   Realtek 8169 gigabit Ethernet support

Required by X

With the Nouveau Driver in Mind

Device Drivers  --->
    Input device support --->
        <*> Event interface
Device Drivers  --->
    <*> Connector - unified userspace <-> kernelspace linker  --->
    Graphics support  --->
        <*>   Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) --->
        <*>   Nouveau (nVidia) cards
        (5)      Maximum debug level (NEW)
        (3)      Default debug level (NEW)
        [*]      Support for backlight control (NEW)
        -*- Support for frame buffer devices  --->
            ## Disable all drivers, including NVidia, etc.
            [ ]   Enable firmware EDID
            [ ]   Enable Video Mode Handling Helpers
            [ ]   Enable Tile Blitting Support
            < >   VESA VGA graphics support
            [ ]   EFI-based Framebuffer Support
            Console display driver support --->
            -*- Framebuffer Console support

With the NVidia Driver in Mind

Loadable module support --->
    [*] Enable loadable module support
Processor type and features  --->
    -*- MTRR (Memory Type Range Register) support
    [*]    MTRR cleanup support
    (1)       MTRR cleanup enable value (0-1) (NEW)
    (1)       MTRR cleanup spare reg num (0-7) (NEW)
Device Drivers --->
    Graphics Support --->
        -*- /dev/agpgart (AGP Support) --->

Additional Kernel Options

Device Drivers  --->
    [*] Network device support --->
         <*>  Bonding driver support
[*] Virtualization --->
    <*>   Kernel-based Virtual Machine (KVM) support
    <*>   Host kernel accelerator for virtio net (EXPERIMENTAL)
Device Drivers  --->
   <*> Multimedia support --->


MTRR Linux Kernel

Gentoo Discussion Forums

Recompile the Gentoo Linux Kernel

Here I needed to add a few features to my current Kernel.

The first thing I did was take a backup of both the Kernel image, the initramfs image, and the make configuration file (/usr/src/Linux/.config). Then, if everything spectacularly fails, I just need to boot into the live CD and restore the files.

Backup Existing Boot Images

It’s probably wise to backup your .config file if nothing else. I mount an NFS share and then copy the images there.

Make your Changes

While still in the /usr/src/linux directory, type make menuconfig.

storm linux # make menuconfig

I made the following changes.

    General setup  --->
[*] Enable loadable module support  --->
-*- Enable the block layer  --->
    Processor type and features  --->
    Power management and ACPI options  --->
    Bus options (PCI etc.)  --->
    Executable file formats / Emulations  --->
-*- Networking support  --->
    Device Drivers  --->
    Firmware Drivers  --->
    File systems  --->
    Kernel hacking  --->
    Security options  --->
-*- Cryptographic API  --->
[*] Virtualization  --->
    Library routines  --->
    Load an Alternate Configuration File
    Save an Alternate Configuration File

I added better support for my i7 processor.

Processor type and features  --->
    Processor family (Generic-x86-64)  --->
        (X) Core 2/newer Xeon 
    [*] MTRR (Memory Type Range Register) support

Then I made the following changes. Note, I had to remove everything under Support for framebuffer devices.

Device Drivers  --->
    [*] Network device support --->
         Bonding driver support
    <*> Connector - unified userspace <-> kernelspace linker  --->
    Graphics support  --->
        <*> Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) --->
        -*- Support for frame buffer devices  --->
            [ ]   Enable firmware EDID
            < >   VESA VGA graphics support
            < >   EFI-based Framebuffer Support
    Input device support --->
        <*> Event interface

Exit and save.

Maybe backup the new .config file too.

Compile the Kernel

If needed, run the below commands to generate dependency information and remove old binaries.

Make sure you’re still within the /usr/src/linux/ directory.

make dep; make clean

And then compile the kernel.

make && make modules_install

Once finished, copy the compiled image to the /boot directory. Don’t forget to mount it first if needed.

mount /boot
cp -v arch/x86_64/boot/bzImage /boot/kernel-3.8.13-gentoo

Rebuilt initramfs Image and Grub Configuration

genkernel --lvm --mdadm initramfs
grub2-mkconfig -o /boot/grub2/grub.cfg


Gentoo.org – 7. Configuring the Kernel

Gentoo.org – Compiling the Linux kernel

Gentoo.org – Baselayout and OpenRC Migration Guide