LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 12-20-2005, 09:17 PM   #1
ctroyp
Member
 
Registered: Sep 2005
Distribution: Fedora Core 4 / CentOS
Posts: 92

Rep: Reputation: 15
Move Grub...


Hello, I have two os's installed (hda Fedora Core 4 and hdb Debian Sarge 3.1). I only use Debian currently and I want to set it as my primary hd so I can replace the other which I will use as a mirror of the Debian drive eventually. I use Grub to select the os to start at bootup. I believe hda (FC4) is set as the primary drive, but I am unsure (all I do is select the os and move on...sorry still learning). I want to raplace hda (FC4) with a new hd. I have tried doing this and I kept getting an error.

How can I accurately edit grub to see hdb (Debian) as my primary so I can replace the old hda (FC4) drive with the new one? I read something about opening the command prompt for grub and changing the root, but I need some assurance and any more detail.

Thanks for any help provided...
 
Old 12-20-2005, 09:53 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,893

Rep: Reputation: 351Reputation: 351Reputation: 351Reputation: 351
boot debian and go through the grub setup to write grub to the MBR of hdb. When you move it to hda, that part will already be done. Edit /boot/grub/menu.lst (or grub.conf) to show, in the kernel line, root=/dev/hdaX (where X is the partition number) where the root of debian lies. change kernel (hd1,x) to kernel (hd0,x) the show the partition number where /boot lies.

shutdown and unplug. Open the box. Set the jumper on hdb to Master, and the jumper on the new drive to Slave. The former hdb becomes hda, and the new drive becomes hdb.

Write down the numbers of cylinders, heads, and sectors of each drive.

When you put the box back together and turn power on, edit the BIOS to show the changed disks. Edit the disk size (change the cylinder, heads, and secotors) for each disk.

Save and exit. the system should resume booting into debian.
 
Old 12-21-2005, 05:58 PM   #3
ctroyp
Member
 
Registered: Sep 2005
Distribution: Fedora Core 4 / CentOS
Posts: 92

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bigrigdriver
boot debian and go through the grub setup to write grub to the MBR of hdb. When you move it to hda, that part will already be done. Edit /boot/grub/menu.lst (or grub.conf) to show, in the kernel line, root=/dev/hdaX (where X is the partition number) where the root of debian lies. change kernel (hd1,x) to kernel (hd0,x) the show the partition number where /boot lies.

shutdown and unplug. Open the box. Set the jumper on hdb to Master, and the jumper on the new drive to Slave. The former hdb becomes hda, and the new drive becomes hdb.

Write down the numbers of cylinders, heads, and sectors of each drive.

When you put the box back together and turn power on, edit the BIOS to show the changed disks. Edit the disk size (change the cylinder, heads, and secotors) for each disk.

Save and exit. the system should resume booting into debian.
So I need to configure this while Debian is booted and not at the grub prompt before booting an os?

Also, is there any possibility that if I do something wrong that I will not be able to load Debian, respectively? Although I have not followed your instructions above yet, I did already setup a grub boot disk through Debian. Will this boot disk be invalid once I begin the setup on Debian? I guess I don't understand why the grub files were even in the Debian file structure since it is installed on the other drive (FC4)... Is grub installed on both os's by default?

One other thing, what command do I use to report the partitions and cylinder, heads, sectors, etc? Sorry... here.
 
Old 12-21-2005, 10:42 PM   #4
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,893

Rep: Reputation: 351Reputation: 351Reputation: 351Reputation: 351
The reason I suggested doing it my way is that my floppy drive died a couple of years ago. I found ways to get around the need for the floppy. Just a bit of thought and action before making any disk swaps saves the need for a new floppy drive, and saves the need for a floppy drive and boot disk altogether.

Setting the current hdb to become the new hda (primary) drive, with grub in place, saves the need for a boot floppy.

Adding the new disk as hdb, then editing the BIOS to show the new hda and new hdb cylinders, heads, and sectors insures you will be able to use all of both disks. The BIOS won't be set to show two disks, but not the two you have after the new disk is installed (as would be the case if you don't edit the BIOS). The BIOS will be corrected to show the two disks as they are after the installation of the new disk, with Debian (formerly hdb, now hda) with grub in the MBR.

