grub2를 다시 설치하지 않으면 Clonezilla 클론이 부팅되지 않습니다.

grub2를 다시 설치하지 않으면 Clonezilla 클론이 부팅되지 않습니다.

다음 파티션이 있는 머신의 복제본을 가져왔습니다.

Device                   Type        Label
/dev/sda 
    /dev/sda1            Ext4        boot
    /dev/sda2            Linux LVM      
    /dev/system/         LV system     
    /dev/system/home     LV          home
    /dev/system/root     LV          root
    /dev/system/swap     LV          swap

이는 다음의 라벨에서 참조됩니다.

/etc/fstab:

LABEL=root     /        ext4
LABEL=boot     /boot    ext4
LABEL=home     /home    ext4
LABEL=swap     /swap    swap

그리고 grub.cfg:

menuentry 'openSUSE, with linux <version>' --class opensuse --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-<version>-simple-<UUID>' {
    insmod ext2
    set root='hd0,msdos1'
    linux /vmlinuz-<version> root=/dev/mapper/system-root resume=/dev/disk/by-label/swap <other options>
    initrd /initrd-<version>
}

이 복제본을 다른 동일한 컴퓨터에 설치하려고 합니다. 설치는 성공했지만 grub 프롬프트에서 다음을 수행하지 않으면 머신으로 부팅할 수 없습니다.

grub> set root=(hd0,1)
grub> linux /boot/vmlinuz-<version> root=/dev/sda1
grub> initrd /boot/initrd.img-<version>
grub> boot

이러한 단계가 필요하지 않은 이미지를 얻는 것을 훨씬 선호하지만 문제가 어디에 있는지 잘 모르겠습니다(grub 구성, 기타 시스템 파일, clonezilla). 지금까지 시도한 것:

  • /etc/defaults/grub을 편집하고 ' GRUB_DISABLE_LINUX_UUID=true' 주석 처리를 해제했습니다.
  • search --no-floppy --fs-uuid --set=root ${hints} ${fs_uuid}grub.cfg가 생성될 때 추가되는 것을 방지하기 위해 grub-mkconfig_lib를 편집하여 해당 행을 주석 처리했습니다.
  • (그리고 다시 생성됨 grub.cfg)
  • 고급 clonezilla 설치를 선택하고 나중에 MBR을 다시 설치하도록 지시했습니다(옵션 -j1. option -g auto "클라이언트 디스크 MBR에 grub 다시 설치"가 기본적으로 이미 선택되어 있음).

다른 방법을 시도해 볼 수 있나요?

hd0에 대해 "sda1"이 나열되어 있는 것을 확인했지만 /boot/grub2/device.map복제본을 설치할 때 다른 컴퓨터의 HD가 sda1로 감지되므로 이것이 범인일 가능성은 없다고 생각합니다.

(여기나 슈퍼유저가 질문에 더 적합한지 확신할 수 없었습니다. 적절하게 마이그레이션하게 되어 기쁩니다.)

답변1

결국 원래 시스템의 부팅 파티션의 파티션 복제를 가져와 고급 옵션에서 "-j1"을 선택한 다른 시스템에 설치하여 이 문제를 해결했습니다.

추가 단계를 수행하는 것은 약간 짜증나지만 최소한 부팅 파티션의 복제본을 복원하는 데는 몇 초 밖에 걸리지 않습니다.

답변2

이 문제를 해결하기 위한 작업 절차에서는 설치/복제 실패 또는 MBR의 디스크 손상 후 GRUB(2)를 수동으로 설치해야 합니다.

이제 다시 시작한 후 grub 부팅을 수정해 보겠습니다.

sh:grub>set pager=1 # for paging long command outputs; There must be no spaces on either side of the equals sign. 
grub> set root=(hd0,XY)
'grub> insmod /boot/grub/linux.mod # AFAIK, optional step
grub> linux /boot/vmlinuz-4.4.92-36-default root=/dev/sdaXY
grub> initrd /boot/initrd.img-4.4.92-36-default
grub> boot

Linux로 성공적으로 부팅한 후 복구를 영구적으로 수행해 보겠습니다.

# update-grub
# grub-install /dev/sda #or what ever your system disk is

