트리에 설치된 grub 설치 - 걱정할 부분인가요?

트리에 설치된 grub 설치 - 걱정할 부분인가요?

tree방금 다음 을 통해 설치했습니다.

sudo apt-get install tree

내 터미널이 갑자기 업데이트하기로 결정했습니다 grub. 지난주에 을(를) 설치했는데 tree비슷한 일이 일어났습니다. 그러나 그날 밤 나중에 PC를 다시 시작했을 때 다음이 표시된 창으로 부팅되었습니다.

Grub _

그리고 변하지 않았습니다.

결국 나는 내 OS를 다시 설치했습니다(나는 WattOS를 사용하고 있으며 지난 화요일에 새 PC에 설치했기 때문에 세상이 끝난 것은 아니었습니다. 모든 것을 다시 설정하는 데 5시간이 걸렸습니다).

Grub은 지난 번에 본 것을 어렴풋이 기억하는 여러 가지 오류와 함께 설치되었습니다(읽기 쉽도록 게시물 하단에 포함).

나는 다음을 검색했습니다.

  1. 트리가 grub을 업데이트하는 이유는 무엇입니까?
  2. Grub이 업그레이드/업데이트된 이유는 무엇입니까?

그러나 나는 운이 없었습니다. 아마 뭔가를 놓치고 있는 것 같아요.

누구든지 설명할 수 있습니까?

  1. 왜 이런 일이 일어났는가
  2. 이게 무슨 문제가 있다는 뜻인가요?
  3. 문제를 해결하기 위해 무엇이든 해야 하거나 할 수 있다면.

나는 모든 것을 다시 설치하고 싶지 않습니다 (분명한 이유가 있습니다!)

감사해요.

설치 시 발생한 오류 tree:

sudo apt-get install tree
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  gimp-data libamd2 libbabl-0.1-0 libcamd2 libccolamd2 libcholmod3 libgegl-0.4-0     libgegl-common libgexiv2-2 libgimp2.0 libhpmud0 libimagequant0
      libmetis5 libqt5designer5 libqt5help5 libqt5sql5 libqt5sql5-sqlite libqt5test5         libsane-hpaio libumfpack5 printer-driver-hpcups
  printer-driver-postscript-hp python3-dbus.mainloop.pyqt5 python3-notify2 python3-    olefile python3-pexpect python3-pil python3-ptyprocess
  python3-pyqt5 python3-pyqt5.sip python3-renderpm python3-reportlab python3-reportlab-    accel vlc-plugin-samba xsane xsane-common
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
  tree
0 upgraded, 1 newly installed, 0 to remove and 174 not upgraded.
1 not fully installed or removed.
Need to get 49.6 kB of archives.
After this operation, 118 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian bullseye/main amd64 tree amd64 1.8.0-1+b1 [49.6 kB]
Fetched 49.6 kB in 0s (110 kB/s)
Selecting previously unselected package tree.
(Reading database ... 123032 files and directories currently installed.)
Preparing to unpack .../tree_1.8.0-1+b1_amd64.deb ...
Unpacking tree (1.8.0-1+b1) ...
Setting up grub-pc (2.06-3~deb11u6) ...
Installing for i386-pc platform.
grub-install: warning: File system `ext2' doesn't support embedding.
grub-install: warning: Embedding is not possible.  GRUB can only be installed in this     setup by using blocklists.  However, blocklists are UNRELIABLE and their use is discouraged..
Installation finished. No error reported.
Generating grub configuration file ...
Found background: /usr/share/wattOS/splash.png
Found background image: /usr/share/wattOS/splash.png
Found linux image: /boot/vmlinuz-5.10.0-19-amd64
Found initrd image: /boot/initrd.img-5.10.0-19-amd64
Warning: os-prober will be executed to detect other bootable partitions. Its output will be used to detect bootable binaries on them and create new boot entries. Found Debian GNU/Linux 11 (bullseye) on /dev/mmcblk0p2 done Setting up tree (1.8.0-1+b1) ... 
Processing triggers for man-db (2.9.4-2) ...

업데이트

실수로 재부팅했는데 PC가 다시 멈췄습니다. 그런 다음 내 하드 드라이브의 유일한 OS로 WattOS를 다시 설치했는데 모든 것이 잘 작동했습니다. 방금 @eyoung100 님의 답변을 보고 달려왔습니다.

sudo apt upgrade

오류 없이 실행되었습니다.

그런 다음 나는 달렸다

sudo apt autoremove

절반쯤 지나서 지난 번과 같은 화면이 나타났습니다.

The grub-pc package is being upgraded. This menu allows you to select which devices you'd like grub-install to be automatically run for, if any.
Running grub-install automatically is recommended in most situations, to prevent the installed GRUB core image from getting out of sync with      
GRUB modules or grub.cfg.
If you're unsure which drive is designated as boot drive by your BIOS, it is often a good idea to install GRUB to all of them.
Note: it is possible to install GRUB to partition boot records as well, and some appropriate partitions are offered here. However, this forces GRUB to use the blocklist mechanism, which makes it less reliable, and therefore is not recommended.

지난번에 오류가 발생했기 때문에 확인을 선택하지 않았습니다.

그런 다음 다른 터미널에서 시도했을 때

sudo apt upgrade

그것은 다음과 같이 응답했습니다.

Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 39623 (apt) 

이는 거의 놀라운 일이 아닙니다.

ctrl-c와 ctrl-x를 사용하여 해당 쉘을 닫으려고 시도했지만 둘 다 도움이 되지 않았습니다. 창문을 닫아도 되지만 불안해요.

추가 정보 요청

  1. 에 의한 결과
sudo dmidecode -s bios-version

~이다

8GET38WW (1.15 )
  1. 에 의한 결과
sudo dmidecode -t 0 | grep UEFI

아무것도 아니다. (지원되지 않는다는 뜻인 것 같습니다.)

  1. 에 의한 결과
cpuid | less

~이다

bash: cpuid: command not found

제가 말할 수 있는 것은 Lenovo Thinkpad L520이고 리퍼브 제품이며 CPU를 변경하지 않았다는 것뿐입니다. (이전 주인은 어떤지 모르겠습니다.)

  1. 에 의한 결과
sudo parted --list

~이다

Model: ATA ADATA SU630 (scsi)
Disk /dev/sda: 240GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End    Size    Type     File system     Flags
 1      1049kB  231GB  231GB   primary  ext4            boot
 2      231GB   240GB  9449MB  primary  linux-swap(v1)

fstype또는 에 대해서는 아무것도 볼 수 없습니다 gpt.

내가 말했듯이, 나는 그것을 지워진 디스크에 설치하려고 시도했습니다.

시간 내 주셔서 감사합니다!

답변1

오류 축소

걱정하기 전에 주의가 필요한 것들이 많이 보입니다.grub

  1. 최소 26개의 패키지를 제거해야 합니다.
  2. 174개의 패키지를 업그레이드해야 합니다.
  3. Grub은 oldfred의 의견에서 알 수 있듯이 약간의 조사와 가능한 수정이 필요합니다.

두 번 수정해야 하는 상황을 방지하려면 작은 단계(1과 2)를 제거해야 합니다 grub. 이러한 유형의 답변은 두 가지 이유로 내가 좋아하는 것입니다.

  1. 저는 새로운 Linux 사용자가 Linux에서 재부팅하는 것이 Windows에서 재부팅하는 것과는 방식이 다르다는 점을 이해하도록 도울 수 있습니다.
  2. 새로운 Linux 사용자로서 저는 OP가 제가 여기서 하는 것처럼 그의 지식을 전수해주기를 바랍니다.

작은 것부터 먼저

출력 스니펫만 보면 패키지 관리자가 APT라는 것을 알 수 있습니다.고급 패키징 도구. 필요한 경우에는 사용해 보세요 mam apt.

  1. apt update && apt autoremove- 위의 26 in 1을 제거해야 합니다.
  2. apt upgrade- 2에 명시된 174개의 패키지(포함 가능 grub)를 다운로드하고 설치해야 합니다. 인터넷 연결 상태에 따라 다소 시간이 걸릴 수 있습니다.

메모:OP가 질문에 붙여넣은 것과 동일한 오류로 인해 업그레이드가 중단될 수 있습니다. 나는 그것을 기대하지만, 우리는 174개 패키지 세트가 가능한 한 많이 업그레이드되기를 원합니다. 업그레이드가 중단되면 계속 진행하세요. 코끼리 이후에 2단계를 반복하세요.

그리고 지금 방 안의 코끼리

Oldfred, 그는 나이가 많지만 그가 옳습니다.

grub-install: warning: File system `ext2' doesn't support embedding.
grub-install: warning: Embedding is not possible.  GRUB can only be installed in this setup by using blocklists.  However, blocklists are UNRELIABLE and their use is discouraged..