You should be able to boot without interruption or floppy boot disk.

Basically, for my money, it easier to install grub to the MBR of hdb while Debian is running, that to try it after-the-fact.

Your milage may vary. I prefer to take the time before hand, list what I need to do, try to find easier ways to do it, before I dive in.
 
Old 12-25-2005, 05:38 PM   #5
ctroyp
Member
 
Registered: Sep 2005
Distribution: Fedora Core 4 / CentOS
Posts: 92

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bigrigdriver
boot debian and go through the grub setup to write grub to the MBR of hdb.
I am really unsure how to run the grub setup...sorry.

Quote:
Originally Posted by bigrigdriver
When you move it to hda, that part will already be done. Edit /boot/grub/menu.lst (or grub.conf) to show, in the kernel line, root=/dev/hdaX (where X is the partition number) where the root of debian lies. change kernel (hd1,x) to kernel (hd0,x) the show the partition number where /boot lies.

shutdown and unplug. Open the box. Set the jumper on hdb to Master, and the jumper on the new drive to Slave. The former hdb becomes hda, and the new drive becomes hdb.

Write down the numbers of cylinders, heads, and sectors of each drive.

When you put the box back together and turn power on, edit the BIOS to show the changed disks. Edit the disk size (change the cylinder, heads, and secotors) for each disk.

Save and exit. the system should resume booting into debian.
Any chance you could help me with this? I am just afraid of the drives becoming unbootable. Here is a copy of my /boot/grub/menu.lst from my Debian hd (hdb). I think I understnad how to modify this, but I would appreciate it if you could help me out.
Code:
# menu.lst - See: grub(8), info grub, update-grub(8)
#            grub-install(8), grub-floppy(8),
#            grub-md5-crypt, /usr/share/doc/grub
#            and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.           
default		0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout		5

# Pretty colours
color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line)  and entries protected by the
# command 'lock'
# e.g. password topsecret
#      password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title		Windows 95/98/NT/2000
# root		(hd0,0)
# makeactive
# chainloader	+1
#
# title		Linux
# root		(hd0,1)
# kernel	/vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specifiv kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
# kopt=root=/dev/hdb1 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd1,0)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
##      alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
##      lockalternative=false
# lockalternative=false

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
##      altoptions=(recovery mode) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
##      howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
##      memtest86=false
# memtest86=true

## ## End Default Options ##

title		Debian GNU/Linux, kernel 2.4.27-2-386 
root		(hd1,0)
kernel		/boot/vmlinuz-2.4.27-2-386 root=/dev/hdb1 ro 
initrd		/boot/initrd.img-2.4.27-2-386
savedefault
boot

title		Debian GNU/Linux, kernel 2.4.27-2-386 (recovery mode)
root		(hd1,0)
kernel		/boot/vmlinuz-2.4.27-2-386 root=/dev/hdb1 ro single
initrd		/boot/initrd.img-2.4.27-2-386
savedefault
boot

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title		Other operating systems:
root


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/hda3.
title		Fedora Core release 4 (Stentz) (on /dev/hda3)
root		(hd0,0)
kernel		/vmlinuz-2.6.11-1.1369_FC4 root=/dev/hda3 
savedefault
boot
Also, I tried to boot the FC4 (currently hda) drive and it locked up. Just to clarify, I am wanting to essentially replace the FC4 drive (hda) with a new one. I want to use Debian (currently hdb) as the primary drive and use the new drive as a mirror of Debian. So in the end, Debian (hdb) will become hda and the new drive will become hdb. I would appreciate if you could help me through this. I am sure it will make better sense after you help me to get it changed, but I think I am a little gun-shy for now...

Let me know if you need any additional info...

Thanks so much for your time!
 
Old 12-27-2005, 09:06 AM   #6
ctroyp
Member
 
Registered: Sep 2005
Distribution: Fedora Core 4 / CentOS
Posts: 92

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by ctroyp
I am really unsure how to run the grub setup...sorry.
Code:
# menu.lst - See: grub(8), info grub, update-grub(8)
#            grub-install(8), grub-floppy(8),
#            grub-md5-crypt, /usr/share/doc/grub
#            and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.           
default		0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout		5

# Pretty colours
color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line)  and entries protected by the
# command 'lock'
# e.g. password topsecret
#      password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title		Windows 95/98/NT/2000
# root		(hd0,0)
# makeactive
# chainloader	+1
#
# title		Linux
# root		(hd0,1)
# kernel	/vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specifiv kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
# kopt=root=/dev/hdb1 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd1,0)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
##      alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
##      lockalternative=false
# lockalternative=false

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
##      altoptions=(recovery mode) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
##      howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
##      memtest86=false
# memtest86=true

## ## End Default Options ##

title		Debian GNU/Linux, kernel 2.4.27-2-386 
root		(hd1,0)
kernel		/boot/vmlinuz-2.4.27-2-386 root=/dev/hdb1 ro 
initrd		/boot/initrd.img-2.4.27-2-386
savedefault
boot

title		Debian GNU/Linux, kernel 2.4.27-2-386 (recovery mode)
root		(hd1,0)
kernel		/boot/vmlinuz-2.4.27-2-386 root=/dev/hdb1 ro single
initrd		/boot/initrd.img-2.4.27-2-386
savedefault
boot

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title		Other operating systems:
root


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/hda3.
title		Fedora Core release 4 (Stentz) (on /dev/hda3)
root		(hd0,0)
kernel		/vmlinuz-2.6.11-1.1369_FC4 root=/dev/hda3 
savedefault
boot
I tried this on my own. Here is what I changed in the menu.lst file on the Debian drive (currently hdb). i only included the bottom section and highlighted the changes in orange.

Code:
...
## ## End Default Options ##

title		Debian GNU/Linux, kernel 2.4.27-2-386 
root		(hd0,0)
kernel		/boot/vmlinuz-2.4.27-2-386 root=/dev/hda1 ro 
initrd		/boot/initrd.img-2.4.27-2-386
savedefault
boot

title		Debian GNU/Linux, kernel 2.4.27-2-386 (recovery mode)
root		(hd0,0)
kernel		/boot/vmlinuz-2.4.27-2-386 root=/dev/hda1 ro single
initrd		/boot/initrd.img-2.4.27-2-386
savedefault
boot

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title		Other operating systems:
root


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/hdb3.
#title		Fedora Core release 4 (Stentz) (on /dev/hda3)
#root		(hd0,0)
#kernel		/vmlinuz-2.6.11-1.1369_FC4 root=/dev/hda3 
#savedefault
#boot
I removed the FC4 drive (formerly hda) and moved the Debian drive (formerly hdb) to the primary drive position in the computer and changed the jumper to master only. When I booted the computer it had a grub error (15 I think). "File could not be found: /boot/vmlinuz-2.4.27-2-386" I ran "find /boot/vmlinuz-2.4.27-2-386" and it was found at (hd1,0). I manually edited the startup script within grub and it started to boot. It immediately displayed "Could not load operating system".

Does any of this make sense? Any ideas?
 
Old 12-27-2005, 10:24 AM   #7
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
When you move a Linux to a different position you must

(a) Amend its boot loader configuration to reflect the new partition reference. For Grub it is indeed /boot.grub/menu.lst that you have been playing with.

(b) The files Debian has been instructed to load on being booted, especially its root "/". That is in /etc/fstab which is a text file. Usually the root reference is all that you need to amend but in your case you need to correct the swap reference too.

You will run into a brick wall if the removal of hda also takes away your swap partition.
 
Old 12-27-2005, 10:41 AM   #8
ctroyp
Member
 
Registered: Sep 2005
Distribution: Fedora Core 4 / CentOS
Posts: 92

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by saikee
When you move a Linux to a different position you must

(a) Amend its boot loader configuration to reflect the new partition reference. For Grub it is indeed /boot.grub/menu.lst that you have been playing with.

(b) The files Debian has been instructed to load on being booted, especially its root "/". That is in /etc/fstab which is a text file. Usually the root reference is all that you need to amend but in your case you need to correct the swap reference too.

You will run into a brick wall if the removal of hda also takes away your swap partition.
The original hda (Fedora Core 4) I do not want. It does contain a swap file and so does hdb (Debian). Both drives should run independantly, but they do not. Again, I want to remove the original hda (FC4) and replace it with the original hdb (Debian).

