LINUX.ORG.RU

Проблема с обновлением загрузчика после удаления старых ядер.

 , ,


0

1

Всем привет. ни как не могу обновить загрузчик после удаления старых ядер Ubuntu.

Попробовали удалить старые ядра командой

dpkg -l linux-{image,headers}-«[0-9]*» | awk '/ii/{print $2}' | grep -ve $kernelver

После перезагрузки черный экран и пустота. попробовали загрузиться с лайвсд там arch linux. fdisk показывает

Device Boot Start End Sectors Size Id Type

/dev/sda1 * 2048 495615 493568 241M fd Linux raid autodetect

/dev/sda2 497662 468860927 468363266 223.3G 5 Extended

/dev/sda5 497664 468860927 468363264 223.3G fd Linux raid autodetect

Partition 2 does not start on physical sector boundary.

Disk /dev/sdb: 223.6 GiB, 240057409536 bytes, 468862128 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes

I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disklabel type: dos

Disk identifier: 0xa9dc9f6a

Device Boot Start End Sectors Size Id Type

/dev/sdb1 * 2048 495615 493568 241M fd Linux raid autodetect

/dev/sdb2 497662 468860927 468363266 223.3G 5 Extended

/dev/sdb5 497664 468860927 468363264 223.3G fd Linux raid autodetect

Partition 2 does not start on physical sector boundary.

Каким способом можно восстановить загрузчик ?



Последнее исправление: tonya (всего исправлений: 2)

Делал chroot в свою систему и оттуда восстановить? И еще: команда, котрую ты привел, ядра не удаляет, что ты еще вводил?

rumgot ★★★★★
()
Ответ на: комментарий от rumgot

Так должна быть запись про обновление загрузчика .. но она не влезла в консоль. собственно по тому загрузчик не обновился до перезагрузки.

