Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 10-20-2004, 11:22 AM   #1
LQ Newbie
Registered: Aug 2004
Posts: 5

Rep: Reputation: 0
moving from one hd to another

Dear users,
I have mandrake 10.0c installed on a 20Gb secondary drive, while winXP is running on the master disk.
I would like to replace the 20Gb HD with a bigger one, without reinstalling everything.
Is there a quick way to transfer the system on the new HD?
There may be trouble with the dual boot?

Old 10-20-2004, 11:51 AM   #2
Registered: Jul 2004
Location: Manchester, UK
Distribution: Gentoo
Posts: 46

Rep: Reputation: 15
Attach the new hard drive, perhaps as a secondary slave and boot into linux. Partition the new hard drive with fdisk, making sure that each partition is at least the size of your current linux partitions (of course, at least one partition will be greater).

Create your chosen filesystems on each partition and mount them to a newly created directory in, say, /mnt on your current root partition. Then use rsync -avx to copy the contents of each current partition accross to the newly created and mounted partitions, (excluding /proc and /sys, perhaps).

If you keep your boot partition on the new drive at the same location, ie the first primary partition, then I'd guess the dual boot will remain fine.
Old 10-22-2004, 02:58 AM   #3
LQ Newbie
Registered: Aug 2004
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks, I forgot to say that I'm a rookie of linux. So I could understand more or less what I should do.
Should partition the disk from linux? then probably I don't have to use fdisk...
Would it be possible to explain me in more a step to step way?

Thanks a lot

Old 10-22-2004, 04:56 AM   #4
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
There is a Linux Mandrake program called diskdrake. You can run that program after installing the drive and booting up.

You will need to decide how you want to partition it before you can transfer files. Mandrake defaults to the ext3 file system, but you could use reiserfs if you wanted. Remember that you will need a swap partition also. Also, like Joubert79 said, you need to mount what will become your new root partition (/) someplace. You can do that while using diskdrake. It will ask you where to mount it. If you want to mount it as /newdrive, then diskdrake will create the /newdrive directory for you and mount it there. Important: because this is a temporary place for the drive, the device is /dev/hdc, so when Diskdrake asks if you want to save the changes to 'fstab', answer NO. However, if you have partitioned the new drive differently, then the fstab entry on the new drive, (i.e. /newdrive/etc/fstab ) will need to be updated to reflect the new device references. In other words, if /home is inside the extended partition as /dev/hdb5, but you didn't create an extended partition, then the new home will be at /dev/hdb2 instead. If that were the case you would just need to change the entry: from /dev/hdb5 to /dev/hdb2.

After you copied everything over, double check that the owner, group and permissions of files are the same. Just compare a couple of directories with the new cooresponding ones on the new drive.

A good one to use would be /var
hpamd64lt:/home/jschiwal # ll /var
drwxr-xr-x  14 root  root   360 20c 2004-10-09 04:27 games
drwxr-xr-x  31 root  root   840 2004-10-21 04:20 lib
drwxrwxr-t   3 root  uucp    72 2004-10-21 22:51 lock
drwxr-xr-x   9 root  root  1168 2004-10-22 00:28 log
lrwxrwxrwx   1 root  root    10 2004-10-09 04:15 mail -> spool/mail
drwxr-xr-x   3 root  root    72 2004-10-09 04:16 opt
drwxr-xr-x  15 root  root   896 2004-10-21 22:19 run
drwxr-xr-x  12 root  root   320 2004-10-09 06:30 spool
drwxrwxrwt   5 root  root   184 2004-10-22 00:29 tmp
drwxr-xr-x   4 root  root   120 2004-10-09 04:26 X11R6
drwxr-xr-x   3 root  root   104 2004-10-09 04:26 yp
The /var directory contains directories with different owners and permissions.

Now we come to a catch-22 situation. Lilo needs to be updated before you can boot. However, because the drive is in /dev/hdc, you can't update it because it would write the wrong information. The solution is to boot up with the first installation disk. Press f2 at the first screen and enter 'rescue' at the bottom of the screen.
This will boot up the rescue system. Select the option 'mount system under /mnt'. If this is successful the execute these commands:
chroot /mnt
bash -l
Lilo will print out a line for each stanza ( boot menu section ). If there is a problem you will need to edit /etc/lilo.conf in the stanza that had the error. The lilo error message
will tell you where.

Now reboot and cross your fingers!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
help with moving to another hd jclu Linux - Hardware 0 11-30-2005 12:40 PM
moving along so far.... Tbagz Linux - Newbie 3 10-31-2005 06:20 AM
copying/moving stalls when moving a lot of data to a usb stick =X= Linux - Hardware 10 07-30-2004 06:29 AM
moving from 2.4.xx to 2.6.3... Tih8710 Programming 2 06-21-2004 07:55 AM
Moving up MasterC Linux - General 10 06-06-2002 06:51 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:43 PM.

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