어떤 유형의 설치를 안정적으로 결정하려면 grub특별한 순서 없이 몇 가지 사항이 필요합니다.

  • BIOS/UEFI 버전:sudo dmidecode -s bios-version
  • UEFI가 켜져 있거나 지원됩니까?sudo dmidecode -t 0 | grep UEFI
  • 귀하의 CPU:cpuid | less
  • 파티션 목록 및 테이블 유형:sudo parted --list

작동 하려면 grub-efi-amd64FAT32의 ESP/EFI 파티션 유형과 64비트 CPU가 있어야 합니다. 글머리 기호 3은 다음과 같이 검색할 수 있습니다. 제품군 X 모델 Y CPU는 64비트입니다. 여기서 X와 Y는 제품군 및 모델 행의 정수입니다. 글머리 기호 4에는 EFI 파티션 출력 fstype: fat32과 테이블 유형이 포함되어야 합니다 gpt. 글머리 기호 2에는 '지원됨'이 포함되어야 합니다.

앞서 인용한 오류를 보면 설치 프로그램이 ext2. OP가 설치에 전체 디스크를 사용한 경우 grub전체 디스크를 사용하여 다시 설치해야 합니다. 이 옵션은 EFI 여부에 관계없이 작동합니다. EFI 파티션이 있는 경우 grub해당 파티션에만 다시 설치해야 합니다. 질문에 위 4개 항목의 출력을 추가해 주시면 적절한 명령으로 이 답변을 업데이트하겠습니다.


업데이트

OP가 제공한 업데이트를 기반으로 이것이 적절한 grub 아키텍처라고 안전하게 말할 것입니다 dmidecode. OP가 설치만 선택했기 때문에partedgrub-pc와트OS머신에서 다음을 grub사용하여 전체 HDD의 부트 섹터에 안전하게 포함할 수 있습니다.

sudo grub-install /dev/sda && sudo update-grub

sudo reboot

다시 시작한 후 다음을 계속하십시오. 다시 업그레이드해야 하는 apt update && apt-upgrade 경우 grub각 업그레이드마다 위의 명령을 실행하십시오. (약 15년 ​​동안 다양한 Linux 배포판을 사용하면서 업그레이드한 grub횟수는 10회 미만인 것 같습니다. 업그레이드하는 것은 그리 흔한 패키지가 아닙니다.내 생각에는).

노트: 명령에서 파티션 번호를 생략함으로써 grub-installgrub에 전체 디스크를 포함하는 것이 허용된다고 알렸습니다.

실패하는 경우 update-grub(순서대로 발행):

  • sudo grub-install /dev/sda
  • sudo grub-mkconfig -o /boot/grub/grub.cfg
  • sudo reboot

관련 정보