LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How to copy OS disk of 76 GB to 146GB and make it bootable (https://www.linuxquestions.org/questions/linux-general-1/how-to-copy-os-disk-of-76-gb-to-146gb-and-make-it-bootable-670841/)

grens 09-18-2008 10:39 AM

How to copy OS disk of 76 GB to 146GB and make it bootable
 
Hi, I want to copy OS disk 76 GB (linux Red-Hat enterprise Version 5-1 )
to a 146 GB disk and make it bootable on a Proliant 380 G5.
Both disk are configured as raid 0 and are located in slot 1 and slot 2.

First I create the partition on the second disk and I used dumpt and restore to clone the OS. See all the steps.

The problem is I cannot boot after clooning the disk.

I get the following error:

Atempting Boot From Hard Drive (c:)
GRUB

It seem it do not copy the MBR. How can I make the disk bootable ?

Any Suggestion ?

Thanks !!!

See the following Steps:

I have 2 disk. OS disk with one blank disk

[root@ecsccsrv5 ~]# fdisk -l

Disk /dev/cciss/c0d0: 73.3 GB, 73372631040 bytes
255 heads, 63 sectors/track, 8920 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/cciss/c0d0p1 * 1 13 104391 83 Linux
/dev/cciss/c0d0p2 14 778 6144862+ 82 Linux swap / Sol
aris
/dev/cciss/c0d0p3 779 1160 3068415 83 Linux
/dev/cciss/c0d0p4 1161 8920 62332200 5 Extended
/dev/cciss/c0d0p5 1161 8920 62332168+ 83 Linux

Disk /dev/cciss/c0d1: 146.7 GB, 146778685440 bytes
255 heads, 32 sectors/track, 35132 cylinders
Units = cylinders of 8160 * 512 = 4177920 bytes


I created the partition on the new disk as follow:

[root@ecsccsrv5 ~]# fdisk -l /dev/cciss/c0d1

Disk /dev/cciss/c0d1: 146.7 GB, 146778685440 bytes
255 heads, 32 sectors/track, 35132 cylinders
Units = cylinders of 8160 * 512 = 4177920 bytes

Device Boot Start End Blocks Id System
/dev/cciss/c0d1p1 1 25 101984 83 Linux
/dev/cciss/c0d1p2 26 1462 5862960 83 Linux
/dev/cciss/c0d1p3 1463 2181 2933520 83 Linux
/dev/cciss/c0d1p4 2182 35132 134440080 83 Linux



3) Now I create the files system:

mkfs.ext3 /dev/cciss/c0d1p1
mkfs.ext3 /dev/cciss/c0d1p3
mkfs.ext3 /dev/cciss/c0d1p4

Now I will mount the new file system:

root@ecsccsrv5 ~]# mount /dev/cciss/c0d1p1 /mnt_boot
[root@ecsccsrv5 ~]# mount /dev/cciss/c0d1p3 /mnt_var
[root@ecsccsrv5 ~]# mount /dev/cciss/c0d1p4 /mnt_roo

[root@ecsccsrv5 ~]# df -t ext3
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/cciss/c0d0p5 60378404 2980060 54281736 6% /
/dev/cciss/c0d0p3 2972268 253220 2565628 9% /var
/dev/cciss/c0d0p1 101086 11027 84840 12% /boot
/dev/cciss/c0d1p1 98747 5664 87984 7% /mnt_boot
/dev/cciss/c0d1p3 2887380 69928 2670776 3% /mnt_var
/dev/cciss/c0d1p4 132330024 192132 125415888 1% /mnt_root


Now I will copy the filesystem from Os disk to new disk as follow:

[root@ecsccsrv5 ~]# dump -0 -f - /boot | (cd /mnt_boot; restore -x -f - )
DUMP: Date of this level 0 dump: Fri Sep 12 15:44:13 2008
DUMP: Dumping /dev/cciss/c0d0p1 (/boot) to standard output
DUMP: Label: /boot
DUMP: Writing 10 Kilobyte records
DUMP: mapping (Pass I) [regular files]
DUMP: mapping (Pass II) [directories]
DUMP: estimated 5400 blocks.
DUMP: Volume 1 started with block 1 at: Fri Sep 12 15:44:14 2008
DUMP: dumping (Pass III) [directories]
DUMP: dumping (Pass IV) [regular files]
restore: ./lost+found: File exists
DUMP: Volume 1 completed at: Fri Sep 12 15:44:15 2008
DUMP: Volume 1 5450 blocks (5.32MB)
DUMP: Volume 1 took 0:00:01
DUMP: Volume 1 transfer rate: 5450 kB/s
DUMP: 5450 blocks (5.32MB)
DUMP: finished in 1 seconds, throughput 5450 kBytes/sec
DUMP: Date of this level 0 dump: Fri Sep 12 15:44:13 2008
DUMP: Date this dump completed: Fri Sep 12 15:44:15 2008
DUMP: Average transfer rate: 5450 kB/s
DUMP: DUMP IS DONE
set owner/mode for '.'? [yn]y


