LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices


Reply
  Search this Thread
Old 03-03-2004, 06:01 PM   #1
coopedw
LQ Newbie
 
Registered: Sep 2003
Posts: 8

Rep: Reputation: 0
Installing New Hard Drive


I currently have one 60gig hard drive that is partitioned 40g for windows (xp pro) and 20g for Linux (mandrake 9.1). I just got another 40g hard drive I was going to install but before I got all into it I thought I'd ask a few questions.

Would it be possible to "migrate" my existing linux install from it's partition on my original hard drive to the new one, removing it from that partition and let windows have that extra 20g, while keeping my Linux set up how it is and located on the new hard drive?

basically, can I just move it over to the new hard drive? I really don't want to have to reinstall and get it all setup how I like it again. Or, would it be better to leave everything the way it is and just use the new hard drive to store files from both OS's? Is this possible? If anyone has any experience with this or some better ideas, or if you can see some giant snafu i'm about to hit (boot loader?), please let me know. I'm no expert at all this, so any help would be appreciated.
 
Old 03-03-2004, 08:37 PM   #2
estatik
Member
 
Registered: Oct 2003
Location: CA / NY
Distribution: Mandrake 9.1, 9.2, 10.1, Cooker
Posts: 145

Rep: Reputation: 15
Quote:
Originally posted by coopedw
Would it be possible to "migrate" my existing linux install from it's partition on my original hard drive to the new one, removing it from that partition and let windows have that extra 20g, while keeping my Linux set up how it is and located on the new hard drive?

basically, can I just move it over to the new hard drive? I really don't want to have to reinstall and get it all setup how I like it again. Or, would it be better to leave everything the way it is and just use the new hard drive to store files from both OS's? Is this possible? If anyone has any experience with this or some better ideas, or if you can see some giant snafu i'm about to hit (boot loader?), please let me know. I'm no expert at all this, so any help would be appreciated.
That all depends on if:

1) You want to use the 40GB to store data for both O/Ses.

If so, I would divide it with a swap as the first partition and a storage partition (vfat) for the rest of the drive. Then simply add the swap and storage partitions in your fstab and mount.


2) You want to duplicate your mandrake o/s to your 40GB hard drive.

a) You will need to first install the 40GB hard drive and correctly set your jumpers for both 60GB (master) and 40GB (slave) and boot into 9.1.

b) Partition and format the 40GB following the same format and filesystem as on the 60GB (mandrake's partitions only). You can create bigger sized partitions (BUT you can't decrease, must be equal or greater than).

Example: if hda5 is / reiserfs, hda6 is swap, hda7 is /usr resierfs and hda8 is /home ext3, then on the 40GB, make hdb1 reiserfs, hdb5 swap, hdb6 reiserfs and hdb7 ext3.

Make sure that the partition table is written to the 40GB hard drive and formatted to the filesystem you are using!

c) Unmount any windoze partitions.

d) Go to a terminal (Ctrl+Alt+F1)

e) Login as root

f) Make new mount points for your 40GB (following example is from the above partitiong scheme example; just modify to your specs)
Code:
cd /
mkdir /new-disk
mount -t reiserfs /dev/hdb1 /new-disk
mkdir /new-disk/usr
mount -t reiserfs /dev/hdb6 /new-disk/usr
mkdir /new-disk/home
mount -t ext3 /dev/hdb7 /new-disk/home
You do not need the make a directory for, nor mount swap.

g)
Code:
chmod 1777 /new-disk/tmp
h)
Code:
telinit 1
i) Check for the directories that will be copied to the 40GB by entering ls
It should print out /bin /dev /etc /home /initrd /lib /mnt /opt /root /sbin /tmp /usr /var + other mount points you may have added. /proc does not need to copied.

j) Now you should be at a single user prompt
Code:
cp -a /bin /boot /dev /etc /home /initrd /lib /mnt /opt /root /sbin /tmp /usr /var /new-disk
(If there are any mount points you have added that you want to copy, insert the directory before /new-disk . You will get an I/O error for your cdroms and floppy drives, but don't worry about that. Just make sure they don't have any disks in them when you copy over your files to the 40GB.)

k)
Code:
cp -dp /* /.* /new-disk
l)
Code:
mkdir /new-disk/proc
m) To check if the copied files match the original:
Code:
find / -path /proc -prune -o -path /new-disk -prune -o -xtype f -exec cmp {} /new-disk{} \;
n) Edit 40GB fstab
Again, by going by the above example, you need to edit fstab on the 40GB.
Code:
vi /new-disk/etc/fstab
Enter i to insert (edit)

Example:

(Original fstab; you should have to edit your windoze nor cdroms/floppy)
/dev/hda5 / reiserfs notail 1 1
/dev/hda6 swap swap defaults 0 0
/dev/hda7 /usr reiserfs notail 1 2
/dev/hda8 /home ext3 notail 1 2

(Edited fstab)
/dev/hdb1 / reiserfs notail 1 1
/dev/hdb5 swap swap defaults 0 0
/dev/hdb6 /usr reiserfs notail 1 2
/dev/hdb7 /home ext2 notail 1 2

After you're done hit the ESC key and enter :, w, q

o) Edit 40GB lilo.conf
Code:
vi /new-disk/etc/lilo.conf
Enter i to insert (edit)

Example:

(original lilo.conf)
...
image=/boot/vmlinuz...
label="..."
root=/dev/hda5
initrd=/boot/initrd...
...

(Editied lilo.conf)
...
image=boot/vmlinuz...
label="..."
root=/dev/hdb1
initrd=/boot/initrd...

(Do this for failsafe too)

After you're done hit the ESC key and enter :, w, q

p)
Code:
/new-disk/sbin/lilo
q)
Code:
telinit 5
r) Since lilo is probably on the MBR, you will have to edit the original lilo.conf so the 40GB will boot (see o) )

s)
Code:
lilo
t)
Code:
shutdown -h now
u) Disconnect the 40GB hard drive and delete your mandrake partitions on the 60GB.

v) Reconnect the 40GB and for the 20GB of unsed partition on the 60GB, use partition magic to resize and reclaim for XP.

Last edited by estatik; 03-03-2004 at 08:50 PM.
 
Old 03-11-2004, 06:15 PM   #3
coopedw
LQ Newbie
 
Registered: Sep 2003
Posts: 8

Original Poster
Rep: Reputation: 0
thanks a lot, I really appreciate it,
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing grub to external USB hard drive for later use as internal hard drive dhave Linux From Scratch 2 12-10-2005 08:48 AM
Installing From Hard Drive 2Gnu Slackware - Installation 0 07-10-2004 06:53 PM
Installing third hard drive tomarsyd Linux - Hardware 1 03-26-2003 10:41 PM
Installing a new Hard Drive Witch-King Linux - Newbie 6 12-26-2002 02:23 AM
Installing 8.1 on second hard drive mjcalling Linux - Newbie 7 02-20-2002 11:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva

All times are GMT -5. The time now is 02:57 PM.

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