Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Saturday, August 28, 2010

Install Ubuntu from a Linux partition

Its been far too long, so I thought I'd post something :)

Generally the prefered method of installing Ubuntu is via CD or (these days) from a USB stick.
But there is also another way if you already have an existing Linux partition around.

I'll list down the steps to installing Ubuntu from the hard disk itself without using any other external media.

To perform this installation I used the Maverick (ubuntu 10.10) pre-beta image from 27th Aug 2010. This has been tested with the alternate ISO. I have not tested this using the live ISO.

Step 1
Download the alternate ISO image from your local mirrors or use bittorent, or any other method.

Step 2
Download the vmlinuz and initrd.gz files from here:


In my case it is "maverick". Change the URL according to the version of ubuntu you want to install

Step 3
You need to place these two files (vmlinuz & initrd.gz) on the existing linux partition from which you plan to install ubuntu.
REMEMBER you cannot install ubuntu to the same partition from where the installer will run.

For example :
Location of installer (existing linux partition) : /dev/sda1
Location of the new installation : /dev/sda2

Create a temporary directory on /dev/sda1 as "/maverick" and place the two files in it.

Also place the alternate iso in the "/" directory of /dev/sda1
This allows the installer to pickup the iso image and read its contents.

Step 4
Now you need to edit GRUB.
In my case I had GRUB2 present on my system.
(You can use legacy GRUB as well for this but I have not tried it)

Add the following lines to the end of the file "/etc/grub.d/40-custom"

menuentry "Install Ubuntu" {
insmod ext2
set root=(hd0,1)
search --no-floppy --fs-uuid --set 8c4ec935-1a99-42c9-bbc9-c0400ba9d7fd
linux /maverick/vmlinuz vga=normal ramdisk_size=14972 root=/dev/rd/0 rw --
initrd /maverick/initrd.gz
}


Remember to change the UUID shown after "set" to the UUID of your partition.
Find that out by seeing the contents of /dev/disk/by-uuid

$ ls -lh /dev/disk/by-uuid

Also change your partition correspondingly if it is not /dev/sda1
Save and close the file.

Before the next step create a backup of your "/boot/grub/grub.cfg" file just in case !

Now run
$ sudo update-grub

The custom entry you just added should be appended to the end of your new /boot/grub/grub.cfg file. It should, of course, contain all your earlier entries too.

Step 5
Reboot and choose the "Install Ubuntu" option from the Grub2 menu.

This should start the installer and it should find your alternate iso image in the / directory as well.
From here on out just follow the steps as they come up in the installer. Even though the alternate installer is text-based, it is really not difficult to understand if you read each step clearly.

Just make sure you are extra careful when the paritioning steps come up and select the correct paritions to format. (As specified in my example, I formatted /dev/sda2 as ext4 and set it as my "/" partition for this new ubuntu installation)

Select the "Ubuntu desktop" option of the installer prompts you for a software selection. This should install the default Ubuntu GNOME desktop.


I made this blog post because I did not find any unified howto for this particular installation method.

I took bits and pieces from the following places:

Ubuntu Forums
Ubuntu Forums
Ubuntu Forums
Ubuntu Commmunity Help


Friday, August 21, 2009

Finally Sopcast on Linux is very easy. Tested on Ubuntu, Fedora pending

Thanks to flyguy97 on code.google.com we finally have Sopcast for Linux made very easy.

Installation notes here
Download it here

Make sure you install correct version depending on your architecture (32-bit or 64-bit)
And probably you need to install "sp-auth" first before installing "sopcast-player" which is the procedure I followed.

Of course you can download the source and compile it for you own version as well :)

Btw this was tested and used on Ubuntu 8.04 (Hardy Heron) by me, yet to test it on Fedora.

After trying to use Sopcast via the CLI, this was a welcome relief :)

One more helpful link whose procedure I was about to follow before I found the above ^
ubuntuforums.org as usual !

Post in the comments if you face any problems :)

Tuesday, May 19, 2009

