我很难在VM的LVM容器中安装grub。这是分区表:
# parted /dev/mgtvg/linux2os print
Model: Linux device-mapper (linear) (dm)
Disk /dev/dm-7: 129GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1049kB 6469MB 6468MB primary ext3 boot
2 6469MB 11.8GB 5369MB primary xfs
3 11.8GB 17.2GB 5369MB primary xfs
4 17.2GB 129GB 112GB extended lba
5 17.2GB 22.6GB 5369MB logical xfs分区一包含根文件系统(没有/boot)。试图安装grub:
# grub --device-map=/dev/null
GNU GRUB version 0.97 (640K lower / 3072K upper memory)
[ Minimal BASH-like line editing is supported. For the first word, TAB
lists possible command completions. Anywhere else TAB lists the possible
completions of a device/filename.]
grub> device (hd0) /dev/mgtvg/linux2os
device (hd0) /dev/mgtvg/linux2os
grub> root (hd0,0)
root (hd0,0)
Filesystem type is ext2fs, partition type 0x83
grub> setup
setup
Error 1: Unrecognized device string
grub> 这是来自包含VM的LV的grub.conf文件:
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
serial --unit=1 --speeed=19200
terminal --timeout=8 console serial
title CentOS (2.6.32-279.22.1.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-279.22.1.el6.x86_64 ro root=/dev/sda1
initrd /initramfs-2.6.32-279.22.1.el6.x86_64.img
title CentOS (2.6.32-279.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-279.el6.x86_64 ro root=/dev/sda1
initrd /initramfs-2.6.32-279.el6.x86_64.img我还需要什么?
发布于 2015-02-16 11:32:19
您可能丢失了这些分区的设备文件。换言之:
kpartx -a -v /dev/mgtvg/linux2os这应该会创建如下内容:
/dev/mapper/mgtvg-linux2os1
/dev/mapper/mgtvg-linux2os2..。
在那之后,你也许可以
grub-install /dev/mapper/mgtvg-linux2os这将反过来将(hd0,0)或(hd0,msdos1)解析为/dev/mapper/mgtvg-linux2os1,然后事情可能会实际工作。
请注意,我也会在色度范围内完成所有这些操作。chroot /dev必须有来自父机器的VM相关设备节点以及/proc。这样你就不会把父母的食物搞砸了。
https://unix.stackexchange.com/questions/75068
复制相似问题