Skip to content

Go palelwa ke go simolola ga tsamaiso ya Linux le go baakanngwa ga GRUB: kaelo ya go boela mo mannong ya mola wa taelo

Go palelwa ke go simolola tsamaiso ya Linux go ka emisa diteišene tsa tiro, disefara tsa tlhagiso, le di-laptop tse di simololang gabedi kwantle ga tlhagiso, ga go latlhela mo kotsing e e masisi . grub rescue> tlhotlheletso, bonnye grub> kgapetla (initramfs) kgotsa dracut:/# khonsole ya tshoganyetso, tsamaiso "You are in emergency mode" tlhagiso ya tlhokomelo, kgotsa sekerini se sentsho se se nang le sesupo se se panyapanyang.

Ho fapana le dithulaganyo tsa tshebetso tse patang bomakhenikhi ba ho qala ka morao ho dikhoutu tsa phoso tsa dikerafo tse sa bonahaleng, Linux e pepesa kgato e nngwe le e nngwe ya peipi ya ho qala ka kotloloho ho motsamaisi. Mo e ka nnang go palelwa gongwe le gongwe ga go simolola ga Linux go tswa mo go nngwe ya dilo tse tlhano tse di ka baakanngwang: bootloader ya GRUB 2 e e kwadilweng godimo kgotsa e e sa rulaganngwang sentle (e gantsi e tlhotlhelediwang morago ga go tlhabololwa ga Windows mo PC e e nang le di-boot tse pedi), bootloader e e leswe . ext4/xfs/btrfs root filesystem morago ga go kgaoga ga motlakase ka tshoganyetso, go robega /etc/fstab tsenyo ya UUID ya disiki, modi o o tletseng wa diperesente di le 100 (/) karoganyo ya polokelo, kgotsa tlhabololo ya mokgweetsi wa kernel le dikerafiki e e kgaogileng. Go tshwantshanya tlhagiso ya gago e e tlhomameng e e mo sekirining le kgato e e tsamaelanang ya go simolola go go letla go baakanya tsamaiso ka phepafalo kwantle ga go fometa polatefomo ya gago kgotsa go latlhegelwa ke tshedimosetso ya gago.

Dira se jaanong

Fa khomphutha ya gago ya Linux kgotsa sefara e gana go simolola, latela dikgato tseno tse thataro tsa go tlhatlhoba le pabalesego ka bonako pele ga o dirisa ditaelo dipe tse di senyang tsa disiki:

  1. Buisa tlhagiso e e mo sekirining sa gago go bona gore ke kgato efe ya go simolola e e paletsweng:
    • grub rescue> kgotsa grub>: UEFI/BIOS ya boto ya mme e laisitse kgato ya ntlha ya GRUB, mme GRUB ga e kgone go bona /boot/grub kgotsa faele ya yone ya thulaganyo (grub.cfg).
    • (initramfs) kgotsa dracut:/#: GRUB e laisitse kernel ya Linux le disiki ya RAM ya ntlha sentle, mme kernel ga e a kgona go tsenya modi wa gago o mogolo (/) tsamaiso ya difaele (gantsi ka gonne fsck tlhoka go baakanya disiki e e leswe).
    • You are in emergency mode / Give root password for maintenance: Tsamaiso ya difaele tsa modi e tsentswe, mme systemd e paletswe ke go tsenya polatefomo ya bobedi e e mo lenaaneng la /etc/fstab.
    • Skrini se setsho se nang le sesupo se panyapanyang kamora menyu wa GRUB: Tsamaiso ya tshebetso e ile ya qala, empa Molaodi wa Pontsho wa kerafo (GDM, SDDM, LightDM) o ile a hloleha ka lebaka la disiki ya motso e felletseng ya 100% kapa mokganni wa Nvidia / AMD GPU ya robehileng.
  2. Leka go simolola kernel ya Linux e e fetileng go tswa mo menyung wa GRUB pele: Simolola motšhini gape mme o tshware Shift (BIOS) kgotsa o tobetse Esc kgapetsakgapetsa (UEFI) fela morago ga letshwao la motlhagisi go senola menyu wa GRUB. Tlhopha "Ditlhopho tse di tsweletseng tsa Ubuntu / Debian / Fedora" mme o tlhophe kernel ya bobedi ya bogologolo mo lenaaneng. Fa ntšhwafatso ya kernel ya bosheng e thubile initramfs kgotsa mojule wa GPU, kernel e e fetileng e tla simolola ka tlhamalalo mo khomphuteng ya gago mo metsotswaneng e le 10.
  3. Fetogela kwa khonsoleng ya sekwalwa sa TTY sa mmatota fa e kgomaretse mo sekirining se sentsho: Fa tatelano ya go simolola e gatsetsega mo sekirining se sentsho se se nang le mothalo o o panyapanyang kgotsa letshwao la go phaphasela le le kgomaretseng, tobetsa Ctrl + Alt + F3 (kgotsa Ctrl + Alt + F2 ka F6). Fa login: text prompt e tlhagelela, tsamaiso ya gago ya Linux e a dira tota, tsena ka leina la gago la modirisi le nomoro ya sephiri go phepafatsa sebaka se se tletseng sa disiki kgotsa go baakanya bakgweetsi ba dikerafiki.
  4. O se ka wa taboga fsck mo karoganyong e ga jaana e tsentsweng buisa-kwala: E a dira fsck mo tsamaisong ya faele e e tshelang, e e kwalwang e e tlhomilweng e senya ditafole tse di bulegileng tsa inode le go senya difaele. Taboga fela fsck go tswa go (initramfs) shell (moo motso o sa hlophiswang teng), ho hlophiswa ho bala feela, kapa ho tswa ho Live USB stick.
  5. Tlosa di-hard drive tsotlhe tsa kwa ntle tsa USB tse di seng botlhokwa le dikarata tsa SD: Polaka ya USB ya kwa ntle e e sa direng sentle e e mo lenaaneng la /etc/fstab kgotsa go tsaya botlhokwa jwa go simolola mo BIOS go tla emisa tatelano ya go simolola. Tlosa di-drive tsa kwa ntle mme o simolole gape go leka.
  6. Baakanyetsa thupa ya USB ya Live Linux fa GRUB kgotsa kernel e seyo gotlhelele: Boloka polatefomo ya USB e e kgonang go simolola (Ubuntu, Linux Mint, Fedora, kgotsa SystemRescue) e le gaufi gore o kgone go tsenya dikarolo tsa gago tse di tsenngwang kgotsa tse di tlwaelegileng mme o dirise chroot paakanyo ya bootloader.