Huawei EC168C on Ubuntu 8.04 Hardy Heron

If you are using Ubuntu 8.10 (Intrepid Ibex) or later, it is very likely that your USB stick will be detected as a modem and you can use Network Manager to connect to the Internet by following the instructions here: ubuntuforums.org

On my Hardy system the USB stick was not detected as a modem but as a mass storage device. First thing I needed to do was to make the system detect it as a modem

For that we need a small program called usb_modeswitch.
Add the following to your /etc/apt/sources.list file

deb http://ppa.launchpad.net/wader/ppa/ubuntu hardy main
deb-src http://ppa.launchpad.net/wader/ppa/ubuntu hardy main


Run the following command:
$ sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 5E5F772E


Then run:
$ sudo apt-get update && sudo apt-get install usb-modeswitch


Now using this program we can switch the USB mode from "Mass Storage" to "modem"

Run:
$ lsusb


You should see something like the following:
Bus 004 Device 005: ID 12d1:140b Huawei Technologies Co., Ltd.


Now the first part of the bold text above is the vendor id and the second part is the product id.

We have to execute the usb_modeswitch command with the following options
-v : vendor id (prefixed by 0x)
-p : product id (prefixed by 0x)
-d : detach storage driver (value=1)
-H : Huawei Mode (value=1)

So we first execute:
$ sudo usb_modeswitch -v 0x12d1 -p 0x140b -d 1

This will detach the storage driver

And then :
$ sudo usb_modeswitch -v 0x12d1 -p 0x140b -H 1

This will enable the usb modem mode

Now run
$ dmesg


You will see something like this:
[ 2386.441282] usb 4-1: generic converter now attached to ttyUSB0
[ 2386.446273] usbserial_generic 4-1:1.1: generic converter detected
[ 2386.446400] usb 4-1: generic converter now attached to ttyUSB1
[ 2386.448209] usbserial_generic 4-1:1.2: generic converter detected
[ 2386.448308] usb 4-1: generic converter now attached to ttyUSB2


This means that the USB stick has now been detected as a modem.

You can now edit /etc/wvdial.conf

