Tag: Ubuntu

Chroot in Ubuntu

by Craig Mayhew on Mar.30, 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

1 Comment :, more...

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

by Craig Mayhew on Mar.29, 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
Leave a Comment :, , , more...

Retrieve Drive UUIDs in Ubuntu

by Craig Mayhew on Mar.27, 2010, under Linux/Ubuntu

One easy command to retrieve all drive UUIDs.

ls -lF /dev/disk/by-uuid
Leave a Comment :, more...

Greasemonkey scripts won’t update on Ubuntu

by Craig Mayhew on Feb.07, 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
Leave a Comment :, , , more...

Tell Ubuntu to avoid using SWAP partition with swappiness setting

by Craig Mayhew on Oct.14, 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.

vm.swappiness=1

Reboot the computer for the change to take effect.

Leave a Comment :, , , more...

Ubuntu Slow Boot: “ata8: SRST failed (error:-16)”

by Craig Mayhew on Sep.29, 2009, under Guides/Fixes, Linux/Ubuntu

Ubuntu has started being a little slow to boot, as it turns out one of the drives was the cause of this. During the boot up processes ubuntu would hang for a while and then spit out the following: “ata8: SRST failed (error:-16)”. It seems one of my drives wasn’t responding properly during boot up.

To fix this I tried:

- Disabling floppy drive in bios (This didn’t help, but I’m sure it will speed things up slightly as I don’t have a floppy drive)
- Set the “IDE detect time out (sec)” to 0. It was originally 35. (This didn’t help. Be careful when changing this option if you are using IDE drives)
- Unplugged the SATA cable from my DVD drive and plugged it back in again. (PROBLEM SOLVED!)

I imagine either my sata cable is slightly loose or dodgy and reseating it has sorted the problem. If the problem occurs again then I will replace the cable.

Leave a Comment :, more...

“Cannot find or run the base session script. Running Gnome in failsafe session instead.”

by Craig Mayhew on Sep.28, 2009, under Guides/Fixes, Linux/Ubuntu

After logging into my Ubuntu 9.04 machine I’m greeted with the following message “Cannot find or run the base session script. Running Gnome in failsafe session instead”. The reason for this was I had messed up my permissions and the following fixed it:

After logging in and recieving the errors message press Ctrl-Alt-F1 to drop back into command line. Then run the following:

Sudo chmod 755 /etc/gdm/Xsession
1 Comment :, , more...

Ubuntu Error “sudo: /etc/sudoers is mode 0640, should be 0440″

by Craig Mayhew on Sep.27, 2009, under Guides/Fixes, Linux/Ubuntu

If for whatever reason you change the permissions on your sudoers file you will get a similar error to “sudo: /etc/sudoers is mode 0640, should be 0440″ whenever you try to run the sudo command. The problem is that because the permissions are wrong on the sudoers file, linux won’t let you run the sudo command!

To get around this press “Esc” at the grub loader screen when linux is booting and enter into the latest recovery mode. Then select the option that allows you to drop into a command line as root and type

chmod 0440 /etc/sudoers

Then reboot and your troubles should be solved!

2 Comments :, , more...

Command to find the 10 largest files in linux

by Craig Mayhew on Apr.26, 2009, under Linux/Ubuntu

The following command will list the top 10 largest files in your linux file system. I’ve confirmed it works on OpenSUSE and Ubuntu 8.04. Remember to run this command as root if you want to search the entire file system.

find / 2>/dev/null -type f -ls | sort -k 7 -r -n | head -10
Leave a Comment :, , , more...

Installing Ubuntu 8.04 64Bit on an Asus P5Q Premium Motherboard with SATA drive

by Craig Mayhew on Oct.25, 2008, under Guides/Fixes, Linux/Ubuntu

Thought I’d share some quick fixes to get Ubuntu 8.04 working on an Asus P5Q Premium motherboard.  These will probably also help with similar problems in Ubuntu 7.04 and Ubuntu 7.10 when using SATA drives.

The problems I had were centred around using a 64GB OCZ Solid State SATA drive. The installer would hang most of the time and when it did finally make it to the disk partitioning stage it couldn’t see the hard disk.

Enter into the motherboard BIOS and change the following options:

  • Under Main / Storage Configuration change “Configure SATA as …” to AHCI. This will fix linux not being able to see the SATA drive.

Hope that saves you some time and trouble!

Leave a Comment :, , more...

Visit our friends!

A few highly recommended friends...