오류가 발생하면update-grub command not found걱정하지 마십시오. 이는 작업을 더 쉽게 만들기 위해 작성된 쉘 스크립트일 뿐입니다. 실제로는 다음과 같습니다.

set -e
exec grub2-mkconfig -o /boot/grub/grub.cfg "$@"

grub-install을 실행한 후에는 시스템이 정상으로 돌아올 것입니다. 저는 Clonezilla 2016-02-10(기본 노트북 디스크를 더 큰 SSD로 마이그레이션)을 사용하여 복제된 OpenSuse Leap 42.2로 이 작업을 수행했습니다.

참고:Linux에서 부팅되지 않는 GRUB 2를 복구하는 방법
Ubuntu에서 손상된 GRUB 2 부트로더 복구

다음은 Linux로 부팅하지 않고도 작동하는 대체 접근 방식입니다.

$ sudo fdisk -l (From this you need to find the device name of your physical drive that won't boot, something like “/dev/sdxy″ - where x is the drive and y is the root partition. Since I was using a software RAID, root (/) was on md1)
$ sudo mount /dev/sdxy /mnt (Mount the root partition)
$ sudo mount --bind /dev /mnt/dev
$ sudo mount --bind /proc /mnt/proc
$ sudo mount --bind /sys /mnt/sys
$ sudo chroot /mnt  (This will change the root of executables to your your drive that won't boot)
$ grub-mkconfig -o /boot/grub/grub.cfg (insure that there are NO error messages)
$ grub-install /dev/sdx (NOTE that this is the drive and not the partition. try grub-install --recheck /dev/sdxy if it fails)
Ctrl+D (to exit out of chroot)
$ sudo umount /mnt/dev
$ sudo umount /mnt/proc
$ sudo umount /mnt/sys
$ sudo umount /mnt

참조:http://redsunsoft.com/2016/06/how-to-repair-a-server-stuck-at-the-grub-prompt/

답변3

TL;DR

GPT에 설치된 Ubuntu에서는 시스템에 로그인한 후 BootRepair를 사용하십시오.


@jam과 동일한 문제가 있었지만 제 경우에는 다음과 같습니다.

  • 복제하고 싶었던 우분투 16.04
  • 소스 디스크(HDD, 500GB)
    • MBR
    • Windows로 듀얼 부팅
  • 대상 디스크(SSD, 256GB)
    • GPT

그래서 /homeClonezilla를 사용하여 전체 디스크가 아닌 Linux 파티션(시스템의 경우 sda5, 의 경우 sda6)만 복제했습니다.

이를 가능하게 하기 위해 SSD에 클리어 우분투를 설치하고, HDD에서 만든 것처럼 파티션을 생성하고, ESP(EFI System Partition)도 추가했습니다. 그런 다음 이 파티션을 Clonezilla(HDD 파티션에서 SSD로)로 덮어썼습니다. 결과적으로 GRUB 프롬프트가 표시되었습니다.

그럼 내가 만든

grub> set root=(hd0,gpt2)  # NOTICE: used gptX instead of simple number
grub> linux /boot/vmlinuz-<version> root=/dev/sda1
grub> initrd /boot/initrd.img-<version>
grub> boot

@jam이 그랬고 @wp78de가 제안한 대로(또한 그의 심판에서도 언급되었습니다).

그런 다음 오류가 발생 update-grub하여 계속 작동했습니다.grub-install

grub-install: error: will not proceed with blocklists

그 이유는 GPT에 있었습니다. 유용한 내용이 있었네요이것스레드이지만 가장 간단한 접근 방식은 다음을 사용하는 것입니다.부팅수리. BootRepair에서 수행한 특별한 작업이 있었는지 모르겠지만 GRUB를 다시 설치해 보았는데 이제 모든 것이 잘 작동합니다!

답변4

MBR 부팅에서 이와 똑같은 문제(Centos 7)가 발생했습니다. 디스크, 파티션, Clonezilla 버전 등의 측면에서 무엇을 시도했는지는 중요하지 않았습니다. 결국 스레드에서 이전에 참조한 PartedMagic ISO를 구입했습니다. CLonezilla를 사용했습니다. 수동 개입 없이 복제된 디스크가 부팅되면서 프로세스가 끝날 때 분명히 마법 같은 일을 수행했습니다.

크레이그

관련 정보