I think I understand what you are explaining. Here is what is in my /etc/fstab:
Code:
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
/dev/hdb1       /               ext3    defaults,errors=remount-ro,usrquota,grpquota 0       1
/dev/hdb5       none            swap    sw              0       0
/dev/hdc        /media/cdrom0   iso9660 ro,user,noauto  0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto  0       0
So all I need to do is change this (in lines 5 and 6):
Code:
/dev/hdb1 ...
/dev/hdb5 ...
to
Code:
/dev/hda1 ...
/dev/hda5 ...
Is this why I currently get the error "Could not load operating system"?
 
Old 12-27-2005, 11:01 AM   #9
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
Yep

I think you need to do a Grub-install inside Debian too because the orginal MBR would have been in removed hda. Doing grub-install in Debian while it is a hdb mean Grub connection will not work when Debian becomes hda.

There are two methods to do a grub-install while Debian isn't bootable

(A) Using a Live CD that has Grub - Live CD like Mepis, Ubuntu, Puppy.. will have it. You boot it to a Live CD, invoke a Grub shell. As your Debian "/" is now hda1 and to Grub it will be (hd0,0), as Grub counts from 0. Instructions are
Code:
grub
root (hd0,0)
setup (hd0)
exit
(B) Using a Live CD that has no Grub in it - You boot up the Live CD, make directory in /mnt, mount Debian hda1 on it, change root into Debian and do either a "grub-install" inside or invoking Debian's Grub as in method (A). Assuming you have booted to Live CD and in root the commands are
Code:
mkdir /mnt/hda1
mount /dev/hda1 /mnt/hda1
chroot /mnt/hda1
grub-install /dev/hda
exit
Either of the above should fire up your Debian.

Happy new year!!!
 
Old 12-27-2005, 11:50 AM   #10
ctroyp
Member
 
Registered: Sep 2005
Distribution: Fedora Core 4 / CentOS
Posts: 92

Original Poster
Rep: Reputation: 15
I originally had FC4 installed, then I installed Debian on the second drive. When I installed Debian it automatically installed GRUB. Would this have been written to the MBR? How can I check this?

If it was not written to the MBR how/when do I do this? Is this something I need to do before I move hdb to hda? Or, is this what the options you provided me will do?

From what I gather from your recommendations I need to do the following in this order:
  1. Modify /boot/grub/menu.lst as I indicated on a previous post on Debian (currently hdb)
  2. Modify /etc/fstab as indicated in a previous post on Debian (currently hdb)
  3. Shutdown, remove FC4 (currently hda), replace it with Debian (currently hdb), and change jumper to master.
  4. Perform "your" option "A" or "B". Btw, I have a bootable floppy for grub that I made from the Debian install per the instructions foung at the grub website. This does give me a grub command line. Will this work for option "A"?
 
Old 12-27-2005, 12:17 PM   #11
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
I haven't followed your thread but the availability a bootable Grub floppy changes a lot of things. For a start it can use it to replace the Live CD in (A) completely. In fact it makes life a lot easier.

Do (1), (2) & (3) only now

When you have hdb in hda position it wouldn't boot because Grub has not been place in the MBR but now you have the most lethal weapon in booting -- A bootable Grub floppy booting you to a Grub prompt. Believe me that floppy is all I need to boot 100+ systems in my box and surely it works for you too. So let us try it out.

Switch on the machine to see if Debian boots itself. It should be stone dead.

Then you boot up the Grub floppy and following the method (A) except please don't use a Live CD as you are already in a Grub prompt which is "more powerfull" than a Grub shell. The latter is from "inside" a Linux with many Grub commands disabled so that you can't damage the operational Linux. After completing method (A) you type
Code:
reboot
and remove the floppy before it is booted then you should see Debian springs into life.
----------------------------------------------------
If the above doesn't work you re-insert the floppy and back to a Grub prompt then you type
Code:
cat (hd0,0)/boot/menu.lst
so that you can see how Grub originally boots your Debian and just type the same instructions into Grub prompt to boot it manually
Code:
root		(hd0,0)
kernel		/boot/vmlinuz-2.4.27-2-386 root=/dev/hda1 ro 
initrd		/boot/initrd.img-2.4.27-2-386
boot
I highly recommend you try to boot Debian manually at least once so that you understand how to boot a system manually. The /boot/grub/menu.lst contains all the instructions to boot the system but you have to omit the "title" line and finsh the instructions with the last line being "boot".