[root@ecsccsrv5 ~]# df -t ext3
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/cciss/c0d0p5 60378404 2980060 54281736 6% /
/dev/cciss/c0d0p3 2972268 253256 2565592 9% /var
/dev/cciss/c0d0p1 101086 11027 84840 12% /boot
/dev/cciss/c0d1p1 98747 11027 82621 12% /mnt_boot
/dev/cciss/c0d1p3 2887380 69928 2670776 3% /mnt_var
/dev/cciss/c0d1p4 132330024 192132 125415888 1% /mnt_root

Repeat the command for /var

dump -0 -f - /var | (cd /mnt_var; restore -x -f - )

repeat the command /

dump -0 -f - / | (cd /mnt_root; restore -x -f - )

DUMP: Date of this level 0 dump: Fri Sep 12 15:46:47 2008
DUMP: Dumping /dev/cciss/c0d0p5 (/) to standard output
DUMP: Label: /
DUMP: Writing 10 Kilobyte records
DUMP: mapping (Pass I) [regular files]
DUMP: mapping (Pass II) [directories]
DUMP: estimated 2935229 blocks.
DUMP: Volume 1 started with block 1 at: Fri Sep 12 15:47:53 2008
DUMP: dumping (Pass III) [directories]
DUMP: dumping (Pass IV) [regular files]
restore: ./lost+found: File exists
DUMP: 72.70% done at 7113 kB/s, finished in 0:01
DUMP: Volume 1 completed at: Fri Sep 12 15:55:48 2008
DUMP: Volume 1 3448240 blocks (3367.42MB)
DUMP: Volume 1 took 0:07:55
DUMP: Volume 1 transfer rate: 7259 kB/s
DUMP: 3448240 blocks (3367.42MB)
DUMP: finished in 475 seconds, throughput 7259 kBytes/sec
DUMP: Date of this level 0 dump: Fri Sep 12 15:46:47 2008
DUMP: Date this dump completed: Fri Sep 12 15:55:48 2008
DUMP: Average transfer rate: 7259 kB/s
DUMP: DUMP IS DONE
set owner/mode for '.'? [yn] y

see the result after the copy:

[root@ecsccsrv5 ~]# df -text3
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/cciss/c0d0p5 60378404 2980060 54281736 6% /
/dev/cciss/c0d0p3 2972268 253412 2565436 9% /var
/dev/cciss/c0d0p1 101086 11027 84840 12% /boot
/dev/cciss/c0d1p1 98747 11027 82621 12% /mnt_boot
/dev/cciss/c0d1p3 2887380 253068 2487636 10% /mnt_var
/dev/cciss/c0d1p4 132330024 2987804 122620216 3% /mnt_root



See the partition:

root@ecsccsrv5 ~]# fdisk -l /dev/cciss/c0d1

Disk /dev/cciss/c0d1: 146.7 GB, 146778685440 bytes
255 heads, 32 sectors/track, 35132 cylinders
Units = cylinders of 8160 * 512 = 4177920 bytes

Device Boot Start End Blocks Id System
/dev/cciss/c0d1p1 1 25 101984 83 Linux
/dev/cciss/c0d1p2 26 1462 5862960 82 Linux swap / Sol
aris
/dev/cciss/c0d1p3 1463 2181 2933520 83 Linux
/dev/cciss/c0d1p4 2182 35132 134440080 83 Linux




According to me all data are copy to the new disk except the MBR

How can I copy the master boot record without overlapping the disk partition.



Let me know what is wrong.


The previus Steps work fine on unix and should work with linux

FredGSanford 09-18-2008 11:25 AM

Quote:

The problem is I cannot boot after clooning the disk.

I get the following error:

Atempting Boot From Hard Drive (c
GRUB

It seem it do not copy the MBR. How can I make the disk bootable ?

Any Suggestion ?
I didn't read all that or no much about Raids, but have you tried using the Red Hat's cd/dvd to reinstall Grub? With Debian all I do is boot it up and answer 'no' to all questions until it get to the Install Grub section and then reinstall it. Also if you can chroot into it and should be able to reinstall Grub.


All times are GMT -5. The time now is 03:38 AM.