Thursday 13 March 2008

COPIES COMPUTER PARTITION

Preface :

When we buy a new harddisk, stepped is first which we would did surely installs an operating system into harddisk.Does fresh install of course good, and we will get a system Linux which fresh. But if we had owned a system Linux at harddisk which is old,and has many configuration uses as according to our desire, and we have felt is balmy worked in Linux system, would easier to copy overall of system Linux into harddisk which is new, than doing fresh install and then does configuration in sanasini. We enough requiring a diskette or CD Linux bootable like Knoppix or tomsrtbt, or earns also applies CD installation Linux you by exploiting mode rescue.


Assumption:

divided into some partitions as follows :


Device Boot Start End Blocks Id System

/dev/hda1 * 1 331 2658726 b Win95 FAT32

/dev/hda2 332 421 722925 83 Linux

/dev/hda3 422 1247 6634845 f Win95 Ext'd (LBA)

/dev/hda5 422 744 2594466 b Win95 FAT32

/dev/hda6 745 775 248976 82 Linux swap

/dev/hda7 776 1247 3791308+ 83 Linux



Partition root Linux stays at /dev/hda7, while /dev/hda2 is partition of Home. I apply distribution SuSE 90 Professional with filesystem ext3. We plan harddisk which is new will only be consisted of two partitions only: partition root and swap.


Draws up harddisk which is new

Beforehand we must make partition required at harddisk which new. For the purpose, we install harddisk which is new as primary slave ( hdb). We will make partition to apply tool fdisk from system Linux at harddisk which old. For the purpose we do boot to system Linux at harddisk which is old, and as root, we implement fdisk.

# fdisk /dev/hdb


To make new partition, we type " nitrogen" at prompt fdisk. For further description about comand in fdisk, types " m".

After new partition is formed, we will get hdb has divided as

following :

/dev/hdb1 / ext3

/dev/hdb2 swap swap


If feeling difficulty in using fdisk using text mode, we also able to apply partition program using graphical interface like Partition Magic is being based on Windows, or QTParted is being based on Linux.


Copies filesystem to harddisk which is new

To assure to process duplicity go well, we exploit Knoppix. You also able to apply distribution of other Linux of which able to be implemented directly from CD and also diskette by like tomsrtbt.Arranges system BIOS you that computer does boot to CDROM or diskette. At this step we don't require display GUI, so that at prompt boot Knoppix we type " knoppix 2" which will bring us to prompt Knoppix.In view of here we work as root so that must be carefule or you will get damage at system. In Knoppix, we are mount before hand partition source and also partition purpose.

# mount /dev/hda7 /mnt/hda7

# mount /dev/hda2 /mnt/hda2

# mount /dev/hdb1 /mnt/hdb1 -rw


Partition source of dimount in read only because we will not write down any at this partition. While at partition purpose, we do mount in read write by adding argument rw at comand mount. Then we copied overall of file found on partition of source.

# cp -Rp /mnt/hda7/* /mnt/hdb1

# cp -Rp /mnt/hda2/* /mnt/hdb1/home


Argument - Rp will do duplicity in rekursif remain toly maintains file permission as according to original file. Duplicity process of this file will require time sufficiently long depend on speed of processor and level of memory which you has. In view of assumption we are that partition hda2 dimount as /home. At our new Linux system, directory /home we do not put down at partition that is separate, so that we copy is just of all contents of partitions hda2 into directory /home at new partition.


Edits configuration file

After duplicity process of filesystem completed, step of hereinafter is edit file /etc/fstab. This file determines position of mount point partition of partition at harddisk. Because harddisk we would carry over position of primary master, so that partition root we later will turn into hda*, hence we make a change at this fstab.

Following example of contents of file /etc/fstab.

proc /proc proc defaults 0 0

/dev/hda1 / ext3 defaults,errors=remount-ro 0 1

/dev/hda2 none swap sw 0 0

/dev/hdc /media/cdrom0 iso 9660 ro,user,noauto 0 0


Then we edited file /etc/liloconf. This file will determine configuration LILO which meload our Linux kernel would at new partition. We change configuration of partition of its(the root is only, corresponds to you system. After editing configuration file, shutdown computer and discharges harddisk which old. Removes harddisk which is new to position of primary master. Thereby now naming of harddisk which is new become /dev/hda*.



Installs LILO at new system

Again we are boot to Knoppix. Here we will step into system Linux which is new by using chroot. Firstly we are mount formerly partition root which is new :

# mount /dev/hda1 /mnt/hda1 -rw


That we don't get error message, before doing our chroot mount formerly directory /dev that its the /dev Linux which is new equal to /dev at Knoppix.

# mount --bind /dev /mnt/hda1/dev


Then we are chroot to new system :

# chroot /mnt/hda1


We will get prompt which is new, which is prompt our Linux system. By using this chroot, hence like we reside in our new Linux system. Doesn't forget for memount proc at system Linux which is new :

# mount -t proc /proc proc


Thereby we have come into system Linux which is new and can start fiddling around with system. Here we will only install LILO at MBR ( boot master record) harddisk which new. For the purpose edits file /etc/liloconf as according to your system configuration, and types :

# lilo


if not there are mistake message of hence LILO have been installed truly. Then went out from chroot and reboot:

# umount proc

# exit

# umount /dev

# reboot


Releases CD Knoppix, and voila! We have come into our new Linux system...



reference and source of taken away :


Triyan W. Nugroho


Ilmukomputer.com