Botlhokwa: Se o sa tshwanelang go se dira

Le ka motlha o se ke wa taboga grub-install, dd, fdisk, kgotsa mkfs go fitlha o netefatsa thulaganyo ya gago ya disiki le ya karoganyo o dirisa lsblk -f kgotsa blkid. Maina a dinoutu tsa sediriswa jaaka /dev/sda le /dev/sdb di abelwa ka maatla ke kernel ya Linux fa e simolola mme di ka fetola tatelano fa Live USB stick e tsentswe mo polakeng. /dev/sdX drive e tla senya tshedimosetso ya gago. Mo godimo ga moo, le ka motlha o se ka wa dirisa ditiriso tsa go baakanya tsamaiso ya difaele tse di tshwanang le fsck mo dikarolong tse di tsenngwang go bala-kwala, le ka motlha o se ke wa pateletsa go tima tsamaiso ka nako ya tlhabololo ya sephuthelwana sa kernel kgotsa bootloader se se dirang, mme le ka motlha o se ke wa phimola dilaeborari tsa tsamaiso mo /usr/lib kgotsa /lib ka maiteko a go tlosa sebaka mo polatefomong e e tletseng ya modi.

Setlhare sa ditshwetso: go sekaseka dikgato di le 5 tsa go palelwa ke go simolola ga Linux

Dirisa tšhate eno ya go tlhatlhoba go latedisa dipholo tsa gago tsa sekerini go ya kwa paakanyong e e tshwanang ya mola wa taelo:

flowchart TD
    A["Tsamaiso ya Linux e palelwa ke go Simolola mo Desekethopong / go Tsena"] --> B{"Ke eng se se bontshiwang mo sekirining?"}
    B -->|"grub pholoso> kgotsa grub> potso"| C["Kgato 1 Go palelwa: Dirisa ls go batla /boot/grub, seta modi le ketapele, simolola OS, o bo o dirisa grub-tsenya"]
    B -->|"Lebokoso le le tshwaregileng (di-initramf) kgotsa kgapetla:/#"| D["Kgato 2 Go palelwa: Supa karoganyo ya modi ka blkid mme o dirise fsck -y /dev/karoganyo"]
    B -->|"Mokgwa wa Tshoganyetso: Naya nomoro ya sephiri ya root ya tlhokomelo"| E["Kgato 3 Go palelwa: Tsamaisa thaba -o tlhoma gape,rw / mme o baakanye kgotsa o tshwaele ka UUID e e robegileng mo /etc/fstab"]
    B -->|"Sekerini se sentsho kgotsa sesupo se se panyapanyang morago ga GRUB"| F["Kgato 4 Go palelwa: Tobetsa Ctrl+Alt+F3 (kgotsa go simolola tshoganyetso.target) go phimola 100% ya disiki e e tletseng kgotsa mokgweetsi wa GPU"]
    B -->|"E simolola ka tlhamalalo mo Windows kgotsa 'Ga go na Sediriswa se se Simologang'"| G["Otara ya go Simolola ya UEFI/EFI e phimotswe: Simolola USB e e Tshelang, thaba Modi + EFI, chroot, mme o tsenye GRUB gape"]

Papiso ya dipotso tsa go palelwa ke go simolola ga Linux, dilo tse di bakang, le ditaelo