Go for it! And remember the Grub floppy "unattched" to a system is the most lethal weapon in booting as I have not met a PC system that cannot be booted by it.
 
Old 12-27-2005, 12:32 PM   #12
ctroyp
Member
 
Registered: Sep 2005
Distribution: Fedora Core 4 / CentOS
Posts: 92

Original Poster
Rep: Reputation: 15
Thank you SO much for the help. It all makes sense now. I will attempt it here shortly. Right now, I am finishing up copying my directories from the Debian drive to my Windows computer via SSH. This is the only way I know of to have any type of backup for the drive. I cannot copy all the files, but probably 99%. Should something happen, at least I will have the files...

I will let you know how it turns out in just a bit. Thanks again for the EXCALLENT help!

Btw, I have a good friend from Liverpool... I may have to send him over to you with a fruit cake in thanks...lol Actually he sent me a Christmas Pudding for my family and I. ...great guy!
 
Old 12-27-2005, 01:22 PM   #13
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
I would be sticking around in the house during holiday so would be able offer tips to get your system up. You should do well with a Grub boot disk. It is only a matter how to use it.

I have moved distros from partition to partition, disk to disk and computer to computer so you don't really have problem at all.

By the way you may consider using "cable select" for the hard disk as it autoomatically becomes a master if connected to the end plug in a IDE cable. Plugging it to the middle plug makes it a slave when the end plug has another disk. I set my disk jumpers once and never have to touch them again in my 4 PC.
 
Old 12-27-2005, 01:55 PM   #14
ctroyp
Member
 
Registered: Sep 2005
Distribution: Fedora Core 4 / CentOS
Posts: 92

Original Poster
Rep: Reputation: 15
Great, it worked flawlessly. You know, having no experience with grub I was very cautious about taking these steps. I know feel a little more relaxed due to your help and the knowledge you have provided. You don't know how much I appreciate it. I even manually booted the system via the boot diskette. It all makes perfect sense.

Now I am going to attempt to install the old hd in place and copy the data over. Now, hda is appx. 80GB with somewhere less than 1GB of data currently. I have an ultimate goal of replacing the o/s on hda and re-setting up my server and importing the websites, etc to it when done. I would like to image hda to hdb, but hdb is only 20GB so I cannot do exactly what I want without having a drive of equal or greater space--correct? Anyhow, what procedure would you recommend as far as moving a copy of the data over to hdb? cat, dd, rsync, tar, etc.? Again, it would be nice to just create a mirror so I could swap it out if I ran into problems, but I do not have another drive large enough. Would you care to give me your thoughts on this?

Thanks so much!
 
Old 12-27-2005, 06:59 PM   #15
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
You know if you have more data than the space availabe nobody can do it unless you compress the data but that make it inoperable.

Assuming your data in hda can be physically fitted into hdb and "all of them are in a single partition" then the task is quite simple but you should do it with a 3rd system because copying an operating Linux isn't a good idea because you copy the mounted systems also.

If you boot up a Live CD (it is a bit slow), say you want hda1 to move into hdb1 then tar is quite reliable to preserve the full structure of the Linux. You first make /mnt/hda1 and /mnt/hdb1, mount them, change directory to the source and tar it to the target directory
Code:
mkdir /mnt/hda1
mkdir /mnt/hdb1
mount /dev/hda1 /mnt/hda1
mount /dev/hdb1 /mnt/hdb1
cd /mnt/hda1
tar cf - . | (cd /mnt/hdb1; tar xf -)
That is all. The tar command does not copy the boot loader but you can boot it with the Grub floppy and do a grub-install afterward in the new envirnment when hdb becomes the hda.
 
  


Reply


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
move grub dmenezes Linux - Newbie 1 08-27-2005 11:26 PM
Help with Grub: move it to /boot linda Slackware 14 11-01-2004 07:29 PM
How do i MOVE grub? MadSkillzMan Linux - General 5 10-26-2004 05:54 PM
Move from GRUB to XP geekBass Linux - Newbie 1 03-09-2004 12:24 AM
Grub/booting problems after partition move jacobly Linux - Newbie 3 09-02-2003 08:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:33 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration