방금 Ubuntu 12.04에서 14.04로 업그레이드했지만 설치 중에 grub-install이 실패했습니다.
나는 설치를 계속했고 나중에 grub 문제를 해결하기를 희망했습니다. 그러나 나는 몇 가지 어려움에 부딪쳤다. 시스템을 다시 시작할 수 없을 것 같아서 시스템을 다시 시작하지 않았습니다.
이것은 내가 항상 grub을 설치하려고 시도하는 오류입니다.
$ sudo grub-install /dev/mapper/isw_cjccfdbihf_Volume0p1
Installing for i386-pc platform.
grub-install: error: cannot find a GRUB drive for /dev/mapper/isw_cjccfdbihf_Volume0p1. Check your device.map.
(나는 또한 시도 sudo grub-install /dev/sda
했지만 똑같은 오류 메시지로 실패합니다.)
컴퓨터가 RAID 1 설정을 사용하는 것 같습니다. 다음은 몇 가지 정보입니다.
$ ls -algh /dev/mapper/
total 0
drwxr-xr-x 2 root 120 Aug 12 19:41 .
drwxr-xr-x 16 root 5.2K Aug 12 20:27 ..
crw------- 1 root 10, 236 Jul 28 10:30 control
lrwxrwxrwx 1 root 7 Aug 12 19:41 isw_cjccfdbihf_Volume0p1 -> ../dm-1
lrwxrwxrwx 1 root 7 Aug 12 19:41 isw_cjccfdbihf_Volume0p2 -> ../dm-2
lrwxrwxrwx 1 root 7 Aug 12 19:41 isw_cjccfdbihf_Volume0p5 -> ../dm-3
$ sudo grub-probe -t device /boot/grub
/dev/mapper/isw_cjccfdbihf_Volume0p1
$ sudo fdisk -l
Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0003b681
Device Boot Start End Blocks Id System
/dev/sda1 2048 468514815 234256384 83 Linux
/dev/sda2 468516862 488390655 9936897 5 Extended
/dev/sda5 468516864 488390655 9936896 82 Linux swap / Solaris
Disk /dev/sdb: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0003b681
Device Boot Start End Blocks Id System
/dev/sdb1 2048 468514815 234256384 83 Linux
/dev/sdb2 468516862 488390655 9936897 5 Extended
/dev/sdb5 468516864 488390655 9936896 82 Linux swap / Solaris
Disk /dev/mapper/isw_cjccfdbihf_Volume0p1: 239.9 GB, 239878537216 bytes
255 heads, 63 sectors/track, 29163 cylinders, total 468512768 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/isw_cjccfdbihf_Volume0p1 doesn't contain a valid partition table
fdisk: unable to read /dev/mapper/isw_cjccfdbihf_Volume0p2: Inappropriate ioctl for device
특히 마지막 두 줄은 더 깊은 문제를 나타내는 것 같습니다. :-(
의 오류 메시지 grub-install
에는 device.map 파일도 언급되어 있습니다.
$ cat /boot/grub/device.map
cat: /boot/grub/device.map: No such file or directory
나는 그것을 생성하려고 시도했지만 도움이되지 않았습니다 (오류 메시지가 변경되지 않았습니다).
$ sudo grub-mkdevicemap
$ cat /boot/grub/device.map
(hd0) /dev/disk/by-id/ata-WDC_WD2500AAJS-00YZCA0_WD-WCAYU7549707
(hd1) /dev/disk/by-id/ata-WDC_WD2500AAJS-00YZCA0_WD-WCAYU7501473
다음에 시도해야 할 권장 사항이 있습니까? 도움을 주시면 감사하겠습니다.
최신 정보:
$ debconf-show grub-pc
debconf: DbDriver "passwords" warning: could not open /var/cache/debconf /passwords.dat: Permission denied
* grub-pc/install_devices: /dev/disk/by-id/dm-name-isw_cjccfdbihf_Volume0
grub-pc/kopt_extracted: false
grub-pc/partition_description:
* grub2/linux_cmdline:
grub-pc/install_devices_empty: false
grub-pc/timeout: 10
grub-pc/install_devices_failed_upgrade: true
* grub2/linux_cmdline_default: quiet splash
grub-pc/postrm_purge_boot_grub: false
grub-pc/hidden_timeout: true
grub-pc/disk_description:
grub-pc/mixed_legacy_and_grub2: true
grub2/kfreebsd_cmdline_default: quiet splash
grub2/device_map_regenerated:
* grub-pc/install_devices_failed: true
grub-pc/chainload_from_menu.lst: true
grub-pc/install_devices_disks_changed:
grub2/kfreebsd_cmdline:
줄을 참고하십시오. grub-pc/install_devices: /dev/disk/by-id/dm-name-isw_cjccfdbihf_Volume0
이제 내용 /etc/fstab
:
proc /proc proc nodev,noexec,nosuid 0 0
/dev/mapper/isw_cjccfdbihf_Volume01 / ext4 errors=remount-ro 0 1
/dev/mapper/isw_cjccfdbihf_Volume0p5 none swap sw 0 0
2012 년의 백업 파일은 스왑에 대해 약간 다른 항목 (Volume0p5 대신 Volume05)을 표시하며 이는 이름이 변경되었을 수 있음을 나타냅니다.
# Note that this is an old file at the time the system was installed (Ubuntu 10.04 or 10.10)
# (This is also the time from which the original grub configuration is from, isn't it?!)
/dev/mapper/isw_cjccfdbihf_Volume01 / ext4 errors=remount-ro 0 1
/dev/mapper/isw_cjccfdbihf_Volume05 none swap sw 0 0
따라서 "_Volume01"대 "_Volume0p1"대 "_Volume0"과 관련이있을 수 있습니다. /etc/fstab
"01" ls /dev/mapper
은 "0p1", "0p2"및 "0p5"(스왑) 매핑을 반환하고 마지막으로 debconf-show grub-pc
"Volume0"이라고 말합니다. 이 불일치가 문제의 근원이라고 생각합니다.
이제 궁금합니다.
grub-pc/install_devices
의 출력 라인 은 무엇이어야 debconf-show grub-pc
합니까?또한 grub-pc의 설치가 중단되었음을 알았습니다.
$ sudo dpkg-reconfigure grub-pc
/usr/sbin/dpkg-reconfigure: grub-pc is broken or not fully installed
문제를 해결 한 방법은 다음과 같습니다.
조용한 순간에 다운 타임을 감수 할 시간이있었습니다. 그래서 Ubuntu 14.04 Live CD로 시스템을 재부팅하고 Grub을 다시 설치했습니다. 문제가 발생하지 않았고 시스템이 정상적으로 부팅되었습니다.
일반적인 설명은 다음과 같습니다. https://help.ubuntu.com/community/Grub2/Installing#via_the_LiveCD_terminal
메모리에서 특정 경우에 사용한 명령은 다음과 같습니다.
Live CD에서 부팅하고 다음 명령을 실행했습니다.
$ sudo su
$ mount /dev/mapper/isw_cjccfdbihf_Volume0p1 /mnt
(Sorry, I'm not 100% sure whether the target was /dev/mapper/isw_cjccfdbihf_Volume0p1 or
/dev/sda. I think it was /dev/mapper/isw_cjccfdbihf_Volume0p1.)
$ grub-install --root-directory=/mnt /dev/mapper/isw_cjccfdbihf_Volume0p1
$ reboot
그 후 시스템이 재부팅되었습니다. 마지막으로 sudo apt-get install
.
현재로서는 /etc/fstab
여전히 /dev/mapper/isw_cjccfdbihf_Volume01
루트 디렉토리 목록 입니다. 이것이 실제로 올바른지 여전히 모르겠지만 /dev/mapper/isw_cjccfdbihf_Volume0p1
재부팅 후에도 여전히 작동하는지 확인 하기 위해 변경하지 않았습니다 .
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다