chroot не получается сделать из-за того что raid - не могу его монтировать. :(

tonya
() автор топика
Ответ на: комментарий от rumgot
 # cat /proc/mdstat                                                                                                                                         :(
Personalities : [raid1] 
md126 : active (auto-read-only) raid1 sda5[0] sdb5[1]
      234050560 blocks super 1.2 [2/2] [UU]
      bitmap: 0/2 pages [0KB], 65536KB chunk

md127 : active (auto-read-only) raid1 sda1[0] sdb1[1]
      246592 blocks super 1.2 [2/2] [UU]
      
unused devices: <none>
tonya
() автор топика
Ответ на: комментарий от rumgot
# lsblk                                                                                                                                                   :(
NAME      MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
loop0       7:0    0   704M  1 loop  
sda         8:0    0 223.6G  0 disk  
├─sda1      8:1        241M  0 part  
│ └─md127   9:127  0 240.8M  0 raid1 
├─sda2      8:2    0     1K  0 part  
└─sda5      8:5    0 223.3G  0 part  
  └─md126   9:126  0 223.2G  0 raid1 
sdb         8:16   0 223.6G  0 disk  
├─sdb1      8:17   0   241M  0 part  
│ └─md127   9:127  0 240.8M  0 raid1 
├─sdb2      8:18   0     1K  0 part  
└─sdb5      8:21   0 223.3G  0 part  
  └─md126   9:126  0 223.2G  0 raid1 
tonya
() автор топика
Ответ на: комментарий от rumgot
NAME           MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
loop0            7:0    0   704M  1 loop  /run/archiso/sfs/airootfs
sda              8:0    0 223.6G  0 disk  
├─sda1           8:1    0   241M  0 part  
│ └─md127        9:127  0 240.8M  0 raid1 /mnt
├─sda2           8:2    0     1K  0 part  
└─sda5           8:5    0 223.3G  0 part  
  └─md126        9:126  0 223.2G  0 raid1 
    └─vg0-root 253:0    0 223.2G  0 lvm   /mnt
sdb              8:16   0 223.6G  0 disk  
├─sdb1           8:17   0   241M  0 part  
│ └─md127        9:127  0 240.8M  0 raid1 /mnt
├─sdb2           8:18   0     1K  0 part  
└─sdb5           8:21   0 223.3G  0 part  
  └─md126        9:126  0 223.2G  0 raid1 
    └─vg0-root 253:0    0 223.2G  0 lvm   /mnt
tonya
() автор топика
Ответ на: комментарий от rumgot

Дополли до этого -

# lvscan
ACTIVE            '/dev/vg0/root' [<223.21 GiB] inherit
 # sudo mkdir /mnt/hdd 
 # sudo mount /dev/vg0/root /mnt/hdd
 # chroot /mnt/hdd
chroot: failed to run command ‘/usr/bin/zsh’: No such file or directory

lvdisplay выдает:

# lvdisplay                                                                                                                                               :(
  --- Logical volume ---
  LV Path                /dev/vg0/root
  LV Name                root
  VG Name                vg0
  LV UUID                Rl7tXv-oyGg-rPBa-Lxw2-ezS9-KFeD-xPUQJQ
  LV Write Access        read/write
  LV Creation host, time cs34886, 2017-07-08 05:05:09 +0000
  LV Status              available
  # open                 1
  LV Size                <223.21 GiB
  Current LE             57141
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0

tonya
() автор топика
Ответ на: комментарий от tonya
lsblk                       
NAME           MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
loop0            7:0    0   704M  1 loop  /run/archiso/sfs/airootfs
sda              8:0    0 223.6G  0 disk  
├─sda1           8:1    0   241M  0 part  
│ └─md127        9:127  0 240.8M  0 raid1 
├─sda2           8:2    0     1K  0 part  
└─sda5           8:5    0 223.3G  0 part  
  └─md126        9:126  0 223.2G  0 raid1 
    └─vg0-root 253:0    0 223.2G  0 lvm   /mnt/hdd
sdb              8:16   0 223.6G  0 disk  
├─sdb1           8:17   0   241M  0 part  
│ └─md127        9:127  0 240.8M  0 raid1 
├─sdb2           8:18   0     1K  0 part  
└─sdb5           8:21   0 223.3G  0 part  
  └─md126        9:126  0 223.2G  0 raid1 
    └─vg0-root 253:0    0 223.2G  0 lvm   /mnt/hdd

и сработало

 arch-chroot /mnt/hdd   

tonya
() автор топика
Ответ на: комментарий от rumgot

Но далее выходит совсем печально -

# grub-install /dev/sda
Installing for i386-pc platform.
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  WARNING: Failed to connect to lvmetad. Falling back to internal scanning.
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  WARNING: Failed to connect to lvmetad. Falling back to internal scanning.
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  WARNING: Failed to connect to lvmetad. Falling back to internal scanning.
Installation finished. No error reported.

tonya
() автор топика
Ответ на: комментарий от rumgot

А при попытке обновить вылетает вот это

root@sel-rescue:/# sudo update-grub
sudo: unable to resolve host sel-rescue
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
grep: /boot/config*: No such file or directory
Updating /boot/grub/menu.lst ... done

tonya
() автор топика
Ответ на: комментарий от rumgot

Дальше запускается grub в виде minimal bash и все ..

tonya
() автор топика
Ответ на: комментарий от rumgot
# dpkg -l | grep linux-image
ii  linux-image-4.4.0-109-generic        4.4.0-109.132                              amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
iF  linux-image-4.4.0-112-generic        4.4.0-112.135                              amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
rc  linux-image-4.4.0-91-generic         4.4.0-91.114                               amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
rc  linux-image-4.4.0-92-generic         4.4.0-92.115                               amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
rc  linux-image-4.4.0-93-generic         4.4.0-93.116                               amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
rc  linux-image-4.4.0-96-generic         4.4.0-96.119                               amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
rc  linux-image-4.4.0-97-generic         4.4.0-97.120                               amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
rc  linux-image-extra-4.4.0-101-generic  4.4.0-101.124                              amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-extra-4.4.0-109-generic  4.4.0-109.132                              amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
iU  linux-image-extra-4.4.0-112-generic  4.4.0-112.135                              amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
rc  linux-image-extra-4.4.0-83-generic   4.4.0-83.106                               amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
rc  linux-image-extra-4.4.0-87-generic   4.4.0-87.110                               amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
rc  linux-image-extra-4.4.0-89-generic   4.4.0-89.112                               amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
rc  linux-image-extra-4.4.0-91-generic   4.4.0-91.114                               amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
rc  linux-image-extra-4.4.0-92-generic   4.4.0-92.115                               amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
rc  linux-image-extra-4.4.0-93-generic   4.4.0-93.116                               amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
rc  linux-image-extra-4.4.0-96-generic   4.4.0-96.119                               amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
rc  linux-image-extra-4.4.0-97-generic   4.4.0-97.120                               amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
iU  linux-image-generic                  4.4.0.112.118                              amd64        Generic Linux kernel image
tonya
() автор топика
Ответ на: комментарий от tonya
# sudo apt-get --reinstall install linux-image-4.4.0-109.32-generic
sudo: unable to resolve host sel-rescue
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package linux-image-4.4.0-109.32-generic
E: Couldn't find any package by glob 'linux-image-4.4.0-109.32-generic'
E: Couldn't find any package by regex 'linux-image-4.4.0-109.32-generic'
tonya
() автор топика
Ответ на: комментарий от tonya

Могу только подсказывать здесь. Т.к. пишу с телефона, а за компом буду только в понедельник. Если столько будешь ждать, тогда могу. Попробуй в команду установки ядра ставить иия пакета linux-image-4.4.0-109-generic, а не linux-image-4.4.0-109.32-generic

rumgot ★★★★★
()
Последнее исправление: rumgot (всего исправлений: 1)
Ответ на: комментарий от rumgot

А так выдает ошибку (вообще E: Sub-process /usr/bin/dpkg returned an error code (1) часто сегодня видел при попытке что либо исправить)

# sudo apt-get install linux-image-4.4.0-109-generic
sudo: unable to resolve host sel-rescue
Reading package lists... Done
Building dependency tree       
Reading state information... Done
linux-image-4.4.0-109-generic is already the newest version (4.4.0-109.132).
The following packages were automatically installed and are no longer required:
  grub-pc-bin python-acme python-augeas python-certbot-apache python-configargparse python-configobj python-configparser python-dialog python-dnspython python-funcsigs
  python-future python-josepy python-mock python-ndg-httpsclient python-parsedatetime python-pbr python-psutil python-pyasn1 python-pyicu python-rfc3339 python-zope.component
  python-zope.event python-zope.hookable python-zope.interface
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up linux-image-4.4.0-112-generic (4.4.0-112.135) ...
Internal Error: Could not find image (/boot/vmlinuz-4.4.0-112-generic)
dpkg: error processing package linux-image-4.4.0-112-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of linux-image-extra-4.4.0-112-generic:
 linux-image-extra-4.4.0-112-generic depends on linux-image-4.4.0-112-generic; however:
  Package linux-image-4.4.0-112-generic is not configured yet.

dpkg: error processing package linux-image-extra-4.4.0-112-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image-generic:
 linux-image-generic depends on linux-image-4.4.0-112-generic; however:
  Package linux-image-4.4.0-112-generic is not configured yet.
 linux-image-generic depends on linux-image-extra-4.4.0-112-generic; however:
  Package linux-image-extra-4.4.0-112-generic is not configured yet.

dpkg: error processing package linux-image-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image-extra-virtual:
 linux-image-extra-virtual depends on linux-image-generic (= 4.4.0.112.118); however:
  Package linNo apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                                       No apport report written because the error message indicates its a followup error from a previous failure.
                                              No apport report written because MaxReports is reached already
                                                                                                            ux-image-generic is not configured yet.

dpkg: error processing package linux-image-extra-virtual (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 linux-image-4.4.0-112-generic
 linux-image-extra-4.4.0-112-generic
 linux-image-generic
 linux-image-extra-virtual
E: Sub-process /usr/bin/dpkg returned an error code (1)
tonya
() автор топика
Ответ на: комментарий от tonya
# dpkg -l 'linux-headers*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                   Version                  Architecture             Description
+++-======================================-========================-========================-==================================================================================
un  linux-headers                          <none>                   <none>                   (no description available)
un  linux-headers-3.0                      <none>                   <none>                   (no description available)
ii  linux-headers-4.4.0-109                4.4.0-109.132            all                      Header files related to Linux kernel version 4.4.0
ii  linux-headers-4.4.0-109-generic        4.4.0-109.132            amd64                    Linux kernel headers for version 4.4.0 on 64 bit x86 SMP
ii  linux-headers-4.4.0-112                4.4.0-112.135            all                      Header files related to Linux kernel version 4.4.0
ii  linux-headers-4.4.0-112-generic        4.4.0-112.135            amd64                    Linux kernel headers for version 4.4.0 on 64 bit x86 SMP
un  linux-headers-4.4.0-91-generic         <none>                   <none>                   (no description available)
un  linux-headers-4.4.0-92-generic         <none>                   <none>                   (no description available)
un  linux-headers-4.4.0-93-generic         <none>                   <none>                   (no description available)
un  linux-headers-4.4.0-96-generic         <none>                   <none>                   (no description available)
un  linux-headers-4.4.0-97-generic         <none>                   <none>                   (no description available)
ii  linux-headers-generic                  4.4.0.112.118            amd64                    Generic Linux kernel headers
tonya
() автор топика
Ответ на: комментарий от rumgot

Ничего не устанавливает (

apt -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  grub-pc-bin python-acme python-augeas python-certbot-apache python-configargparse python-configobj python-configparser python-dialog python-dnspython python-funcsigs
  python-future python-josepy python-mock python-ndg-httpsclient python-parsedatetime python-pbr python-psutil python-pyasn1 python-pyicu python-rfc3339 python-zope.component
  python-zope.event python-zope.hookable python-zope.interface
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
tonya
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.