Linux system boot failure ug GRUB repair: command-line recovery guide¶
Ang kapakyasan sa boot sa Linux system makapahunong sa mga workstation, production server, ug dual-boot laptops nga walay pasidaan, nga makahulog kanimo sa usa ka grabe. grub rescue> dali, usa ka gamay grub> kabhang, usa (initramfs) o dracut:/# emergency console, usa ka systemd "You are in emergency mode" pagmentinar prompt, o usa ka itom nga screen uban sa usa ka blinking cursor.
Dili sama sa mga operating system nga nagtago sa startup mechanics luyo sa opaque graphical error codes, ang Linux nagbutyag sa matag yugto sa boot pipeline direkta ngadto sa administrator. Hapit matag Linux boot failure naggikan sa usa sa lima ka fixable root cause: usa ka overwritten o misconfigured GRUB 2 bootloader (kasagarang ma-trigger human sa Windows update sa dual-boot PC), usa ka hugaw. ext4/xfs/btrfs root filesystem human sa kalit nga pagkawala sa kuryente, usa ka naguba /etc/fstab disk UUID entry, usa ka 100-porsiyento nga bug-os nga gamut (/) storage partition, o usa ka nabalda nga kernel ug graphics driver upgrade. Ang pagpares sa imong eksaktong on-screen prompt ngadto sa katugbang nga boot stage makapahimo kanimo sa pag-ayo sa sistema nga limpyo nga walay pag-format sa imong drive o pagkawala sa imong data.
Buhata kini karon¶
Kung ang imong Linux computer o server nagdumili sa pag-boot, sunda kini nga unom ka dayon nga diagnostic ug safety nga mga lakang sa dili pa magpadagan sa bisan unsang makadaot nga mga sugo sa disk:
- Basaha ang eksaktong prompt sa imong screen aron mahibal-an kung unsang yugto sa boot ang napakyas:
grub rescue>ogrub>: Ang motherboard nga UEFI/BIOS nagkarga sa unang yugto sa GRUB, apan ang GRUB dili makapangita/boot/grubo ang configuration file niini (grub.cfg).(initramfs)odracut:/#: Gikarga sa GRUB ang Linux kernel ug ang inisyal nga RAM disk fine, apan ang kernel dili maka-mount sa imong main root (/) filesystem (kasagaran tungod kayfsckkinahanglan nga ayohon ang usa ka hugaw nga disk).You are in emergency mode / Give root password for maintenance: Ang root filesystem gi-mount, apansystemdnapakyas sa pag-mount sa usa ka ikaduha nga drive nga gilista sa/etc/fstab.- Itom nga screen nga adunay nagkidlap nga cursor pagkahuman sa GRUB menu: Ang operating system nag-boot, apan ang graphical Display Manager (GDM, SDDM, LightDM) napakyas tungod sa usa ka 100% nga tibuuk nga root disk o usa ka guba nga drayber sa Nvidia/AMD GPU.
- Sulayi ang pag-boot sa miaging Linux kernel gikan sa GRUB menu una: I-reboot ang makina ug kupti ang Shift (BIOS) o i-tap ang Esc balik-balik nga (UEFI) pagkahuman sa logo sa tiggama aron mapadayag ang GRUB menu. Pilia ang "Advanced nga mga kapilian alang sa Ubuntu / Debian / Fedora" ug pilia ang ikaduha nga labing karaan nga kernel sa lista. Kung ang bag-o nga pag-update sa kernel nakaguba sa imong
initramfso GPU module, ang miaging kernel mo-boot diretso sa imong desktop sa 10 segundos. - Pagbalhin sa usa ka virtual nga TTY text console kung na-stuck sa itom nga screen: Kung ang boot sequence nag-freeze sa itom nga screen nga adunay nagkidlap nga underscore o nag-stuck nga splash logo, pindota ang
Ctrl + Alt + F3(oCtrl + Alt + F2pinaagi saF6). Kung alogin:text prompt makita, ang imong Linux system aktuwal nga nagdagan, log in gamit ang imong username ug password aron limpyohan ang tibuok disk space o ayuhon ang mga driver sa graphics. - Ayaw pagdagan
fscksa usa ka partisyon nga karon gi-mount read-write: Nagdaganfscksa usa ka buhi, read-write mounted filesystem makadaot sa bukas nga inode tables ug makaguba sa mga file. Dagan langfsckgikan sa(initramfs)shell (diin ang gamut wala ma-mount), sa usa ka read-only mount, o gikan sa usa ka Live USB stick. - I-unplug ang tanang dili importante nga external USB hard drive ug SD card: Usa ka pakyas nga external USB drive nga gilista sa
/etc/fstabo ang pagkuha sa prayoridad sa boot sa BIOS mohunong sa pagkasunod-sunod sa boot. I-unplug ang mga external drive ug i-reboot aron masulayan. - Pag-andam ug usa ka Live Linux USB stick kung ang GRUB o ang kernel hingpit nga nawala: Paghupot ug usa ka bootable nga Live USB flash drive (Ubuntu, Linux Mint, Fedora, o SystemRescue) nga magamit aron imong ma-mount ang imong na-encrypt o standard nga mga partisyon ug makadagan ug
chrootpag-ayo sa bootloader.
Kritikal: Unsa ang DILI buhaton
Ayaw gayud pagdagan grub-install, dd, fdisk, o mkfs hangtod nga imong napamatud-an ang imong eksaktong disk ug partition layout gamit lsblk -f o blkid. Mga ngalan sa node sa device sama sa /dev/sda ug /dev/sdb dinamikong gi-assign sa Linux kernel sa boot ug mahimong mag-swap order kung ang usa ka Live USB stick gisaksak. Aksidenteng pag-format o pag-overwrite sa partition table sa sayop /dev/sdX Ang drive makaguba sa imong data. Dugang pa, ayaw pagdagan ang mga gamit sa pag-ayo sa filesystem sama sa fsck sa mga partisyon nga gi-mount read-write, ayaw pugsa-pagpatay ang usa ka sistema sa panahon sa usa ka aktibo nga kernel o bootloader nga pag-upgrade sa package, ug ayaw pagtangtang sa mga librarya sa sistema sa /usr/lib o /lib sa pagsulay sa paghawan sa luna sa usa ka bug-os nga gamut drive.
Desisyon nga kahoy: pag-diagnose sa 5 nga Linux boot failure stages¶
Gamita kini nga diagnostic flowchart aron masubay ang imong eksaktong output sa screen ngadto sa katugbang nga command-line fix:
flowchart TD
A["Ang Sistema sa Linux Napakyas sa Pag-boot sa Desktop / Login"] --> B{"Unsa ang gipakita sa screen?"}
B -->|"grub rescue> o grub> prompt"| C["Stage 1 Failure: Gamita ang ls aron pangitaon ang /boot/grub, itakda ang root & prefix, boot OS, unya pagdagan ang grub-install"]
B -->|"BusyBox (initramfs) o dracut:/# shell"| D["Stage 2 Failure: Ilha ang root partition nga adunay blkid ug run fsck -y /dev/partition"]
B -->|"Emergency Mode: Ihatag ang root password para sa maintenance"| E["Stage 3 nga Kapakyasan: Pagdalagan ang mount -o remount,rw / ug ayuhon o ikomento ang naguba nga UUID sa /etc/fstab"]
B -->|"Itom nga screen o nagkidlap nga cursor pagkahuman sa GRUB"| F["Stage 4 Failure: Pindota ang Ctrl+Alt+F3 (o boot emergency.target) para malimpyo ang 100% full disk o GPU driver"]
B -->|"Nag-boot diretso sa Windows o 'Wala'y Bootable Device'"| G["UEFI/EFI Boot Order Gipahiran: Boot Live USB, mount Root + EFI, chroot, ug i-install pag-usab ang GRUB"]
Pagtandi sa Linux boot failure prompts, mga hinungdan, ug mga sugo¶
| Sa-Screen Error / Pag-aghat | Naabot na ang Boot Stage | Panguna nga Root Cause | Pinakapaspas nga Pag-ayo nga Pagkasunod-sunod sa Sugo |
|---|---|---|---|
error: no such partition / grub rescue> |
Yugto 1 (GRUB Core) | Ang mga partisyon sa disk gibag-o, gi-clone, o giusab ang UUID; Dili makit-an ang GRUB /boot/grub/normal.mod. |
ls -> set root=(hdX,gptY) -> set prefix=(hdX,gptY)/boot/grub -> insmod normal -> normal |
grub> (Standard GRUB CLI) |
Stage 1.5 (GRUB Normal) | /boot/grub/grub.cfg nawala o natangtang, bisan kung ang mga module sa GRUB maayo nga gikarga. |
set root=(hdX,gptY) -> linux /boot/vmlinuz-... root=/dev/nvme0n1p2 -> initrd /boot/initrd.img-... -> boot |
BusyBox (initramfs)o dracut:/# |
Yugto 2 (Kernel + Initramfs) | Mahugaw nga power-off nahabilin ext4/xfs gamut journal hugaw, nagkinahanglan manwal fsck pagtugot. |
blkid -> fsck -y /dev/nvme0n1p2 (o xfs_repair -L alang sa XFS) -> reboot -f |
You are in emergency mode(sulogin dayon) |
Yugto 3 (systemd Mga bukid) |
Secondary drive o swap partition sa /etc/fstab gi-unplug, gi-reformat, o nadaot. |
Pagsulod sa root password -> mount -o remount,rw / -> nano /etc/fstab (idugang nofail o #) -> systemctl daemon-reload -> reboot |
[FAILED] Failed to start GNOME Display Manager / Nagkidlap Cursor |
Yugto 4 (Display Manager / GUI) | Root partition / kay 100% puno (0 bytes libre para sa /tmp o Xorg sockets) O guba nga Nvidia kernel module (dkms). |
Press Ctrl+Alt+F3 -> df -h -> journalctl --vacuum-size=100M & apt clean O ubuntu-drivers autoinstall |
Scenario 1: Pag-ikyas sa grub rescue> o grub> prompt nga walay USB stick¶
Kung ang imong screen nagpakita error: unknown filesystem, error: no such partition, o Minimal BASH-like line editing is supported gisundan sa grub rescue> o grub>, ang imong pag-instalar sa Linux ug personal nga mga file kasagarang naglingkod nga wala sa imong SSD o hard drive, ang GRUB nawad-an na lang og track kung asa nga partition ang gihuptan. /boot/grub. Mahimo ka nga mag-boot direkta sa imong na-install nga OS gikan sa kini nga prompt sa 2 minuto:
Case A: Naa ka sa grub rescue> aghat¶
Sa grub rescue>, upat lang ka sukaranang mga sugo ang nagtrabaho (ls, set, unset, ug insmod). Sunda kini nga mga lakang pag-ayo:
- Ilista ang tanang mga disk ug partisyon nga makita sa motherboard firmware:
Ang GRUB mag-imprinta og linya sama sa:
(hd0) (hd0,gpt1) (hd0,gpt2) (hd0,gpt3)(o(hd0,msdos1)sa mas daan nga MBR disks). - ** Susiha ang matag partisyon hangtod makita nimo ang imong Linux root (o
/boot) direktoryo**: (Hinumdomi nga iapil ang trailing slash/sa katapusan sa matag usalssusiha aron ilista sa GRUB ang mga filename sa sulod sa partisyon): - Kung
(hd0,gpt1)/nagpakitaefi/, kana ang imong gamay nga FAT32 EFI System Partition. - Sa diha nga ang usa ka partition output
boot/ etc/ home/ usr/ var/ vmlinuz initrd.img, nakit-an nimo ang imong panguna nga partisyon sa ugat sa Linux (pananglitan,(hd0,gpt2)). (Note: Kung mogamit ka ug Btrfs sa@mga subvolum sa Ubuntu/Fedora,ls (hd0,gpt2)/magpakita@/ @home/, nagpasabot nga ang imong boot folder anaa sa(hd0,gpt2)/@/boot/grub.) - Itudlo ang GRUB sa imong partisyon ug i-load ang
normalmodule: Sa pag-ingon nga ang imong Linux root kay on(hd0,gpt2):(Kung naa kay lahi nga gipahinungodgrub rescue> set root=(hd0,gpt2) grub rescue> set prefix=(hd0,gpt2)/boot/grub grub rescue> insmod normal grub rescue> normal/bootpartisyon sa(hd0,gpt2), gamitaset prefix=(hd0,gpt2)/grubwalay/boot.) - Himoa nga permanente ang pag-ayo sa higayon nga ang imong desktop boots:
Sa diha nga
normalmodagan, ang imong regular nga GRUB menu makita ug mag-boot sa imong Linux system. Importante: KadtosetAng mga sugo temporaryo sa RAM. Sa higayon nga mag-log in ka sa imong Linux desktop, ablihi ang usa ka terminal ug permanente nga isulat ang husto nga lokasyon sa GRUB sa imong drive:
Case B: Naa ka sa standard grub> aghat¶
Kung makakita ka grub> (walay pulong rescue), ang normal module kay load na, pero ang imong grub.cfg menu file nawala o guba. Mahimo nimo nga manwal nga i-boot ang Linux kernel sa upat ka linya gamit ang Tab auto-completion:
grub> set root=(hd0,gpt2)
grub> linux /boot/vmlinuz-6.8.0-45-generic root=/dev/nvme0n1p2 ro
grub> initrd /boot/initrd.img-6.8.0-45-generic
grub> boot
linux /boot/vmlinuz ug pindota ang Tab key, ang GRUB mo-auto-complete sa eksaktong kernel version numbers nga na-install sa imong disk.) Sa higayon nga ma-boot sa imong OS, run sudo update-grub (Debian/Ubuntu) o sudo grub2-mkconfig -o /boot/grub2/grub.cfg (Fedora/RHEL) aron mabag-o ang nawala nga file sa menu.
Scenario 2: Pag-ayo (initramfs) o dracut mga kabhang nga adunay fsck¶
Kung ang imong PC moagi sa GRUB menu, ipakita ang Linux boot splash sulod sa pipila ka segundo, ug dayon ihulog sa itom nga teksto nga prompt nga pagbasa:
BusyBox v1.36.1 (Ubuntu) built-in shell (ash)
Enter 'help' for a list of built-in commands.
(initramfs) _
(initramfs) aghat. Siyam ka beses sa napulo, imong makita:
The root filesystem on /dev/nvme0n1p2 requires a manual fsck
Sunod-sunod nga pag-ayo sa filesystem gikan sa (initramfs)¶
- Kumpirma kung unsang partisyon ang kinahanglan ayohon: Kung ang ngalan sa partisyon wala maimprinta sa ibabaw mismo sa prompt, i-type
blkidug pindota ang Enter aron ilista ang imongext4,xfs, obtrfsmga partisyon. - Pagdalagan ang katugbang nga himan sa pag-ayo sa filesystem:
- ** Alang sa
ext4/ext3filesystems (default sa Ubuntu, Debian, Mint)**: Ang-yAwtomatikong tubagon sa bandila ang "oo" sa matag dunot nga inode, ilo nga bloke, ug pag-replay sa journal nga prompt imbis nga ipadayon kay500 ka beses. - ** Alang sa
XFSfilesystems (default sa RHEL, AlmaLinux, Rocky Linux, CentOS)**: Estandardfsckwalay gibuhat sa XFS. Sa usa kadracut:/#shell sa usa ka XFS system, pagdagan: (Ipasa lang ang-Lbandera sa zero ang XFS metadata log kungxfs_repairnagdumili sa pagdagan tungod sa usa ka dili mabutang nga hugaw nga troso ug wala ka'y lain nga kapilian). - ** Alang sa
Btrfsfilesystems (default sa Fedora, openSUSE)**: Sulayi una ang paghawan sa Btrfs log tree nga luwas sabtrfs rescue zero-log /dev/nvme0n1p2. Ayaw gayud pagdaganbtrfs check --repairgawas kon gisugo sa usa ka Btrfs developer o human sa pag-back up sa data gikan sa usa ka Live USB, ingon--repairgiisip nga delikado sa Btrfs.
- ** Alang sa
- Exit ug reboot: Kausa
fsckmga imprinta***** FILE SYSTEM WAS MODIFIED *****, tipoexit(oreboot -f) ug pindota ang Enter. Ang imong sistema mag-mount sa limpyo nga partisyon ug mag-boot sa normal.
Scenario 3: Pag-ayo /etc/fstab mga sayop sa systemd Emergency Mode¶
Kung ang imong screen mohunong sa tunga-tunga sa boot sa:
You are in emergency mode. After logging in, type "journalctl -xb" to view system logs,
"systemctl reboot" to reboot, or "exit" to continue bootup.
Give root password for maintenance (or press Control-D to continue):
/etc/fstab, nag-format ug swap partition (nga nag-usab sa UUID niini), o nag-unplug sa sekondaryang internal/external hard drive nga gilista sa /etc/fstab nga wala ang nofail kapilian. Pinaagi sa default, systemd gipahunong ang tibuok operating system nga boot kung adunay bisan unsang disk nga nalista /etc/fstab napakyas sa pagtubag sulod sa 90 segundos.
Unsaon pag-ayo /etc/fstab sa 90 segundos¶
- I-type ang imong root password (o pindota ang Enter kung sa Ubuntu kung diin ang root account gi-lock ug direkta ka nga ihulog; kung giingon sa Ubuntu
Cannot open access to console, the root account is locked, tan-awa anginit=/bin/bashnota sa ubos). - Remount the root filesystem as Read-Write: Sa emergency mode,
/sagad gi-mount Read-Only, mao nga kung mosulay ka sa pagluwas/etc/fstab,nanomoingonError writing /etc/fstab: Read-only file system. Pagdagan kini una: - ** Hibal-i kung unsang linya ang naa
/etc/fstabnabuak**: Daganmount -a. Bisan unsa nga drive ang naguba mo-print dayon og sayup (pananglitan,mount: /mnt/backup: can't find UUID=4a8b...). Mahimo usab nimo itandi ang imong tinuod nga drive UUIDs batok/etc/fstabpinaagi sa pagdagan: - I-edit
/etc/fstabug idugangnofailo komento sa dili maayo nga linya: Ibutang a#sa pagsugod sa nabuak nga sekondaryang drive o swap line aron ma-disable kini (o idugang,nofailngadto sa mount options column sama sadefaults,nofailmao nga ang Linux dili gayud magdumili sa pag-boot kung kana nga external drive wala ma-plug). I-save gamit angCtrl+O, pindota ang Enter, ug paggawas gamit angCtrl+X. - ** I-reload
systemdug verify sa dili pa mag-reboot**: Kungmount -anagbalik sa zero nga mga sayup, tiporebootug limpyo ang imong computer.
Warning
** Unsa kaha kung giingon sa Ubuntu / Debian "Cannot open access to console, the root account is locked" sa Emergency Mode prompt?** Tungod kay gi-disable sa Ubuntu ang root password pinaagi sa default pabor sa sudo, sulogin usahay ma-lock ka sa Emergency Mode kung ang usa ka disk in /etc/fstab napakyas. Aron malaktawan kana nga lock sa 30 segundos: reboot, kupti ang Shift o i-tap ang Esc aron maablihan ang GRUB menu, i-highlight ang Ubuntu, pindota e aron ma-edit ang boot command, pangitaa ang linya nga nagsugod sa linux /boot/vmlinuz..., ilisan ro quiet splash sa katapusan sa linya nga adunay rw init=/bin/bash, ug pindota Ctrl+Xo F10. Nag-bypass kini systemd bug-os ug ihulog ka diretso sa usa ka unlocked # root shell nga adunay read-write access aron makadagan ka nano /etc/fstab.
Scenario 4: Pagbawi gikan sa 100% nga puno nga gamut (/) disk o guba nga drayber sa GPU¶
Kung ang imong PC nagpasa sa GRUB nga hapsay, wala magpakita nga mga sayup sa filesystem, ug dayon nagbitay hangtod sa hangtod sa usa ka itom nga screen nga adunay nagkidlap nga cursor sa taas nga wala nga suok (o magbalikbalik sa screen sa pag-login sa matag higayon nga imong i-type ang imong password ug pindota ang Enter), ang imong partisyon sa gamut (/) hapit na gyud 100% puno. Kanus-a / adunay 0 megabytes nga libre nga wanang, Xorg, Wayland, ug GNOME/KDE dili makahimo og 4-kilobyte session lock file sa /tmp o /var/lib, hinungdan nga ang desktop hilom nga nahagsa.
Giunsa ang libre nga gigabytes nga wanang gikan sa TTY console¶
- Sa black blinking cursor screen (o looping login screen), pindota
Ctrl + Alt + F3(sa mga laptop, tingali kinahanglan nimoCtrl + Alt + Fn + F3) nga mobalhin gikan sa nagyelo nga graphical screen (TTY1/TTY2) ngadto sa purong text terminal (TTY3). - Log in gamit ang imong normal nga username ug password, unya susiha ang paggamit sa disk:
- Kung
Use%nagpakita100%(oAvailnagpakita0), padagana kining upat ka luwas nga mga sugo sa paglimpyo aron mapagawas dayon ang 2 GB ngadto sa 25 GB nga luna:(Kung ang usa ka runaway log file sama sa# 1. Clear downloaded package cache (.deb / .rpm archives sitting in /var/cache): sudo apt-get clean # (Ubuntu/Debian/Mint) # sudo dnf clean all # (Fedora/RHEL) # 2. Shrink bloated systemd system logs down to 100 MB: sudo journalctl --vacuum-size=100M # 3. Remove old unused Linux kernel versions and orphaned packages: sudo apt-get autoremove --purge -y # 4. Find the top 10 largest folders inside /var (e.g., Docker, Snap, or runaway /var/log/syslog): sudo du -xh /var | sort -rh | head -n 15/var/log/syslogo/var/log/ufw.logmi-balloon sa 50 GB, haw-asan dayon kinisudo truncate -s 0 /var/log/syslog.) - Ngano man
df -husahay magpakitaAvail: 0(100% puno) kung 95% ra sa disk ang gigamit? Sa default,ext4nagreserba 5 porsyento sa tibuok partisyon para lamang sarootuser aron ang mga serbisyo sa gamut mahimo gihapon nga modagan kung ang usa ka normal nga tiggamit mopuno sa disk. Sa usa ka 1-terabyte SSD, ang 5% usa ka dako nga 50 GB nga gi-hostage. Mahimo nimong bawion dayon ang 40+ GB nianang gireserba nga buffer para sa imong normal nga user account pinaagi sa pagpadagan: - Kausa
df -h /nagpakita sa pipila ka gigabytes nga anaa, runsudo rebootug ang imong graphical nga desktop mo-log in nga normal.
Unsa kaha kung df -h adunay daghang libre nga wanang, ug nagsugod ang itom nga screen pagkahuman sa usa ka drayber sa Nvidia o pag-update sa kernel?¶
Kung ang imong disk dili puno ug ang itom nga screen nagsugod dayon pagkahuman sa pag-update sa usa ka PC nga adunay Nvidia graphics card, ang Nvidia proprietary kernel module (nvidia.ko) napakyas sa pag-compile pinaagi sa dkms para sa imong bag-ong kernel, o gibabagan sa Secure Boot ang wala pirmahang module:
- Gikan sa
Ctrl + Alt + F3TTY console, susiha kung ang driver module gikarga pinaagi sa pagdagannvidia-smi. - Kung
nvidia-sminag-ingonNVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver, mahimong i-disable ang Secure Boot sulod sa imong motherboard UEFI/BIOS settings (kung ang Secure Boot nagbabag sa wala pirmahi nga DKMS module), o pagtukod pag-usab sa kernel header ug driver:
Scenario 5: Kompletoha ang Live USB chroot pagluwas (alang sa gipahiran nga EFI/GRUB, LVM, LUKS, ug Btrfs)¶
Kung ang usa ka Windows 11 nga pag-update mo-overwrite sa imong UEFI boot entries, usa ka kernel update nahagsa sa tunga-tunga sa paglupad samtang ang kuryente nawala, o grub rescue> dili mabasa ang imong partition, i-boot ang imong computer gikan sa Live Linux USB drive (pagpili "Sulayi ang Ubuntu" o live desktop mode) ug ipahigayon ang chroot (Usba ang Root) pag-ayo. A chroot tugoti ang imong Live USB terminal nga lakang sa sulod sa imong naguba nga pag-instalar ug pagdagan sa SSD apt, dnf, update-initramfs, ug grub-install ingon nga ang sistema nag-boot sa normal.
Lakang 1: Ilha ug ablihan ang imong storage layout (lsblk -f)¶
Ablihi ang usa ka terminal sa sulod sa Live USB desktop ug pagdagan:
Tan-awa angFSTYPE kolum aron makita kung hain sa upat ka sagad nga mga arkitektura sa pagtipig nga gigamit sa imong pag-install sa Linux, ug i-mount kini /mnt gamit ang matching block sa ubos:
- Kaso 1: Sumbanan
ext4oxfspartition (pananglitan, Root is/dev/nvme0n1p2ug ang EFI/dev/nvme0n1p1): - Kaso 2: Naka-encrypt nga partisyon sa ugat sa LUKS (
crypto_LUKS) (default sa dihang ang "I-encrypt ang akong disk" gisusi atol sa pag-instalar): Kinahanglan nimo nga i-decrypt una ang sudlanan sa LUKS sa dili pa i-mount:sudo cryptsetup luksOpen /dev/nvme0n1p3 cryptroot sudo vgchange -ay # Activates LVM volumes inside LUKS if used sudo mount /dev/mapper/cryptroot /mnt # (Or /dev/mapper/ubuntu--vg-ubuntu--lv) sudo mount /dev/nvme0n1p2 /mnt/boot # Mount separate unencrypted /boot partition sudo mount /dev/nvme0n1p1 /mnt/boot/efi # Mount FAT32 EFI partition - Kaso 3: Btrfs filesystem nga adunay
@subvolumes (default sa Fedora, openSUSE, ug Ubuntu Btrfs installs): Kung nag-mount ka usa ka partisyon sa Btrfs nga wala’y pagpihosubvol=@,/mntmagpakita ra@ug@homemga folder imbes nga/binug/etc, ugchroot /mntmapakyas safailed to run command '/bin/bash': No such file or directory. I-mount ang@subvolume nga klaro:
Lakang 2: Ibugkos ang mga virtual kernel filesystem (lakip ang UEFI efivars) ug mosulod chroot¶
Kay grub-install ug apt (DNS internet access) aron magtrabaho sa sulod chroot, i-bind-mount ang Live USB's virtual kernel directories ug UEFI NVRAM variables ngadto sa /mnt:
# Bind-mount virtual device, process, sysfs, run (for DNS resolv.conf), and UEFI variables:
for dir in /dev /dev/pts /proc /sys /sys/firmware/efi/efivars /run; do
sudo mount --bind $dir /mnt$dir
done
# Step inside your installed Linux system:
sudo chroot /mnt /bin/bash
Lakang 3: Pag-ayo sa mga pakete, pagtukod pag-usab initramfs, ug i-install pag-usab ang GRUB sa sulod chroot¶
Karon nga ang imong prompt nagpakita root@ubuntu:/#, padagana ang mga sugo sa pag-ayo alang sa imong pag-apod-apod:
# 1. Fix any half-installed kernel upgrades (Ubuntu/Debian):
dpkg --configure -a
apt-get install -f -y
# 2. Rebuild the initial ramdisk for all installed kernels:
update-initramfs -c -k all # (Debian / Ubuntu / Mint)
# dracut --regenerate-all --force # (Fedora / RHEL / Rocky)
# mkinitcpio -P # (Arch / Manjaro)
# 3. Reinstall GRUB to the EFI System Partition and regenerate grub.cfg:
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB --recheck
update-grub # (Or: grub2-mkconfig -o /boot/grub2/grub.cfg on Fedora)
Lakang 4: Paggawas nga limpyo ug pag-reboot¶
I-unplug ang Live USB drive kung gihangyo. Ang imong sistema mo-boot diretso sa imong giayo nga GRUB menu ug Linux desktop.Mga sumbanan sa negosyo sa rehiyon, pagsunod sa data center, ug sertipikasyon sa hardware¶
Ang pagdumala sa bootloader sa Enterprise Linux ug seguridad sa firmware gipailalom sa higpit nga nasudnong mga sumbanan ug mga framework sa cybersecurity:
- Estados Unidos: Ang imprastraktura sa gobyerno ug negosyo nagsunod sa National Institute of Standards and Technology (NIST) Special Publication 800-147B (BIOS Protection Guidelines for Servers) ug SP 800-193 (Platform Firmware Resiliency Guidelines). Ang mga pederal nga instalasyon nga nag-operate sa Red Hat Enterprise Linux (RHEL) o Rocky Linux kinahanglang mosunod sa Defense Information Systems Agency (DISA) Security Technical Implementation Guides (STIGs). Kini nga mga sumbanan nanginahanglan proteksyon sa password sa GRUB 2 boot menus, pag-disable sa interactive kernel parameter editing, pagpagana sa UEFI Secure Boot with Shim first-stage loaders, ug pag-encrypt sa root storage gamit ang FIPS 140-⅔ validated LUKS cryptographic modules.
- United Kingdom: Ang National Cyber Security Center (NCSC) nagpatik sa giya sa seguridad sa device para sa mga platform sa Linux sa negosyo, nga nagmando sa hardware-rooted nga integridad sa plataporma. Ang mga sistema nga gipakatap sa tibuok gobyerno o kritikal nga nasudnong imprastraktura kinahanglang mogamit ug Trusted Platform Module (TPM 2.0) nga mga pagsukod aron ma-seal ang LUKS disk encryption keys batok sa Platform Configuration Registers (PCRs), pagsiguro nga ang drive awtomatikong ma-unlock lamang kung ang UEFI firmware, Secure Boot keys, ug GRUB binary magpabilin nga hingpit nga wala mausab.
- European Union: Sa European Union, ang Federal Office for Information Security sa Germany (BSI) nagtukod og baseline security pinaagi sa IT-Grundschutz building block SYS.1.3 (Server Linux ug Unix). Ang mga giya sa BSI nanginahanglan estrikto nga pagbulag sa mga partisyon sa boot, dili mabag-o nga mga pag-configure sa bootloader, ug gi-audit nga mga pamaagi sa pagpadayon. Ubos sa EU Network and Information Security Directive (NIS 2), ang mga entidad nga nag-operate sa hinungdanon nga mga serbisyo sa digital kinahanglan nga magpadayon sa balido nga bare-metal nga mga pamaagi sa pagbawi sa katalagman aron matagbaw ang Mga Tumong sa Oras sa Pagbawi (RTO) sa panahon sa mga kapakyasan sa operating system.
- Canada: Ang Canadian Center for Cyber Security (CCCS) naghatag ug giya ubos sa ITSG-33 (IT Security Risk Management), nga nagpiho sa mga kontrol alang sa enterprise Linux operating environment. Isip pagsunod sa Personal nga Impormasyon sa Proteksyon ug Electronic Documents Act (PIPEDA), ang mga hard drive sa pisikal nga server nga gipailalom sa pagbawi sa bootloader o pagpuli sa controller kinahanglan mogamit sa hardware o volume-level encryption aron mapugngan ang pagkaladlad sa datos sa panahon sa pagserbisyo.
- Australia: Ang Australian Signals Directorate (ASD) nagpatik sa Information Security Manual (ISM), nga nagtakda sa mga kinahanglanon alang sa mga sistema sa Linux sa negosyo. Ang ISM nagmando nga ang mga organisasyon ipatuman ang UEFI Secure Boot, protektahan ang mga configuration sa bootloader batok sa dili tinuod nga mga pagbag-o, ug i-log ang emergency maintenance shell access ngadto sa sentralisadong audit repository aron mapadayon ang pagsunod sa Essential Eight nga mga estratehiya sa pagpaminus.
Kanunay nga gipangutana nga mga pangutana¶
Why did my dual-boot Linux GRUB menu disappear after a Windows 10 or Windows 11 update?
Major Windows feature updates frequently reset the motherboard's UEFI NVRAM boot priority order, placing "Windows Boot Manager" back at #1 above "ubuntu" or "fedora" without actually deleting your Linux files. Before booting a Live USB, first enter your motherboard BIOS/UEFI settings at startup (press `F2`, `F12`, or `Del`) and check the **Boot Order / UEFI Boot Priority** list, often you can simply move `ubuntu` or `GRUB` back above `Windows Boot Manager`, save with `F10`, and your GRUB menu returns immediately. You can also run `bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi` inside an Administrator Command Prompt in Windows to restore GRUB without a USB stick.
Why does `chroot /mnt` say `failed to run command '/bin/bash': No such file or directory` when I try to rescue my system?
This error happens for one of three reasons: (1) You accidentally mounted your small `/boot` or `EFI` partition to `/mnt` instead of your main Linux root partition (verify with `ls /mnt`, you should see `bin`, `etc`, `usr`, and `var`); (2) your system uses the **Btrfs** filesystem with subvolumes, so `ls /mnt` only shows `@` and `@home`, unmount `/mnt` and remount with `sudo mount -o subvol=@ /dev/nvme0n1p2 /mnt` (or `subvol=root` on Fedora); or (3) you accidentally booted a 32-bit Live USB stick while trying to `chroot` into a 64-bit (`x86_64`) Linux installation.
What does the kernel panic message `VFS: Unable to mount root fs on unknown-block(0,0)` mean at boot?
This kernel panic means the Linux kernel started without a valid `initramfs` (initial RAM disk) image, usually because a system update was interrupted while generating `/boot/initrd.img-...` or because your `/boot` partition ran out of space during a kernel upgrade. Reboot, hold `Shift` or tap `Esc` to open the GRUB menu, select **"Advanced options"**, and boot into the previous older kernel listed right below the newest one. Once logged into your desktop on the older kernel, free up space in `/boot` with `sudo apt autoremove --purge` and rebuild the broken ramdisk with `sudo update-initramfs -c -k all && sudo update-grub`.
How can I temporarily bypass broken graphics drivers from the GRUB menu using `nomodeset`?
If your monitor turns completely black or loses signal right after the GRUB menu due to a GPU driver problem, reboot and tap `Esc` or hold `Shift` to open the GRUB menu. Highlight your Linux entry and press **`e`** on your keyboard. Use the arrow keys to find the line starting with `linux /boot/vmlinuz...`, move to the end of that line where it says `quiet splash`, and replace `quiet splash` with **`nomodeset`**. Press **`Ctrl + X`** or **`F10`** to boot. The `nomodeset` parameter tells the Linux kernel not to load hardware video drivers until after Xorg starts, using basic BIOS framebuffer graphics so you can see your screen and fix your GPU drivers.
Why did `grub-install` inside `chroot` warn that `EFI variables are not supported on this system`?
That error occurs for one of two reasons: either you accidentally booted your Live USB flash drive in **Legacy BIOS / CSM mode** instead of **UEFI mode** when selecting it in your motherboard's F12 boot menu (check by running `ls /sys/firmware/efi`, if that folder does not exist on the Live USB, reboot and select the `"UEFI: [USB Drive Name]"` entry in your BIOS boot menu), OR you forgot to bind-mount `/sys/firmware/efi/efivars` into `/mnt/sys/firmware/efi/efivars` before running `chroot /mnt`.
How do I prevent a secondary external or internal hard drive in `/etc/fstab` from ever crashing my Linux boot again?
Whenever you add any non-root storage drive (such as a second SSD, a RAID array, an external USB backup drive, or a network Samba/NFS share) to `/etc/fstab`, always include **`nofail,x-systemd.device-timeout=10`** in the fourth column (mount options), and set the sixth column (`pass` / `fsck` order) to **`0`** or **`2`**. With `nofail` enabled, if that drive is ever unplugged or fails, `systemd` waits only 10 seconds, logs a non-fatal warning, and boots normally into your desktop instead of dropping you into Emergency Mode.
Sertipikasyon sa first aid ug kaluwasan sa teknikal nga trabahoan¶
Ang lebel sa hardware nga boot diagnostics kasagarang nagkinahanglan sa pag-abli sa mga kaso sa desktop, pag-ilis sa mga suplay sa kuryente, o pag-inspeksyon sa mga kagamitan sa rack sa server. Ang mga technician nag-atubang sa grabe nga mga peligro sa elektrisidad gikan sa nadaot nga mga kapasitor, mga samad gikan sa hait nga sheet-metal nga mga chassis, ug nadugmok nga mga kadaot gikan sa bug-at nga rack-mounted hardware. Kung mahitabo ang electric shock, idiskonekta dayon ang circuit breaker sa dili pa hikapa ang biktima ug tawagan ang mga serbisyo sa emerhensya. Ang pagkahibalo kung unsaon paghatud sa CPR ug pagdumala sa grabe nga pagdugo o kakurat sama ka kritikal sa usa ka lawak sa server sama sa teknikal nga pag-usisa. Girekomenda namon ang pagkompleto sa usa ka akreditado nga first aid, CPR/AED, ug kurso sa kahimsog ug kaluwasan sa trabahoan pinaagi sa Red Cross, St John Ambulance, o usa ka awtoridad sa kaluwasan sa nasud.
Gisusi ang mga tinubdan¶
- GNU Project / Free Software Foundation (International): Opisyal nga GNU GRUB Manual 2.12 , Pag-boot gikan sa
grub>uggrub rescue>Command Shells (gnu.org/software/grub/manual). - Ang Linux Kernel Archives & Kernel.org (Internasyonal): Kernel Parameters (
admin-guide/kernel-parameters.txt),initramfsSayo nga Userspace, ug Filesystem Administration (docs.kernel.org). - Canonical / Ubuntu Server & Desktop Documentation (United Kingdom / International): GRUB2 Bootloader Recovery, LiveCD Chroot Procedures, ug Disk Space Management (
help.ubuntu.com,ubuntu.com/server/docs). - Red Hat Enterprise Linux (RHEL) & Fedora Project Documentation (Estados Unidos): Pag-troubleshoot sa mga Isyu sa Boot sa
dracut,xfs_repair, uggrub2-mkconfig(docs.redhat.com,docs.fedoraproject.org). - Arch Linux Wiki (Internasyonal): GRUB, Chroot,
fstab, ugmkinitcpioTeknikal nga Reperensya (wiki.archlinux.org). - Freedesktop.org / systemd Documentation (Internasyonal):
systemd.unitMga Target sa Emergency ug Rescue,journalctlPag-vacuum, ugsystemd.mountMga kapilian (freedesktop.org/software/systemd/man).