Chroot in Ubuntu

by Craig Mayhew on Tue 30th Mar 2010 under Linux/Ubuntu

If you ever manage to damage your ubuntu install so badly that it won't boot (as I recently did when trying to remove the gnome GUI) then boot from a LiveCD and then open up a terminal.

Type the following commands:

change to the media directory (where our drives should be)
# cd /media

Create a new directory called Ubuntu (We will use this to mount our boot drive too)
# mkdir ubuntu

Mount the boot drive, you will need to replace X with the correct letter
# mount /dev/sdaX /media/ubuntu

Mount some other required locations
# mount --bind /proc /media/ubuntu/proc
# mount --bind /dev /media/ubuntu/dev
# mount --bind /dev/pts /media/ubuntu/dev/pts

Run chroot, using this command and we are now root as if we had booted from the boot drive and not the liveCD:
# chroot /media/ubuntu

Your now in your Ubuntu system as root. If your unsure precisely why your system won't boot then running an update is usually a good place to start. Good luck!
# aptitude update

Ubuntu   Chroot  

The package vmware-server needs to be reinstalled, but I can't find an archive for it

by Craig Mayhew on Mon 29th Mar 2010 under Linux/Ubuntu

I recently tried installing a .deb packagae I had made by converting an rpm. Synaptic package manager however errored and since then won't open. Every time I started synaptic I was getting this error:

The package vmware-server needs to be reinstalled, but I can't find an archive for it

This command solved it and will force the removal of my incosistent package:

dpkg --remove --force-remove-reinstreq vmware-server

Ubuntu   Synaptic Package Manger   rpm   dpkg  

Retrieve Drive UUIDs in Ubuntu

by Craig Mayhew on Sat 27th Mar 2010 under Linux/Ubuntu

One easy command to retrieve all drive UUIDs.

ls -lF /dev/disk/by-uuid

Ubuntu   UUID  

Greasemonkey scripts won't update on Ubuntu

by Craig Mayhew on Sun 07th Feb 2010 under Guides/Fixes, Linux/Ubuntu

The usual reason for not being able to update the scripts is that your permissions are wrong in your Firefox folder. Your Grease Monkey scripts will be in your firefox folder. The default place for this is (please substitute {username} for your actual Ubuntu user name):

cd /home/{username}/.mozilla/firefox/gm_scripts/

You need to make sure you are the owner of this folder. This command will make sure you are. Again please substitute whats inside the {} brackets.

chown -R {username}:{usergroup} /home/{username}/.mozilla/firefox/gm_scripts

If that still fails to fix the problem, then you also need to make sure you have write permissions on your firefox settings folder.

chmod -R 755 /home/{username}/.mozilla/firefox/gm_scripts

Ubuntu   Firefox   Linux Permissions   Greasemonkey  

ZFS on Ubuntu

by Craig Mayhew on Wed 25th Nov 2009 under General/Techie

Installation on Ubuntu 9.04

Filip Brcic is kindly providing Ubuntu packages for zfs-fuse.

To install zfs-fuse add the Filip Brcic's launchpad repo to a source list.

sudo nano /etc/apt/sources.list.d/zfs-fuse.list

At the time of writing, the karmic version of this doesn't work so keep the word jaunty in repositories and it should be ok.

deb http://ppa.launchpad.net/brcha/ubuntu jaunty main
deb-src http://ppa.launchpad.net/brcha/ubuntu jaunty main

Then update apt.

sudo apt-get update

Now install zfs-fuse.

sudo apt-get install zfs-fuse

if you get this message then you need to run the command as root:
connect: Permission denied
internal error: failed to initialize ZFS library

zfs get compressratio

Further Reading:

Ubuntu   ZFS  

Tell Ubuntu to avoid using SWAP partition with swappiness setting

by Craig Mayhew on Wed 14th Oct 2009 under Guides/Fixes, Linux/Ubuntu

By Default Ubuntu will move data in RAM onto the swap file/partition on the hard disk long before it runs out of memory. It will pick data that isn't accessed often but this can still be an annoying slow down on the system. To prevent the over use of SWAP space and speed things up all we need to do is change one setting... swappiness.

Swappiness can be set from 0 to 100. The default is 60 and the lower it is the more the computer will try to keep everything in RAM.

If you want to temporarily change the swappiness then run this command with desired swappiness level:

sudo sysctl vm.swappiness=10

Alternatively if you want the change to be permanent then edit this file:

sudo gedit /etc/sysctl.conf

Set swappiness to the desired level (in this case 1) by either modifying this line in the file "/etc/sysctl.conf" or if it doesn't exist, add it at the end.


Reboot the computer for the change to take effect.

Ubuntu   Virtual Memory   Swap Space   RAM  


Latest Blog Posts

Ubuntu   Virtual Memory   Swap Space   RAM