[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = USB Modem
Baud = 460800
New PPPD = yes
Modem = /dev/ttyUSB2
ISDN = 0
Phone = #777
Password =
Username =
stupid mode = 1


In some cases you might have to change the Phone to *99# or some other variation. #777 worked for me as the Phone.

To connect all you need to do now is run :
$ sudo wvdial


To disconnect, use ctrl+C

To make sure that the usb_modeswitch steps happen automatically, do the following:

Thats all !



Credits:
http://ubuntuforums.org/showthread.php?t=1128097
http://www.rimweb.in/forums/index.php?showtopic=8865
http://crazyaboutubuntu.wordpress.com/huawei-e169g-hsdpa-usb-stick-on-ubuntu/
http://forums.hardwarezone.com.sg/showthread.php?t=2004736

P.S. Will post later on how to have the USB stick be detected as a Modem automatically

Sunday, March 22, 2009

OpenDNS in Ubuntu instead of local DNS along with automatic updater (inadyn) for dynamic IPs

Basically you need to change your network settings so that your DNS nameservers always point to the openDNS servers rather than those provided by your local ISP.

openDns nameservers are: 208.67.220.200 & 208.67.222.222

For the case of a DHCP client that is mobile or where you do not have control over the DHCP service configuration, the procedure is:

sudo gedit /etc/dhcp3/dhclient.conf


Add a prepend line or change the existing one to read:

prepend domain-name-servers 208.67.222.222, 208.67.220.220;


Restart networking with

sudo /etc/init.d/networking restart


Will be writing down how to use a local dns cache soon using dnsmasq

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Now getting to the part where we need to dynamically update our openDns network if our IP is non-static. The solution for this is

1. wget https://www.opendns.com/account/ddns_files/inadyn.source.v1.99.zip
2. unzip -a inadyn.source.v1.99.zip
3. cd inadyn.source.v1.99/
4. sudo apt-get install build-essential
5. sudo apt-get install libcurl4-openssl-dev
6. make
7. gedit inadyn.conf
here put your information (username, password, alias). Make sure on the OpenDNS settings you enable "Set Up a Dynamic IP".
8. sudo cp inadyn.conf /etc/
9. /bin/linux/inadyn

^^^Steps taken from this link as well:

CREDITS GOTO:
answers.launchpad.net
ubuntuforums.com
ubuntu.wordpress.com ( referred to for the local dns entry)

Sunday, March 1, 2009

Get the new notifications to work on Intrepid

Jaunty Jackalope or Ubuntu 9.04 which will be out on 23rd April 09 will have a new notification system.

If some eager folks like me are interested in making them work on Intrepid, follow the instructions below:

$ sudo apt-get update


$ sudo apt-get install bzr gnome-common automake libdbus-glib-1-dev libgtk2.0-0 libgtk2.0-dev libgtk2.0-common libgconf2-dev libx11-dev libnotify-dev libnotify1 libnotify-bin libc6 libcairo2 libdbus-1-3 libdbus-glib-1-2 libgconf2-4 libglib2.0-0 libgtk2.0-0 libpango1.0-0 libpixman-1-0 libx11-6


bzr branch lp:notify-osd

cd notify-osd

./autogen.sh

make


Now you can start it:

killall notification-daemon ; ~/notify-osd/src/notify-osd

You can interrupt the new notifications system by hitting ctrl+C. That will automatically bring back the old ones.

How to test it ?

A test script is included, which will show a bunch of fake notifications. To test it, open a new terminal window and type:

~/notify-osd/src/send-test-notification.sh


Now a the test notifications should show. On the right upper corner of the window.

How to make it default ?

A simple way may be:

gedit ~/.new-notifications.sh


Then paste there this:

#!/bin/bash
killall notification-daemon ; /home/[username]/notify-osd/src/notify-osd


Then save, exit from gedit and..

chmod +x ~/.new-notifications.sh


Then go in System->Preferences->Sessions and add a new item with ~/.new-notifications.sh as the launching command.


CREDITS
Used the instructions from here, here and here

Tuesday, February 17, 2009

Installing Ubuntu 8.10 (Intrepid Ibex) with LVM

Some really good information on what LVM is all about is given in these few links:
Learning Linux LVM, Part 1
Learning Linux LVM, Part 2
TLDP LVM docs
RHEL DOCS for LVM


This was something I always wanted to try, so here are the steps:

Firstly, put in your liveCD for Intrepid. The problem is that by default the liveCD has no support for LVM. We need to install it and load the kernel module.

$ sudo apt-get install lvm2

$ sudo modprobe dm-mod


Now open up gparted:
$ gksudo gparted


Here you should create an ext3 partition with size ranging from 100MB to 300MB depending on how many kernels you wish to keep once you have installed your OS.
This ext3 partition is needed for /boot which cannot be within a LVM.
In my case this unformatted partition was /dev/sda13


After this create a partition with whatever size you require but do not format the partition to any filesystem type.
In my case this unformatted partition was /dev/sda14

The following steps are used to create the LVM scheme via the command-line:

1. Create an Physical Volume on /dev/sda14
$ sudo pvcreate /dev/sda14


2. Create an VolumeGroup named "ubuntuLVM" on /dev/sda14
$ sudo vgcreate ubuntuLVM /dev/sda14


3. Create a LogicalVolume named "intrepidROOT" within the VolumeGroup "ubuntuLVM" for the " / " partition
$ sudo lvcreate -n intrepidROOT -L 13.6G ubuntuLVM


4. Create a LogicalVolume named "intrepidSWAP" within the VolumeGroup "ubuntuLVM" for the swap partition
$ sudo lvcreate -n intrepidSWAP -L 3G ubuntuLVM


5. Format "intrepidROOT" as ext3 and label it "intrepidROOT"
$ sudo mkfs -j /dev/ubuntuLVM/intrepidROOT -L intrepidROOT


6. Format "intrepidSWAP" as a swap partition and label it "intrepidSWAP"
$ sudo mkswap -L intrepidSWAP /dev/ubuntuLVM/intrepidSWAP



Now after this is done we are ready to start the installer.
Choose "Manual Partitioning" as always :)

Select the ext3 logical volume named /dev/mapper/ubuntuLVM-intrepidROOT to be your " / " partition
AND
logical volume named /dev/mapper/ubuntuLVM-intrepidSWAP to be your swap partition

Do not forget to choose the partition you initially chose to be a /boot partition and format it as ext3 and mount it on /boot
(I almost forgot this !!!)

After the installation is complete, DO NOT RESTART
We need to run a few steps before restarting so that your LVM scheme can be recognised by your installed system !

Now we need to mount your installed filesystem and chroot into it so that lvm2 can be installed on it.
You will have a directory called /target within the liveCD filesystem which is used when installing the OS. We can use this same directory.

$ sudo mkdir /target/root
$ sudo mount /dev/ubuntuLVM/intrepidROOT /target/root
$ sudo mount -t proc none /target/root/proc
$ sudo mount -o bind /dev /target/root/dev


Now if you have additional partitions which need to be mounted as below, you need to mount those as well
$ sudo mount /dev/sda13 /target/root/boot


.......... and so on depending on how many separate partitions you have made.
In my case its just one for /boot.

Now we need to chroot into /target/root
$ sudo chroot /target/root/


This takes you to the / directory of your installation as the root user
# apt-get update
# apt-get install lvm2
# exit
Now you can add the dm-mod to the end of /etc/moudules files in your installed system.

$ sudo gedit /target/root/etc/modules

Paste dm-mod at the end of the file. Thats it !


If you are paranoid you can unmount the partitions you just mounted
$ sudo umount /target/root/boot
$ sudo umount /target/root/


Now you can restart your system and boot into Ubuntu 8.10 (Intrepid Ibex).

Thanks to the guys who wrote these howtos:-

debuntu.org
menelkir.wordpress.com
www.sysadminsjourney.com
beginlinux.com

EDIT:
Credits:
ubuntuforums.com , terryburton.co.uk,
linuxquestions & linux-sxs.org
roderick greening's blog

How do we mount LVM on another ubuntu system:

  1. Boot Ubuntu.
  2. Install lvm2:
    $ sudo apt-get install lvm2
  3. Load the necessary module(s): (Alternatively you can add dm-mod to the end of /etc/modules file)
    $ sudo modprobe dm-mod
  4. Scan your system for LVM volumes and identify in the output the volume group name that has your Fedora volume (mine proved to be ubuntuLVM):
    $ sudo vgscan
  5. Activate the volume:
    $ sudo vgchange -ay ubuntuLVM
  6. Find the logical volume that has your Fedora root filesystem (mine proved to be intrepidROOT):
    $ sudo lvs
  7. Create a mount point for that volume:
    $ sudo mkdir /media/intrepidROOT/
  8. Mount it:
    $ sudo mount /dev/ubuntuLVM/intrepidROOT /media/intrepidROOT/
  9. Mount other partitions (in my case only /boot on /dev/sda13)
$ sudo mount /dev/sda13 /media/intrepidROOT/boot/


Ran into this problem after I was using my Ubuntu Hardy Heron today !!!
Added it to this post :)

Short URL to this page:
http://tinyurl.com/ubuntuLiveLVM

Friday, February 6, 2009

Making Intel Wireless 3945ABG Work Better on Ubuntu Hardy

Well... i have this with my for some time now... but i thought i'd post it on this anyway:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In Ubuntu 8.04 the Intel wireless cards have switched from the ipw driver to the iwl driver. The version of the iwl driver that ships with Hardy is slightly buggered. The driver does not support SCAN_CAPA = 0×0 which prevents it from connecting to hidden networks. Though Network Manager has been pachted with a workaround for this. It also doesn’t have any support for controlling the LED light. Luckily a new version of the iwl driver has been backported in the linux-backports-modules-hardy-generic package.

To install this package, first go System→Administration→Software Sources. Go to the Updates tab and enable the Hardy Backports repository.

Software Sources

Click Close then click the Reload button when prompted. After that is done open a termianl and enter

sudo apt-get install linux-backports-modules-hardy-generic

Afterwards, reboot and you should have your LED light working as well as possibly better wireless performance.

I still have some problems connecting to my network. Sometimes it won’t connect when I boot the computer and I have to fool around with Network Manager by disabling wireless, enabling wireless, disabling networking, enabling networking, and a number of combinations of those things with some waiting thrown in there too. So if you’re having problems connecting to the network, play around with Network Manager for a while. It might take a lot of tries.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Copied as is from linuxtechie.wordpress link

Friday, December 26, 2008

Something about hard disk partition naming !

With GNUnify 09 coming up in a month or so... its about time i started this.

Been using Linux (Ubuntu Hardy Heron mostly, but tried out a Fedora 9 as well openSuse 11 and Mandriva Spring 2008) for 6-7 months now.
And as a newbie user, I have done a fair bit of tinkering around ( as much as could grasp with my limited knowledge so far).

This will be where I'll just be putting down stuff that I have been able to do since then, so that I dont lose it and can use it sometime in the future... quite apart from putting the knowledge out there ;)

So here is some gyaan on how hard disk partions are named by Linux and by GRUB, since, while installing Linux, this is probably crucial for newbies so that they dont kick their earlier OS off.

Something basic first.
Every computer can only have 4 partitions. Thats been fixed from ancient times and nobody has changed it. This means that you can have 4 primary partitions and no more.
To counter this issue the extended partition has been used which can have multiple logical partitions within it.
This means that you can have at max 3 primary partitions with the 4th being an extended partition within which there may be multiple logical partitions.
There is no issue if you only have 1 primary partition and the rest as logical partitions within the extended partition.

So with that issue settled.....


For GRUB :

Points to remember -
  • naming always includes a pair of parenthesis ( .... )
  • numbering starts from zero not one.

(hd0) - the first physical hard disk (also the Master Boot Record on the first hard disk). And thats a 'zero' btw.

(hd1) - the second physical hard disk (~~~ same as above ~~~)
... and so on

(hd0,0) - the first partition on the first hard disk.

(hd0,4) - the first extended partition on the first hard disk. It will always be this regardless of whether there are 1,2 or 3 primary partitions on the disk. This number is given to the logical partition created within the extended partition.

All the logical partitions within the extended partition will always be (hdx,y).
x = the physical hard disk
y = number greater than or equal to 4

(hd1,6) - the 7th partition( logical partition since y > 3) on the 2nd physical hard disk.



For Linux:

hda or sda -
first physical hard disk.
'h' and 's' depends on whether it is an IDE (or ATA) or a SCSI (or SATA) respectively

hdb or sdb - second physical disk .... and so on

hda1 or sda1 - first primary partition on the first disk

hda5 or sda5 - the first logical partition within the extended partition.

Logical partitions will always have their numbering start from 5, irrespective of whether there are 3 or less primary partitions excluding the extended partition.

One example of this:

hda1 - first partition of first hard disk which is an IDE ATA disk
hda2 - second partition of the first disk

sdb1 - first partition of the second hard disk which is a SATA disk
sdb5 - the first logical partition within the extended (notice that even though there is only one primary partition the logical partitions will always start from 5)
sdb6 - second logical partition on the second disk
sdb7 - third logical partition on the second disk
... and so on...

Just giving the GRUB equivalent names for the above to make it clear.

hda1 = (hd0,0)
hda2 = (hd0,1)
sdb1 = (hd1,0)
sdb5 = (hd1,4)
sdb6 = (hd1,5)
sdb7 = (hd1,6)

So there. Hope that helps.

A good link to look up on more details about GRUB:
GRUB manual on the GNU website

Feeback welcome

Follow this blog !!!