LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-27-2006, 11:09 PM   #16
Damon Spector
Member
 
Registered: Nov 2004
Distribution: Fedora Core 4
Posts: 61

Original Poster
Rep: Reputation: 15

i would like to thank all of you for your help and especially saikee for the help with the dd command. i used that and got the clone to boot (in fact i'm using it now) but i have one more question. when i cloned my drive i put it on a larger drive wich was the reason i wanted to clone it in the first place and now would like to expand it to take up the whole drive. how would be the easiest way to do this?
 
Old 05-29-2006, 06:00 AM   #17
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
Use the program "QTParted", kind of the equivalent Windows' Partition Magic in Linux. It is availavle in most Knoppix-based variants like Knoppix itself or Kanotix. Think there is a direct equivalent too but I haven't used it to confirm.

In Linux it is straight forward to copy a partition and preserve all its setting using the tar command, without relying on any of the resizing programs except the basic Bash shell commands. It isn't the most elegant but that is what we can do with Linux terminal commands. It is bommb proof too.

If I have a bootable partition hda7 and want to increase it size I would do the following

(1) Make a temporary partition on say another disk hdb2 of same type and size as hda7, no need to format or mount.

(2) Using just a Livecd CD to clone hda7 into hdb2 by
Code:
dd if=/dev/hda7 of=/dev/hdb2 bs=32768
(3) I then delete hda7 and re-create it again to any size I want using the cfdisk program off the Live CD.

(4) I reboot (just a good practice after altering the partition table) with the Live CD, format hda7 to the original format ( so that it can be mounted for read/write) and mount both hda7 and hdb2 on /tmp directory using command "mount /dev/hda7 /mnt/hda7" etc.

(5) I then tar the hdb2 into hda7 by change directory to hdb2 first
Code:
cd /tmp/hdb2
tar cf - . | (cd /mnt/hda7; tar xf -)
The above compresses everything in hdb2 into one file and uncommpresses it on changing directory to /mnt/hda7. I got a kick out of doing it every time because it is so simple and yet so powerful.

(6) The new hda7 will not boot because the boot loader address in the hard disk will have been altered and so I must restore the boot loader again using either of the two sets of commands depending on the boot loader being Lilo or Grub respectively
Code:
chroot /tmp/hda7
lilo -b /dev/hda
exit
or
Code:
chroot /tmp/hda7
grub-install /dev/hda
exit
The following will restore the bootloader of whatever in hda7 into the MBR of hda. The new hda7 will boot and work exactly as the original but in the new partition size of your choice.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ghosting a drive in Linux lm317t Linux - General 10 07-28-2005 12:16 PM
Ghosting Linux PapaNoHair Linux - General 3 03-23-2004 06:42 PM
ghosting a linux HDD mehesque Linux - General 2 02-09-2004 06:23 PM
dd ghosting linux drive wright_pm Linux - General 3 04-27-2003 11:38 PM
Ghosting Linux to new HD? zhenwu Linux - Software 3 11-08-2001 10:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration