[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Added SATA drive, now it won't boot
From: |
Andrei Borzenkov |
Subject: |
Re: Added SATA drive, now it won't boot |
Date: |
Sat, 12 Nov 2016 13:32:09 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 |
10.11.2016 00:52, Tracy Reed пишет:
> Simon Hobson said:
>> What does your grub.conf have for device names ?
>
> Thank you very much for your reply!
>
> I'm running CentOS 7 so I have a /etc/grub2.conf which contains, among a
> lot of other code which I do not yet understand, this code which I
> believe is the relevant part with the first part being the OS I intend
> to boot and the second being a rescure mode, both having the same
> problem:
>
> ### BEGIN /etc/grub.d/10_linux ###
> menuentry 'CentOS Linux (3.10.0-327.el7.x86_64) 7 (Core)' --class centos
> --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option
> 'gnulinux-3.10.0-327.el7.x86_64-advanced-28cfb170-d49b-4629-b624-5cdfb83ec572'
> {
> load_video
> set gfxpayload=keep
> insmod gzio
> insmod part_msdos
> insmod xfs
> set root='hd0,msdos1'
> if [ x$feature_platform_search_hint = xy ]; then
> search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1'
> 28cfb170-d49b-4629-b624-5cdfb83ec572
> else
> search --no-floppy --fs-uuid --set=root
> 28cfb170-d49b-4629-b624-5cdfb83ec572
> fi
Add
echo "Preparing to load kernel"
sleep 5
> linux16 /boot/vmlinuz-3.10.0-327.el7.x86_64
> root=UUID=28cfb170-d49b-4629-b624-5cdfb83ec572 ro crashkernel=auto rhgb quiet
Remove "quiet" so you can kernel output. Add
echo "Kernel loaded; preparing to load initrd"
sleep 5
> initrd16 /boot/initramfs-3.10.0-327.el7.x86_64.img
add
echo "initrd loaded; preparing to boot"
sleep 5
here. This will show you (us) how far grub was.
> }
> menuentry 'CentOS Linux (0-rescue-97c498c783b540e38e76e32bb2b24a1a) 7 (Core)'
> --class centos --class gnu-linux --class gnu --class os --unrestricted
> $menuentry_id_option
> 'gnulinux-0-rescue-97c498c783b540e38e76e32bb2b24a1a-advanced-28cfb170-d49b-4629-b624-5cdfb83ec572'
> {
> load_video
> insmod gzio
> insmod part_msdos
> insmod xfs
> set root='hd0,msdos1'
> if [ x$feature_platform_search_hint = xy ]; then
> search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1'
> 28cfb170-d49b-4629-b624-5cdfb83ec572
> else
> search --no-floppy --fs-uuid --set=root
> 28cfb170-d49b-4629-b624-5cdfb83ec572
> fi
> linux16 /boot/vmlinuz-0-rescue-97c498c783b540e38e76e32bb2b24a1a
> root=UUID=28cfb170-d49b-4629-b624-5cdfb83ec572 ro crashkernel=auto rhgb quiet
> initrd16 /boot/initramfs-0-rescue-97c498c783b540e38e76e32bb2b24a1a.img
> }
> if [ "x$default" = 'CentOS Linux (3.10.0-327.el7.x86_64) 7 (Core)' ]; then
> default='Advanced options for CentOS Linux>CentOS Linux
> (3.10.0-327.el7.x86_64) 7 (Core)'; fi;
> ### END /etc/grub.d/10_linux ###
>
> So we can see that it sets root to 'hd0,msdos1' but then it goes to
> search by uuid. I have verified that hd0,msdos1 is correct *and* the
> uuid is correct also. From probing around with the grub command line I
> can verify that the drive number assignments do not change when the SATA
> disk is added or removed. The NVMe device which the OS and grub were
> installed to are always hd0. I have booted the machine the the SATA
> drive in and with it out. It only boots properly with the drive out. But
> the NVMe device and OS partition is always hd0,msd0s1.
>
> I have verified using blkid in the booted OS and by manually typing the
> above search command on the grub command line that the above uuid is on
> the NVMe OS partition which is hd0,msdos1.
>
> I have tried removing all traces of hd0,msdos1 from the config to make
> it rely only on UUID and it still doesn't boot.
>
>> If it's using names like sda1 or (hd0,0) etc then it's probably because
>> the devices as seen by Grub have moved and sda is now sdb and hd0 is now
>> hd1. If you can get to the grub menu, then you should be able to edit a
>> menu entry before trying to boot it and change the device names to suit.
>> Once you've booted - you may need to boot to single user mode and edit
>> your /etc/fstab file as well - then you can update grub to get the new
>> device names. This is the sort of thing that UUIDs were designed to get
>> around - it doesn't matter what order the devices are found in, Grub and
>> mount will find the right disk/partition by it's UUID. Personally I
>> prefer filesystem labels (once you've had to type a couple of UUIDs to
>> get a system to boot you'll know why), but Debian doesn't support that
>> as an option for Grub.
>
> I've also tried changing the device name to (hd1,msdos1) and other
> things. No go. I can use the ls command like ls
> (hd0,msdos1)/boot/vmlinuz etc. and see the proper files where they
> should be on hd0,msdos1. But if I then try to boot it with the SATA
> drive installed it won't boot, I simply get the dreaded blinking cursor
> in the upper left.
>
> Any other ideas?
>
>
>
> _______________________________________________
> Help-grub mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/help-grub
>
signature.asc
Description: OpenPGP digital signature