Phoso ya mo Sekirining / Potso Kgato ya Boot e fitlheletswe Modi wa Motheo Tatelano ya Ditaelo tsa Paakanyo e e Bofefo
error: no such partition / grub rescue> Kgato 1 (Motheo wa GRUB) Dikarolo tsa disiki di fetotswe bogolo, di kopisitswe, kgotsa UUID e fetotswe; GRUB ga e kgone go bona /boot/grub/normal.mod. ls -> set root=(hdX,gptY) -> set prefix=(hdX,gptY)/boot/grub -> insmod normal -> normal
grub> (GRUB CLI e e tlwaelegileng) Kgato 1.5 (GRUB e e Tlwaelegileng) /boot/grub/grub.cfg ga e yo kgotsa e phimotswe, le fa dimmojule tsa GRUB di laisitswe sentle. set root=(hdX,gptY) -> linux /boot/vmlinuz-... root=/dev/nvme0n1p2 -> initrd /boot/initrd.img-... -> boot
BusyBox (initramfs) kgotsa dracut:/# Kgato 2 (Kernel + Di-Initramf) Go tima motlakase go go sa phepa go setse ext4/xfs jenale ya modi e leswe, e tlhoka bukana fsck kamogelo. blkid -> fsck -y /dev/nvme0n1p2 (kgotsa xfs_repair -L ya XFS) -> reboot -f
You are in emergency mode (sulogin tlhotlheletso) Kgato 3 (systemd Dithaba) Mokgweetsi wa bobedi kgotsa karoganyo ya go ananya mo /etc/fstab e ne e ntshitswe mo polakeng, e fometetswe sešwa kgotsa e senyegile. Tsenya nomoro ya sephiri -> mount -o remount,rw / -> nano /etc/fstab (oketsa nofail kgotsa #) -> systemctl daemon-reload -> reboot
[FAILED] Failed to start GNOME Display Manager / Sesupo se se Panyapanyang Kgato 4 (Molaodi wa Pontsho / GUI) Kgaoganyo ya modi / ke 100% e tletse (dibaete di le 0 mahala tsa /tmp kgotsa disokete tsa Xorg) KGOTSA mojulu wa kernel ya Nvidia o o thubegileng (dkms). Tobetsa Ctrl+Alt+F3 -> df -h -> journalctl --vacuum-size=100M & apt clean KGOTSA ubuntu-drivers autoinstall

Boemo 1: Go tshaba grub rescue> kgotsa grub> potso e e senang USB stick

Fa sekerini sa gago se bontsha error: unknown filesystem, error: no such partition, kgotsa Minimal BASH-like line editing is supported e latelwa ke grub rescue> kgotsa grub>, go tsenngwa ga gago ga Linux le difaele tsa gago gantsi di sa ntse di ntse di sa senyega mo SSD kgotsa mo hard drive ya gago, GRUB e latlhegetswe fela ke go itse gore ke karolo efe e e tshotseng . /boot/grub. O ka simolola ka tlhamalalo mo OS ya gago e e tsenngwang go tswa mo tlhagisong eno mo metsotsong e le 2:

Kgetse A: O kwa grub rescue> rotloetsa

Kwa grub rescue>, ke ditaelo di le nne fela tsa motheo tse di dirang (ls, set, unset, le insmod). Latela dikgato tseno ka kelotlhoko:

  1. Lenaane la didisiki tsotlhe le dikarolo tse di bonwang ke serweboleta sa motherboard:
    grub rescue> ls
    
    GRUB e tla gatisa mola o o tshwanang le: (hd0) (hd0,gpt1) (hd0,gpt2) (hd0,gpt3) (kgotsa (hd0,msdos1) mo di-disk tsa bogologolo tsa MBR).
  2. Tlhatlhoba karoganyo nngwe le nngwe go fitlha o bona modi wa gago wa Linux (kgotsa /boot) lenaane: (Gakologelwa go akaretsa mola o o latelang / kwa bokhutlong jwa nngwe le nngwe ls tlhola gore GRUB e kwale lenaane la maina a difaele mo teng ga karolo eo):
    grub rescue> ls (hd0,gpt1)/
    grub rescue> ls (hd0,gpt2)/
    grub rescue> ls (hd0,gpt3)/
    
  3. Fa (hd0,gpt1)/ dipontsho efi/, ke gore Karolo ya Tsamaiso ya gago e nnye ya FAT32 EFI.
  4. Fa karoganyo e ntsha boot/ etc/ home/ usr/ var/ vmlinuz initrd.img, o bone karoganyo ya gago e kgolo ya modi wa Linux (ka sekai, (hd0,gpt2)). (Ela tlhoko: Fa o dirisa Btrfs ka @ dibolumopotlana mo Ubuntu/Fedora, ls (hd0,gpt2)/ e tla bontsha @/ @home/, se se rayang gore foltara ya gago ya go simolola e kwa (hd0,gpt2)/@/boot/grub.)
  5. Supa GRUB kwa karolong ya gago o bo o laisa normal mojule: Fa re tsaya gore modi wa gago wa Linux o tshubilwe (hd0,gpt2):
    grub rescue> set root=(hd0,gpt2)
    grub rescue> set prefix=(hd0,gpt2)/boot/grub
    grub rescue> insmod normal
    grub rescue> normal
    
    (Fa o na le /boot karoganyo mo (hd0,gpt2), dirisa set prefix=(hd0,gpt2)/grub ntle le /boot.)
  6. Dira gore paakanyo e nne ya sennelaruri fa desekethopo ya gago e simolola: Fela fa normal runs, menyu wa gago o o tlwaelegileng wa GRUB o tla tlhagelela mme o simolole tsamaiso ya gago ya Linux. Botlhokwa: Tseo set ditaelo e ne e le tsa nakwana ka RAM. Ka nako ya fa o tsena mo desekethopong ya gago ya Linux, bula theminale mme o kwalele ruri lefelo le le nepagetseng la GRUB mo polatefomong ya gago:
    sudo update-grub
    sudo grub-install /dev/nvme0n1   # (Or /dev/sda ,  use your whole disk name, NOT a partition number)
    

Kgetse B: O mo maemong grub> rotloetsa

Fa o bona grub> (ntle le lefoko rescue), normal mojule o setse o laisitswe, mme wa gago grub.cfg faele ya menyu ga e yo kgotsa e thubegile. O ka simolola kernel ya Linux ka seatla ka mela e le mene o dirisa Go feleletsa ga thebo ka go itirisa:

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
(Tlhabo-botlhale: Thaepa fela linux /boot/vmlinuz mme o tobetse Tab key, GRUB e tla tlatsa ka go itirisa dinomoro tsa mofuta wa kernel tse di tsenngwang mo disekeng ya gago.) Fa e sena go simolola mo OS ya gago, dirisa sudo update-grub (Debian/Ubuntu) kgotsa sudo grub2-mkconfig -o /boot/grub2/grub.cfg (Fedora/RHEL) go tsosolosa faele ya menyu e e tlhaelang.

Boemo 2: Go baakanya (initramfs) kgotsa dracut dikgapetla tse di nang le fsck

Fa PC ya gago e feta menyu wa GRUB, e bontsha go phaphasela ga go simolola ga Linux metsotswana e le mmalwa, mme morago ga moo e bo e wela mo puisong ya mokwalo o montsho:

BusyBox v1.36.1 (Ubuntu) built-in shell (ash)
Enter 'help' for a list of built-in commands.
(initramfs) _
Leba mela e le 3 go ya go e le 5 fa godimo ya (initramfs) tlhotlheletso. Makgetlo a le robongwe mo go a le lesome, o tla bona: The root filesystem on /dev/nvme0n1p2 requires a manual fsck

Kgato ka kgato paakanyo ya tsamaiso ya difaele go tswa go (initramfs)

  1. Tlhomamisa gore ke karoganyo efe e e tlhokang go baakanngwa: Fa leina la karoganyo le sa gatisiwa fela fa godimo ga tlhagiso, thaepa blkid mme o tobetse Tsenya go dira lenaane la gago ext4, xfs, kgotsa btrfs dikarolo.
  2. Dira sedirisiwa sa go baakanya tsamaiso ya difaele se se tshwanang:
    • Go ext4 / ext3 dithulaganyo tsa difaele (ka thulaganyetsoruri mo Ubuntu, Debian, Mint):
      (initramfs) fsck -y /dev/nvme0n1p2
      
      The -y folaga e araba ka itiriso "ee" mo inode nngwe le nngwe e e senyegileng, boloko e e khutsana, le tlhotlheletso ya go tshameka gape ya jenale go na le go dira gore o tobetse y Makgetlo a le 500.
    • Go XFS dithulaganyo tsa difaele (ka thulaganyetsoruri mo RHEL, AlmaLinux, Linux ya Lefika, CentOS): Mokgele fsck ga e dire sepe mo XFS. Mo dracut:/# shell mo tsamaisong ya XFS, dirisa:
      dracut:/# xfs_repair /dev/mapper/rhel-root
      
      (Fata fela -L folaga go lefela pego ya tlhalosoditshedimosetso ya XFS fa xfs_repair e gana go taboga ka ntlha ya kota e e leswe e e sa kgoneng go tlhongwa mme ga o na kgetho e nngwe).
    • Go Btrfs dithulaganyo tsa difaele (ka thulaganyetsoruri mo Fedora, openSUSE): Sa ntlha leka go phimola setlhare sa Btrfs ka pabalesego ka btrfs rescue zero-log /dev/nvme0n1p2. Le ka motlha o se ke wa taboga btrfs check --repair ntle le fa o laetswe ke motlhabolodi wa Btrfs kgotsa morago ga go dira bekapo ya tshedimosetso go tswa mo Live USB, jaaka --repair e tsewa e le kotsi mo Btrfs.
  3. Tswa o bo o simolola gape: Gangwe fsck digatiso ***** FILE SYSTEM WAS MODIFIED *****, mofuta exit (kgotsa reboot -f) o bo o tobetsa Tsenya. Tsamaiso ya gago e tla tlhoma karoganyo e e phepa le go simolola ka tlwaelo.

Boemo 3: Go baakanya /etc/fstab diphoso mo systemd Mokgwa wa Maemo a Tshoganyetso

Fa sekerini sa gago se ema mo gare ga go simolola ka:

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):
Seno se direga ka metlha ka gonne o tselegantse /etc/fstab, e ne ya fometa karolo ya go ananya (e e neng ya fetola UUID ya yone), kgotsa ya ntsha hard drive ya bobedi ya ka fa teng/ya kwa ntle e e mo lenaaneng la . /etc/fstab kwa ntle ga nofail kgetho. Ka thulaganyetsoruri, systemd e emisa go simolola ga tsamaiso yotlhe ya khomphiutha fa e le gore go na le disiki epe e e mo lenaaneng la /etc/fstab e palelwa ke go araba mo metsotswaneng e le 90.

Tsela ya go baakanya /etc/fstab mo metsotswaneng e le 90

  1. Thaepa nomoro ya gago ya sephiri ya modi (kgotsa tobetsa Tsenya fa e le mo Ubuntu kwa akhaonto ya modi e notletsweng teng mme e go latlhela mo teng ka tlhamalalo; fa Ubuntu e re Cannot open access to console, the root account is locked, leba init=/bin/bash ela tlhoko fa tlase).
  2. Tsenya gape thulaganyo ya difaele tsa modi jaaka Puisa-Kwala: Mo mokgweng wa tshoganyetso, / gantsi e tlhomilwe go Buisa Fela, ka jalo fa o leka go boloka /etc/fstab, nano o tlaa re Error writing /etc/fstab: Read-only file system. Dira seno pele:
    mount -o remount,rw /
    
  3. Batlisisa gore ke mola ofe mo /etc/fstab e robegile: Taboga mount -a. Le fa e le polatefomo efe e e robegileng e tla gatisa phoso ka bonako (ka sekai, mount: /mnt/backup: can't find UUID=4a8b...). Gape o ka bapisa di-UUID tsa gago tsa mmatota tsa polatefomo le /etc/fstab ka go taboga:
    blkid
    cat /etc/fstab
    
  4. Tseleganya /etc/fstab mme o tsenye nofail kgotsa tshwaela ka mola o o sa siamang:
    nano /etc/fstab
    
    Tsenya # kwa tshimologong ya polatefomo ya bobedi e e thubegileng kgotsa mola wa go ananya go e tima (kgotsa go tsenya ,nofail go ya kwa kholomong ya ditlhopho tsa go tlhoma jaaka defaults,nofail ka jalo Linux ga e ke e gana go simolola fa drive eo ya kwa ntle e ntshitswe mo polakeng). Boloka ka Ctrl+O, tobetsa Tsenya, o bo o tswa ka Ctrl+X.
  5. Laisa gape systemd mme o netefatse pele o simolola gape:
    systemctl daemon-reload
    mount -a
    
    Fa mount -a e busetsa diphoso tsa lefela, mofuta reboot mme khomphutha ya gago e tla simolola sentle.

Warning

Go tweng fa Ubuntu/Debian e re "Cannot open access to console, the root account is locked" kwa potso ya Mokgwa wa Tshoganyetso? Ka gonne Ubuntu e thibela root nomoro ya sephiri ka thulaganyetsoruri e rata sudo, sulogin ka dinako tse dingwe e go tswalela mo Mokgweng wa Tshoganyetso fa disiki e le mo /etc/fstab e a palelwa. Go tlola selotlolo seo mo metsotswaneng e le 30: simolola gape, tshwara Shift kgotsa tobetsa Esc go bula menyu wa GRUB, tlhomolola Ubuntu, tobetsa e go tseleganya taelo ya go simolola, batla mola o o simololang ka linux /boot/vmlinuz..., emisetsa ro quiet splash kwa bokhutlong jwa mola oo ka rw init=/bin/bash, o bo o tobetsa Ctrl+X kgotsa F10. Seno se fapoga systemd gotlhelele mme e go latlhele ka tlhamalalo mo go e e sa lotlololwang # root shell e e nang le phitlhelelo ya go buisa le go kwala gore o kgone go dira nano /etc/fstab.

Boemo jwa 4: Go fola mo moding o o tletseng 100% (/) disiki kgotsa mokgweetsi wa GPU yo o robegileng

Fa PC ya gago e feta GRUB ka thelelo, e sa bontshe diphoso dipe tsa tsamaiso ya difaele, mme morago ga moo e bo e lepelela ruri mo sekirining se sentsho se se nang le sesupo se se panyapanyang mo sekhutlong se se kwa godimo sa molema (kgotsa e boela kwa sekirining sa go tsena nako le nako fa o thaepa nomoro ya gago ya sephiri o bo o tobetsa Enter), karolo ya gago ya modi (/) e batla e 100% e tletse. Leng / e na le dimekabaete di le 0 tsa sebaka se se sa duelelweng, Xorg, Wayland, le GNOME/KDE ga di kgone go tlhama faele ya selotlolo sa nako ya dikilobaete di le 4 mo /tmp kgotsa /var/lib, e e dirang gore desekethopo e thule ka tidimalo.

Tsela ya go golola di-gigabyte tsa sebaka mo khonsoleng ya TTY

  1. Mo sekirining sa sesupo se sentsho se se panyapanyang (kgotsa sekerini sa go tsena se se tlhotlhoregang), tobetsa Ctrl + Alt + F3 (mo dilepothopong, o ka nna wa tlhoka Ctrl + Alt + Fn + F3) go fetoga go tswa mo sekirining sa kerafo se se gatsetse (TTY1/TTY2) go ya kwa theminaleng ya mokwalo o o phepa (TTY3).
  2. Tsena ka leina la gago le le tlwaelegileng la modirisi le nomoro ya sephiri, o bo o tlhola tiriso ya disiki:
    df -h /
    
  3. Fa Use% dipontsho 100% (kgotsa Avail dipontsho 0), dirisa ditaelo tseno tse nne tsa go phepafatsa tse di babalesegileng go golola sebaka sa 2 GB go ya go 25 GB ka bonako:
    # 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
    
    (Fa faele ya pegelo e e tshabileng e tshwana le /var/log/syslog kgotsa /var/log/ufw.log e oketsegile go fitlha go 50 GB, e ntsha sepe ka yone nako eo ka sudo truncate -s 0 /var/log/syslog.)
  4. Ke eng df -h ka dinako tse dingwe bontsha Avail: 0 (100% e tletse) fa go dirisiwa fela 95% ya disiki? Ka thulaganyetsoruri, ext4 e beetse diperesente di le 5 tsa karoganyo yotlhe fela tsa root modirisi ka jalo ditirelo tsa modi di santse di ka dira fa modirisi yo o tlwaelegileng a tlatsa tiske. Mo SSD ya 1-terabyte, 5% ke 50 GB e kgolo e e tshwerweng ka dikgoka. O ka nna wa batla gape 40+ GB ya buffer eo e e beetsweng akhaonto ya gago e e tlwaelegileng ya modirisi ka go dirisa:
    sudo tune2fs -m 1 /dev/nvme0n1p2   # Reduces reserved root blocks from 5% to 1% immediately
    
  5. Gangwe df -h / e bontsha di-gigabyte di le mmalwa tse di leng teng, taboga sudo reboot mme desekethopo ya gago ya kerafo e tla tsena ka tlwaelo.

Go tweng fa df -h e na le sebaka se sentsi sa mahala, mme skrini se sentsho se simolotse morago ga go tlhabolola mokgweetsi wa Nvidia kgotsa kernel?

Fa disiki ya gago e sa tlala mme sekerini se sentsho se simolotse fela morago ga go tlhabololwa mo PC e e nang le karata ya dikerafiki ya Nvidia, mojulu wa kernel ya Nvidia (nvidia.ko) e paletswe ke go kokoanya ka dkms ya kernel ya gago e ntšhwa, kgotsa Secure Boot e thibetse mojule o o saenwang:

  1. Go tswa go Ctrl + Alt + F3 TTY console, tlhola gore a mojule wa mokgweetsi o laisitswe ka go dirisa nvidia-smi.
  2. Fa nvidia-smi a re NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver, e ka nna ya tima Secure Boot mo teng ga dipeakanyo tsa UEFI/BIOS tsa motherboard ya gago (fa e le gore Secure Boot e thibela mojule wa DKMS o o saenwang), kgotsa ya aga sešwa ditlhogo tsa kernel le mokgweetsi:
    # Install missing kernel headers for your currently running kernel and rebuild DKMS:
    sudo apt update
    sudo apt install --reinstall linux-headers-$(uname -r) build-important dkms
    sudo dpkg-reconfigure nvidia-dkms-*   # Or run: sudo ubuntu-drivers autoinstall
    sudo update-initramfs -u
    sudo reboot
    

Tiragalo 5: USB e e Tshwaraganeng e e Feletseng chroot pholoso (ya EFI/GRUB, LVM, LUKS, le Btrfs tse di phimotsweng)

Fa ntšhwafatso ya Windows 11 e kwala godimo ga ditsenngwa tsa gago tsa go simolola tsa UEFI, ntšhwafatso ya kernel e a thula mo gare ga sefofane fa maatla a tima, kgotsa . grub rescue> ga e kgone go bala karoganyo ya gago, simolola khomphutara ya gago go tswa mo Live Linux USB drive (o tlhopha "Leka Ubuntu" kgotsa mokgwa wa desekethopo o o tshelang) mme o dire chroot (Fetola Modi) paakanyo. A chroot e letla theminale ya gago ya Live USB go tsena mo teng ga go tsenngwa ga gago ga SSD e e robegileng le go dira apt, dnf, update-initramfs, le grub-install jaaka e kete tsamaiso e simolotse ka tlwaelo.

Kgato 1: Supa le go lotlolola thulaganyo ya gago ya polokelo (lsblk -f)

Bula theminale mo teng ga desekethopo ya Live USB o bo o dirisa:

sudo lsblk -f
Leba FSTYPE kholomo go bona gore ke efe ya dipolane tse nne tse di tlwaelegileng tse tsenngwa ya gago ya Linux e di dirisang, mme o e tsenye mo /mnt o dirisa boloko e e tshwanang e e fa tlase:

  • Kgetse 1: Tlwaelo ext4 kgotsa xfs karoganyo (ka sekai, Modi ke /dev/nvme0n1p2 mme EFI ke /dev/nvme0n1p1):
    sudo mount /dev/nvme0n1p2 /mnt
    sudo mount /dev/nvme0n1p1 /mnt/boot/efi
    
  • Kgetse 2: Karolo ya modi wa LUKS e e tsenngwang khoutu (crypto_LUKS) (ka thulaganyetsoruri fa "Tsenya disiki ya me" e ne e tlholwa ka nako ya go tsenya): O tshwanetse go tlhalosa setshodi sa LUKS pele pele o se tsenya:
    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
    
  • Kgetse 3: Tsamaiso ya difaele ya Btrfs e e nang le @ dibolumopotlana (ka thulaganyetsoruri mo ditlhomong tsa Fedora, openSUSE, le Ubuntu Btrfs): Fa o tsenya karoganyo ya Btrfs kwantle ga go totobatsa subvol=@, /mnt e tla bontsha fela @ le @home ditsholadifaele mo boemong jwa /bin le /etc, le chroot /mnt e tla palelwa ka failed to run command '/bin/bash': No such file or directory. Thaba @ bolumopotlana ka tlhamalalo:
    sudo mount -o subvol=@ /dev/nvme0n1p2 /mnt          # (Use subvol=root on Fedora)
    sudo mount /dev/nvme0n1p1 /mnt/boot/efi
    

Kgato 2: Bofa ditsamaiso tsa difaele tsa kernel tsa mmatota (go akaretsa le UEFI efivars) o bo o tsenya chroot

Ka gonne grub-install le apt (Phitlhelelo ya inthanete ya DNS) go bereka mo teng chroot, go tsenya dikaedi tsa kernel tsa Live USB le diphetogo tsa UEFI NVRAM mo /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

Kgato 3: Baakanya diphuthelwana, aga sešwa initramfs, mme o tsenye GRUB gape mo teng chroot

Jaanong ka gore tlhagiso ya gago e bontsha root@ubuntu:/#, dirisa ditaelo tsa paakanyo tsa kabo ya gago:

# 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)

Kgato 4: Tswa ka phepafalo o bo o simolola gape

exit
sudo umount -R /mnt
sudo reboot
Tlosa polaka ya USB ya Live fa e kopiwa. Tsamaiso ya gago e tla simolola ka tlhamalalo mo menyung wa gago wa GRUB o o baakantsweng le mo desekethopong ya Linux.

Ditekanyetso tsa kgwebo tsa kgaolo, go ikobela melao ya lefelo la tshedimosetso, le go newa setifikeiti sa serwethata

Taolo ya bootloader ya Enterprise Linux le tshireletsego ya serweboleta di laolwa ke melao e e gagametseng ya bosetšhaba le matlhomeso a tshireletsego ya inthanete:

  • United States: Mafaratlhatlha a puso le a dikgwebo a latela Kgatiso e e Kgethegileng ya Setheo sa Bosetšhaba sa Maemo le Thekenoloji (NIST) 800-147B (Dikaelo tsa Tshireletso ya BIOS ya Disefara) le SP 800-193 (Dikaelo tsa go Itshokela Firmware ya Polatefomo). Ditlhomo tsa puso tse di dirisang Red Hat Enterprise Linux (RHEL) kgotsa Rocky Linux di tshwanetse go tsamaisana le Dikaedi tsa Tiragatso ya Setegeniki tsa Tshireletso (STIGs) tsa Setheo sa Ditsamaiso tsa Tshedimosetso ya Tshireletso (DISA). Maemo ano a tlhoka tshireletso ya nomoro ya sephiri mo dimenyung tsa go simolola tsa GRUB 2, go thibela go tseleganya paramente ya kernel e e dirisanang, go kgontsha UEFI Secure Boot ka di-loader tsa Shim tsa kgato ya ntlha, le go tsenya polokelo ya modi ka dimmojule tsa FIPS 140-⅔ tse di netefaditsweng tsa LUKS.
  • United Kingdom: Setsi sa Bosetšhaba sa Tshireletso ya Inthanete (NCSC) se gatisa kaelo ya tshireletso ya didiriswa tsa dipolatefomo tsa Linux tsa kgwebo, se laela bothokgami jwa polatefomo e e nang le medi ya serweboleta. Ditsamaiso tse di dirisiwang go ralala puso kgotsa mafaratlhatlha a botlhokwa a bosetšhaba di tshwanetse go dirisa ditekanyo tsa Mojule wa Sethala se se Ikanyegang (TPM 2.0) go tswala dinotlolo tsa go tsenya tshedimosetso mo disiki tsa LUKS kgatlhanong le Direjisetara tsa Thulaganyo ya Sethala (di-PCR), go netefatsa gore kgweetso e lotlolola gape ka botlalo fela fa firmware ya UEFI, dinotlolo tsa Secure Gmpertae Boot di unpololwa ka botlalo.
  • Kopano ya Yuropa: Mo Kopanong ya Yuropa, Kantoro ya Bosetšhaba ya Tshireletsego ya Tshedimosetso kwa Jeremane (BSI) e tlhoma tshireletsego ya motheo ka boloko ya go aga ya IT-Grundschutz SYS.1.3 (Server Linux le Unix). Dikaelo tsa BSI di tlhoka go kgaoganngwa ka thata ga dikarolo tsa boot, dithulaganyo tsa bootloader tse di sa fetogeng, le ditsamaiso tsa tlhokomelo tse di tlhatlhobilweng. Tlasa Taelo ya Tshireletso ya Neteweke le Tshedimosetso ya EU (NIS 2), ditheo tse di dirang ditirelo tsa botlhokwa tsa dijithale di tshwanetse go tlhokomela ditsamaiso tse di netefaditsweng tsa go tsosolosa masetlapelo a tshipi e e senang sepe go kgotsofatsa Maikaelelo a Nako ya go Fodisa (RTO) ka nako ya go palelwa ga tsamaiso ya tiriso.
  • Canada: Setsi sa Canada sa Tshireletso ya Inthanete (CCCS) se fana ka tataiso tlasa ITSG-33 (Taolo ya Dikotsi tsa Tshireletso ya IT), e totobatsang ditaolo bakeng sa ditikoloho tsa tshebetso tsa Linux tsa kgwebo. Go tsamaelana le Molao wa Tshireletso ya Tshedimosetso ya Botho le Ditokomane tsa Eleketeroniki (PIPEDA), di-hard drive tsa sefara tsa mmatota tse di ntseng di tsosolosiwa ka bootloader kgotsa go emisediwa ka molaodi di tshwanetse go dirisa serweboleta kgotsa go tsenya tshedimosetso mo maemong a bolumu go thibela go tlhagelela ga tshedimosetso ka nako ya go dira ditirelo.
  • Australia: Bokaedi jwa Ditshupo jwa Australia (ASD) bo gatisa Bukana ya Tshireletso ya Tshedimosetso (ISM), e e tlhalosang ditlhokego tsa ditsamaiso tsa Linux tsa dikgwebo. ISM e laela gore mekgatlho e diragatse UEFI Secure Boot, e sireletse dithulaganyo tsa bootloader kgatlhanong le diphetogo tse di sa netefadiwang, le go kwala phitlhelelo ya kgapetla ya tlhokomelo ya tshoganyetso mo mabolokelong a boruni a a kopantsweng go boloka kobamelo ya maano a phokotso a Botlhokwa a Robedi.

Dipotso tse di bodiwang kgapetsakgapetsa

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.

Setifikeiti sa thuso ya potlako le pabalesego ya setegeniki kwa tirong

Diteko tsa boot tsa maemo a hardware gantsi di tlhoka go bula dikgetsi tsa desekethopo, go emisetsa ditlamelo tsa motlakase, kgotsa go tlhatlhoba didirisiwa tsa raka ya sefara. Botegeniki bo lebane le dikotsi tse di masisi tsa motlakase tse di bakiwang ke di-capacitor tse di senyegileng, go phatloga go go bakiwang ke tšhese e e bogale ya tshipi le dikgobalo tsa go thubaganya go bakilwe ke didirisiwa tse di bokete tse di tsenngwang mo dirakeng. Fa go ka nna le tšhoko ya motlakase, kgaola sethibela-sekete ka bonako pele ga o ama motswasetlhabelo mme o letsetse ditirelo tsa tshoganyetso. Go itse go dira CPR le go laola go dutla madi thata kgotsa go tshoga go botlhokwa thata mo phaposing ya sefara fela jaaka go rarabolola mathata a setegeniki. Re akantsha gore o weditse thuto e e amogetsweng ya thuso ya potlako, CPR/AED, le ya boitekanelo le pabalesego kwa tirong ka Sefapaano se Sehibidu, Ambulense ya St John, kgotsa bothati jwa bosetšhaba jwa pabalesego.

Metswedi e tlhotlhomisitswe

  • Porojeke ya GNU / Motheo wa Serweboleta sa Mahala ( sa Boditšhabatšhaba ): Bukakaelo ya Semmuso ya GNU GRUB 2.12 , Go simolola go tswa go grub> le grub rescue> Dikgapetla tsa Taelo (gnu.org/software/grub/manual).
  • Diakhaefe tsa Kernel ya Linux le Kernel.org (ya Boditšhabatšhaba): Dipharametara tsa Kernel (admin-guide/kernel-parameters.txt), initramfs Sebaka sa Modirisi sa Pele, le Tsamaiso ya Tsamaiso ya Difaele (docs.kernel.org).
  • Ditokomane tsa Sefara ya Desekethopo ya Canonical / Ubuntu (Bogosi jo bo Kopaneng / Boditšhabatšhaba): Go Busetsa Bootloader ya GRUB2, Ditsamaiso tsa Chroot tsa LiveCD, le Taolo ya Sebaka sa Diseke (help.ubuntu.com, ubuntu.com/server/docs).
  • Ditokomane tsa Porojeke ya Linux ya Kgwebo ya Red Hat (RHEL) le Fedora (United States): Go Rarabolola Mathata a go Simolola ka dracut, xfs_repair, le grub2-mkconfig (docs.redhat.com, docs.fedoraproject.org).
  • Wiki ya Linux ya Arch (ya Boditšhabatšhaba): GRUB, Chroot, fstab, le mkinitcpio Tshupetso ya Setegeniki (wiki.archlinux.org).
  • Tokomane ya tsamaiso (ya Boditšhabatšhaba): systemd.unit Dintlha tsa Maemo a Tshoganyetso le tsa Phalotso, journalctl Go ntsha leswe, le systemd.mount Ditlhopho (freedesktop.org/software/systemd/man).

Dikaedi tse di tsamaelanang