Saturday 27 June 2009

Creating Partition on Virtual Box

After finishing on creating partition, it is a good idea to roam around “Debian” and become used to its environment. Just enter “ls”  to get a list of facilities that I got on the root. if I enter “ls /sbin” I’ll get a list of loads of utilities available for me. One is “mke2fs” that creates Ext2 file system for Linux partition. I can remember that I liked to install permanently a GParted on an extended logical partition at the beginning of my hard disk. I enter “mke2fs –L GParted /dev/hda6” at the command prompt. It does its job and creates a Linux partition on my hda6 logical device. I use option “–L GParted” to have a volume label for my partition, besides. I notice always to keep the required blank spaces. before and after that option in the command and after “L”. Now I run an “–pfv e2fsck /dev/hda6” to have some expert information about my logical device. Again those switches help me to keep things under control and unattended. I should plan everything ahead and leave them to be done without having  been around to watch them. At the end I can read the report or any log file to find out what has gone. So “unattended but verbose” is desired. Now it is time to “mount” the logical partition on a directory. I can create any directory that I like, but already there is a directory in “Debian” for that: it is “/mnt” directory on the root. I enter “mount /dev/hda6 /mnt”. At times it is necessary to use “mount –t ext2 /dev/hda6 /mnt” to explicitly guide the commands to the type of mounted partition. Now, everything is fresh and clean and I do not need to do that. I have the device mounted now I start to install my own image and directories. I follow advise of GParted site. I should decompress GParted.zip into the root of “/mnt”. I should find the place of “unzip” command and gparted .zip on the CD image that right now I have live on the RAM disk space. If I enter just “ls” I see a “live” folder in the list. I enter “cd live” that takes my inside the “live” directory. There I have two folders: “cow” and “image” I enter “cd image” Here is the list of all files and folders that I put when I was creating my custom GParted CD ROM. Among them now I need gparted.zip and “unzip”. They are here. Now I follow GParted website command but I should have all paths in commands. Alternatively I can copy these two files to the root of “Debian live RAM” I enter “/live/image/unzip /live/image/gparted.zip –d /mnt”. I note that I should repeat the complete path for each file and folder and unzip is completely case sensitive. Switch “ – d” shows the directory of installation. I did whatever GParted advised. From here, or at the root I check “ls /mnt” and find out every thing is as it should. I have “COPYING” file at the root. From now on it works on the hard disk but now I am in a logical partition and have other plans hence I need a “GRUB” for loading this device from “XOSL” I go into the root and enter “mkdir /mnt/boot” That creates the required “/boot” directory for installing “GRUB”. Then I enter “/sbin/grub-install ––no-floppy ––root-directory=/mnt /dev/hda6 ” Switch –no-floppy shows that I do not use a floppy for loading “—root-directory=/mnt is the place that “GRUB” finds its “/boot” directory as already created and ready and at the end we have installing device. Usually “GRUB” gives a warning about “device.map” that should be ignored. I can inspect “ls /mnt/boot/grub” for installed folders. It is better to sort out things by invoking GRUB command environment by entering “sudo grub” There at the “grub>” prompt, I enter  “find /bbot/grub/stage1” It replies “(hd0,5)” It is in the brackets and I know that it means the partition number 6 (5+1) on the device number 1 (=0+1). Grub counts from zero rather than one. Then at the “grub>” prompt I enter “root (hd0,5)” It replies “file system type is ext2fs, partition type ex83” both have the same meaning. Then I enter “setup (hd0,5)” It gives few lines of message and news of successful installation. Then I enter “quit” and back to “Debian” command prompt. So far so good. Now remains to edit the “menu.lst” of GRUbB and a nice splash for it.

No comments:

Post a Comment