Pages: 1 2 3 4 5 6 7 8 9 10 >>

20/03/10

HOWTO:Reinstall Grub2 on Ubuntu

You will, not might, need this at some point in time. It will happen to you. :) When you find that grub2 is no longer on your MBR so the system will not boot or even find grub. For example you installed Windows, dumb move, but heh! You may also have cloned the hard disk and forgot to copy the MBR.

This will get you back up and running again.

You will need an Ubuntu LIVE cd, Desktop for your current install. Boot the system with Live cd. Once booted open a terminal.

List the disk partitions
sudo fdisk -l
Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00032781
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          31      248976   83  Linux
/dev/sda2              32       29780   238958842+  83  Linux
/dev/sda3           29781       30401     4988182+   5  Extended
/dev/sda5           29782       30401     4980150   82  Linux swap / Solaris

Mount the partition that has your root directory in it, my the case above that would be /dev/sda1. mount it directly in /mnt as we will chroot it later. You also need to /dev/and /proc to their subdirectories in /mnt. If you have a separate /boot partition then mount that too, as /mnt/boot

sudo mount /dev/sda2 /mnt 
Only for separate /boot partitions
sudo mount /dev/sda1 /mnt/boot 
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc

We can now create a chroot environment at /mnt and then proceed to install grub2.

sudo chroot /mnt

After chrooting, you we will have changed user to root so not need to sudo.

Now we are ready to install/reinstall Grub2.

grub-install /dev/sda

If you get errors with that command try running the next command too

grub-install --recheck /dev/sda

Make sure to rebuild the menus with the new disk info

update-grub

Now you can exit the chroot, umount the system and reboot your with your shiny new grub2 install :D

exit
sudo umount /mnt/dev
sudo umount /mnt/proc
sudo umount /mnt
sudo reboot

25/12/09

HOWTO: Startup and Connect to a Remote VirtualBox Machine

Ok, so you have a working VBox machine and you want to run it on a host server, This allows you to connect to it remotely. Until VBoxWeb get written here is a quick and dirty way.

To make the remote connect a little more secure you can stop any old person connecting in with out authentication by configuring vrdp port and vrdpauthtype. By using the auth type of external only users who can be verified by the host server can connect using rdesktop. They can still connect via other methods if setup in the guest such as ssh or VNC.

First we will set the port to 5001 and turn on authtype external.

VBoxManage modifyvm --vrdpport 5001 vmKarmicServer
VBoxManage modifyvm --vrdpauthtype external vmKarmicServer

To run the VBox guest on the host you need a coomand line similar to the following. The output below is what you would see if you ran it in a terminal and then later stopped the guest.

VBoxHeadless --startvm vmKarmicServer --vrdp=config
VirtualBox Headless Interface 3.1.2 
(C) 2008-2009 Sun Microsystems, Inc. 
All rights reserved. 
 
Listening on port 5001. 
VRDP server is inactive. 

The following can be setup in the rc.local so that the gest will automatically restart when the host is rebooted.

sudo nano /etc/rc.local
su vboxuser -c "VBoxHeadless --startvm vmHardyServer --vrdp=config" > /dev/null 2>&1

Change "vboxuser" to any user you want to run the server. To connect to the VBox guest via rdesktop the following works for me.

rdesktop-vrdp -u vboxuser -p - vboxHostserver:5001
Autoselected keyboard map en-gb
Password:  

16/12/09

Permalink 06:59:43 pm, by richard Email , 95 words   English (GB)
Categories: Ubuntu Linux, OS and Systems Administration, Filing Systems

HOWTO: Remove RAID Arrays

The filesytem should not be mounted.

sudo umount /dev/md0

Stop the array allowing us to remove thew array.

sudo mdadm --stop /dev/md0
sudo mdadm --remove /dev/md0

Remove the marker from the disk that it was part of an array

sudo mdadm --zero-superblock /dev/sdb1 
sudo mdadm --zero-superblock /dev/sdc1

Now remove the array from the mdadm.cong file and rebuild the RAM image in initr. WE may need to find the UUID for the drives, blkid lists them all.

sudo blkid
sudo nano /etc/mdadm/mdadm.conf
sudo update-initramfs -c -k `uname -r`

06/12/09

HOWTO: Expand a RAID 5 by adding another disk

So you already have a RAID 5 array and you want to make it bigger. You can either swap out each disk one at a time for a larger disk or simply add an new disk to the existing array. When I say simply there is a scary bit at the end.

TIP:Install VMware and play around with RAID drives using a virtual guest first. You can create a miniature copy of your own real system and then make a copy of that before testing out these RAID configurations.

Ok, so you have a VMware test system or you have complete backups of your system. Now read all this HOWTO before doing anything.


Assuming your existing RAID 5 array has 3 disks (sdb1, sdc1, sdd1) and is called md0. You will need to install the new drive and then partition it and set the ID to 0xDA - Non-fs data or 0xFD - Linux raid autodetect, ready for use and then add the new disk to the array.

Pages: 1 · 2 · 3 · 4

29/11/09

HOWTO: Stop Folding at Home Scaling My CPU

If you use the CPU scaling options that are now a default part of Ubuntu, you will also see that when folding@home runs or any other process that hits the CPU's hard the CPU frequency will jump up a level or two. Folding@home run as a low priority using nice. To stop any nice process from pushing the CPU to its limits add the following code snippet into the existing file /etc/init.d/ondemand. If will replace the start and background switch commands. I also want to set the minimum for my frequency for CPU too.

 start) 
    log_daemon_msg "Setup cpu scalling" "ondemand" 
    log_daemon_msg "   Sleeping for 60 seconds before continuing" 
    log_daemon_msg "   Setting ondemand, ignore nice and min freq 1.5Ghz" 
    start-stop-daemon --start --background --exec /etc/init.d/ondemand -- background 
    ;; 
 background) 
    sleep 60 # probably enough time for desktop login 
    for CPUFREQ in /sys/devices/system/cpu/cpu*/cpufreq                  
    do 
        [ -f ${CPUFREQ}/scaling_governor ] && echo -n ondemand > ${CPUFREQ}/scaling_govenor 
        [ -f ${CPUFREQ}/ondemand/ignore_nice_load ] && \ 
                         echo 1 > ${CPUFREQ}/ondemand/ignore_nice_load 
        [ -f ${CPUFREQ}/scaling_min_freq ] && echo 1500000 > ${CPUFREQ}/scaling_min_freq 
    done 
    ;; 

Now whenever you boot the file that tells the CPU scaling to ignore nice processes will be set.

Team Ubuntu Icon

Ubuntu documentation on Installing Folding At Home
Team Ubuntu Stats

1 2 3 4 5 6 7 8 9 10 >>