Reinstall GRUB after the hard disk change position, and modify the corresponding file

zhaozj2021-02-16  48

Author: Kamus (Zhang Leyi)

Mail: kamus@itpub.net

Date: 2003-08

Problem Description:

It turned out that the system was mounted on the second IDE port (HDC), and MOUNT has another HDA to / U01. Now I want to call the position of the two hard drives, HDA-> HDC, the original HDC-> HDA, how should I modify the GRUB configuration? GRUB configuration and the current hard disk configuration is as follows: linux: / home / zhangleyi # fdisk -lDisk / dev / hdc: 10.2 GB, 10262568960 bytes16 heads, 63 sectors / track, 19885 cylindersUnits = cylinders of 1008 * 512 = 516096 bytesDevice Boot Start End Blocks Id System / dev / hdc1 * 1 25 12568 83 Linux / dev / hdc2 26 2522 1258488 82 Linux swap / dev / hdc3 2523 19885 8750952 83 LinuxDisk / dev / hda: 20.5 GB, 20576747520 bytes255 heads, 63 sectors / track , 2501 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesDevice Boot Start End Blocks Id System / dev / hda1 * 1 2501 20089251 83 Linuxlinux: / home / zhangleyi # more /etc/grub.confroot (hd0,0) install --stage2 = / boot / grub / stage2 / grub / stage1 d (hd0) / grub / stage2 0x8000 (HD0, 0) /grub/Menu.lstquitlinux:/Home/boot/grub/menu.lst# modified by yast2 . Last modification on Sat Aug 2 09:56:00 2003gfxmenu (hd1,0) / messagecolor white / blue black / light-graydefault 0timeout 8title linuxkernel (hd1,0) / vmlinuz root = / dev / hdc3 vga = 791 splash = silentinitrd (HD1, 0) / INITRDTILE FLOPPYROOT (FD0) CHAINLOADER 1title failsafekernel (hd1,0) /vmlinuz.shipped root = / dev / hdc3 ide = nodma apm = off acpi = off vga = normal nosmp maxcpus = 0 disableapic 3initrd (hd1,0) /initrd.shippedlinux:/home/zhangleyi #

Thank you first

www.linuxsir.com

of

Beyond_2000

The patient explanation of the bamboo is the birth of this thing.

Second, for

Grub

Detailed explanation, you can use

INFO grub

get.

purpose:

Original system installation

HDC

on

(

That is the second one

Idea

Interface

primary

Position

)

,

Grub

Pack on another hard disk

HDA

On, I want to call these two hard disk locations now.

Method: First of all

More / etc / fstab

Confirm that there are several independent file systems, my machine is as follows:

/ DEV / HDC3

Yes

/

,

/ DEV / HDC1

Yes

/ boot

,

/ DEV / HDC2

Yes

SWAP

.

1.

Shut down, connect the hard disk

HDC

Change to

HDA2.

use

SUSE

Mounting disk

CD1

Start computer

3.

Select in the startup menu

RESCUE4.

enter

root

No password, enter

Rescue

Command Line

5. PWD

I can see the current directory as

/ root

Returned

/ 5.

Type

grub

,enter

grub

Command status

6. Find / Boot / Grub / Stage1

This command is used to confirm the included

Boot

Directory of the required documents, display

HD0, 07. root (HD0, 0) 8. Setup (HD0)

Show successful installation

Grub9. Quit

,drop out

grub

Command line status

10. Mount / DEV / HDA1 / TMP (

Remarks: Before you don't have the hard disk connection

HDC

,It is

HDA

This command will

Mount

original

/ boot

Partition

11. Mount / dev / hda3 / usr (

Remarks: This command will

Mount

original

/

Partition

12. Vi /TMP/grub/Menu.lst

Will all

HD1

Change to

HD0

,

HDC

Change to

HDA

And deployment

13. VI / USR / ETC / FSTAB

,

Put all

HDC

Change to

HDA, HDA

Change to

HDC

And deployment

14.

Restart your computer,

OK

转载请注明原文地址:https://www.9cbs.com/read-21928.html

New Post(0)