Kev Kho Mob Txheej Txheem: HowTo chroot

Ntau lub sijhawm, tshwj xeeb tshaj yog thaum messing ncig, peb tau pom peb tus kheej muaj teeb meem tsis muaj peev xwm nkag mus rau lub system los kho nws, tab sis cov kev daws teeb meem yooj yim: siv cov lus txib chroot los ntawm cov nyob CD / RepairCD.

Hauv ntau qhov chaw (kev sib tham, blogs ...) cov lus txib no tau hais thiab "luam / muab tshuaj" ntawm cov cai tau muab, tab sis kuv lub tswv yim nrog rau cov ntawv tshaj tawm no yog los piav cov theem ntawd me ntsis, thiaj li ua rau zoo siv ntawm qhov no twj, nrog paub nrog cov laj thawj.

kev taw qhia

Qhov hais kom ua chroot Nws yog lub npe hu ua CHangeROOT, uas yog, ib lo lus txib uas tso cai rau koj hloov lub hauv paus ntawm qhov system uas koj ua haujlwm. Hauv lwm lo lus: yog tias koj yog los ntawm LiveCD thiab koj xav tau txhua yam koj ua haujlwm ntawm lub console kom muaj qhov cuam tshuam rau lub nruab zog nruab, koj yuav tsum xub siv chroot.

Qhov teeb meem yog tias nws tsis txaus siv chroot Raws li xws li, ua ntej peb yuav tsum tau tsim nyog qee cov ntu.

YUAV UA LI CAS

Ua ntej peb yuav tsum tau pib lub davhlau ya nyob twg, los ntawm lwm qhov kev teeb tsa (ntawm lwm muab faib / disk) lossis los ntawm LiveCD. TSEEM CEEB: lub architecture ntawm LiveCD yuav tsum sib phim ntawm cov kab ke yuav tsum kho (32 lossis 64 me me).
Thaum peb nyob hauv lub davhlau ya nyob twg peb yuav pib los ntawm txheeb xyuas peb cov muab faib:
fdisk -l

  • Nrog rau cov lus txib no peb yuav sau tag nrho peb cov partitions / disks. Peb yuav tsum txheeb xyuas qhov twg yog qhov hom phiaj kev lag luam, qhov twg peb txoj kev tsim kho los nruab, los ntawm tam sim no peb yuav hu nws tawg system.

Rau qhov ua piv txwv no peb yuav xav txog tias peb cov kev tawg nyob hauv / dev / sda1 .

Peb txuas mus teeb lub cev. Ua ntej peb yuav tsim cov nplaub tshev uas peb yuav mus ua haujlwm thiab tom qab ntawd peb teeb tsa lub chaw faib chaw uas peb cov kab ke tawg nyob rau hauv cov ntawv ntawd
mkdir /mnt/my_linux
mount /dev/sda1 /mnt/my_linux

Yog tias koj muaj lub nplaub tshev / tsev o / var lossis ib qho hauv lwm ntu, koj yuav tsum tau ntaws nws / s raws li hauv qab no:
mount /dev/sda2 /mnt/my_linux/var

  • NCO TSEG: Kuv tau coj ua piv txwv li / the / dev / sda2 muab faib rau cov / var nplaub tshev, cia txhua tus kho lub chaws rau lawv cov yam ntxwv.

Feem ntau qhov no yuav txaus yog tias koj tsuas xav tau kho cov ntaub ntawv ntawm tes, tab sis yog tias peb xav kom ua tiav qee cov lus txib uas teeb tsa lub system, peb yuav tsum tau nce qee qhov tshwj xeeb cov kab ke: / dev, / proc/ sys.
mount -t proc proc /mnt/my_linux/proc
mount -t sysfs sys /mnt/my_linux/sys
mount -o bind /dev /mnt/my_linux/dev

  • Nrog kev xaiv -t peb qhia mount hom kev "filesystem" peb xav nce toj. Nws yog qhov yuav tsum tau hais nws vim qhov tshwj xeeb tshwj xeeb ntawm cov nplaub tshev / proc y / sys.
  • Nrog kev xaiv -o peb qhia kom meej cov kev xaiv ntawm mountCov. Cov kev xaiv khi nws pabcuam rau "txuas". Hauv UNIX txhua cov khoom siv kho vajtse tau nkag los ntawm lub nplaub tshev / dev, yog vim li cas peb thiaj yuav tsum nce peb qhov tam sim no / dev hauv daim nplaub tshev uas peb qhov system tawg tam sim no. Raws li cov ntawv no yog twb tau mounted, nws tsuas yog tsim nyog los qhia mount nyob qhov twg nws yog Ameslikas mounted.

Nws yog ua li no thiaj li chroot muaj kev nkag mus siv cov ntawv no tau hais tias lawv tau tawg nyob rau hauv, txawm hais tias lawv yuav tsum yog los ntawm cov kab ke tam sim no (piv txwv: LiveCD ntu) vim lawv muaj feem cuam tshuam nrog lub xeev ntawm cov kab ke, cov txheej txheem thiab khoom kho.

Tam sim no yog lub sijhawm siv chroot:
chroot /mnt/my_linux/ /bin/bash

  • Lo lus txib raug dhau los ua kev sib cav txoj kev ntawm lub hauv paus tshiab «/» (uas nyob rau hauv peb cov ntaub ntawv / mnt / my_linux) thiab cov console koj xav siv (hauv qhov no peb tau xaiv rau lub npe zoo bash, pom hauv / rau hauv / bash)). Yog tias peb tsis sau lub console, peb yuav pom peb tus kheej nyob rau pem hauv ntej ntawm kev txhais lus me ntsis tus neeg txhais lus (nws tsis sau thaum nias lub tab, thiab lwm yam).

Tam sim no peb tuaj yeem siv lub console zoo li yog tias peb muaj lub hauv paus pib pib ntawm peb cov kab ke tawg (kho cov ntaub ntawv, tshawb xyuas cov ntawv sau, nruab / rho tawm pob ...). CEEB TOOM! Rau qhov kev hloov pauv tau txais txiaj ntsig, koj yuav tsum txo cov kev ua haujlwm tom qab tawm ntawm cov kab ke chrootSaib rau piv txwv hauv qab no.

Cov lus qhia ntxiv hauv https://wiki.archlinux.org/index.php/Change_Root (ntau tshaj li tau hais kom nyeem).

Kev siv piv txwv: rov qab GRUB2

Ib qho ntawm feem ntau siv ntawm chroot Nws yog qhov khoom siv los kho qhov GRUB. Txij li thaum yog lub grub tawg, nws yog qhov ua tsis tau rau khau raj peb lub cev los kho nws.

CEEB TOOM: qhov kev qhia me me no tsuas yog ua piv txwv xwb, nws ua haujlwm ntawm ntau yam kev faib tawm tau los ntawm Debian, Ubuntu thiab openSUSE ntawm lwm tus. Txawm yog li, tshawb xyuas cov ntaub ntawv ntawm koj qhov kev faib tawm, txij li hauv ntau cov lus txib tsis tau pom hloov tshiab-grub.
# NCO TSEG: cov lus txib khiav ib zaug sab hauv chroot.update-grub
grub-install /dev/sda

  • con hloov tshiab-grub Peb hloov GRUB2 cov ntawv qhia zaub mov, yog li ntxiv cov ntsiab lus ploj lawm. Tom qab ntawd peb rov txhim kho GRUB ntawm peb lub disk, vim nws tau muaj teeb meem.

Qhov no kuv tau coj mus / dev / sda zoo li cov album uas peb muaj peb txoj kab ke, qhov no yuav tsum raug yoog rau koj rooj plaub.

Peb cov GRUB yuav tsum tau kho tas, yog li peb yuav tsum tawm chroot, unmount ntawm cov filesystem (TSEEM CEEB) thiab reboot rau qhov kev hloov pauv kom muaj txiaj ntsig. Yog tias peb tsis nco qab txo cov filesystem, nws yog qhov ua tau kom rov qhib cov ntaub ntawv yuav tsis txiav txim siab kom raug thiab yog li qee qhov kev hloov pauv yuav tsis cuam tshuam.
# peb tso qaib sib ncawsexit
# unmount ntawm cov filesystem thiab rov pib duaumount /mnt/my_linux/dev
umount /mnt/my_linux/sys
umount /mnt/my_linux/proc
umount /mnt/my_linux
reboot

Thiab yog txhua yam. Kuv vam tias koj txaus siab rau nws thiab tias nws yuav pab koj. Npawg!


Cov ntsiab lus ntawm tsab xov xwm ua raws li peb cov ntsiab cai ntawm kev tswj hwm kev ncaj nceesCov. Tshaj tawm ib qho yuam kev nyem no.

24 lus, tawm koj li

Tso koj saib

Koj email chaw nyob yuav tsis tsum luam tawm.

*

*

  1. Lub luag haujlwm rau cov ntaub ntawv: Miguel Ángel Gatón
  2. Lub hom phiaj ntawm cov ntaub ntawv: Tswj SPAM, kev tswj xyuas tawm tswv yim.
  3. Sau raws cai: Koj kev tso cai
  4. Kev sib txuas lus ntawm cov ntaub ntawv: Cov ntaub ntawv yuav tsis raug xa mus rau lwm tus neeg thib peb tsuas yog los ntawm kev txiav txim siab raug cai.
  5. Cov ntaub ntawv khaws cia: Cov Ntaub Ntawv khaws tseg los ntawm Occentus Networks (EU)
  6. Txoj Cai: Txhua lub sijhawm koj tuaj yeem txwv, rov qab thiab tshem tawm koj cov ntaub ntawv.

  1.   Leper_Ivan said

    Kuv tuaj yeem siv qhov no .. Qee lub sijhawm Kuv yuav tsum siv nws.

  2.   Mario said

    Puas muaj ib qho ntawm koj puas tau siv Chakra Benz? Yog tias muaj, koj puas kam qhia kuv yog tias
    Nws puas yooj yim rau cov neeg siv khoom siv? Kuv siv SolydK uas yooj yim heev tab sis
    Kuv nkag siab hais tias Chakra yog KDE ntshiab thiab nws txaus siab rau kuv.

    1.    woqer ua said

      Yog lawm, chakra yog qhov zoo heev thiab ntau dua lossis tsawg dua yooj yim, qhov tshaj plaws yog tias yuav tsum nruab / tshem tawm cov pob khoom koj yuav tsum ua nrog cov nplig, vim tias lawv tseem ua haujlwm ntawm tus thawj tswj hwm cov pob graphical. Sim nws vim nws muaj nqi. Nws siv pacman pob tus nai tus nai, tau txais los ntawm Archlinux, tab sis ceev faj, nws tsis faib chaw cia khoom nrog koov thiab nws TSIS TAU nrog lawv. Yog tias koj xav paub ntau ntxiv txog pacman, mus saib ntawm koov wiki https://wiki.archlinux.org/index.php/Pacman_%28Espa%C3%B1ol%29

      1.    izzyvp ua said

        Oktopi twb tau ruaj khov thiab ua haujlwm zoo rau tus neeg siv nruab nrab, nrog rau qhov koj tsis xav tau lub davhlau ya nyob twg siv pacman.

  3.   x11t 11 said

    Kuv vam tias cov ncej no yuav tau mus ntsib ntau yam, tom qab ntawd lawv pib lawv lub taub hau rov nruab rau txhua yam thaum nrog chroot koj tuaj yeem kho qhov system yuav luag tas mus li, chroot ua rau koj muaj ntau txoj kev tuaj yeem, suav nrog txhim kho Gentoo xD hahaha

  4.   kev hlub said

    zoo, tsaug ... Kuv yeej tsis tau muab nws ib pob vim hais tias qee qhov nyob-cd rau kev kho kom zoo rau kuv tias lawv tsa nws los ntawm lub neej ntawd, tab sis tam sim no nws meej, ua tsaug dua.

  5.   lol said

    Txhawm rau kom tiav nws, nws yuav zoo piav qhia txog yuav ua li cas mount LVM partitions, encrypted partitions thiab RAID systems.

    1.    woqer ua said

      mmm Kuv tsis tau kov LVM thiab RAID ntev, tab sis koj tuaj yeem qhia kuv me ntsis kom ua tiav qhov no ... ua tsaug rau qhov taub!

      1.    lol said

        Zoo qhov tseeb yog hais tias kuv yuav siv tau zoo kawg.

        Nws yuav nco txiaj ntsig heev.

        1.    woqer ua said

          saib ntawm wiki no, nws zoo nkauj heev http://wiki.bandaancha.st/RAID_y_LVM_en_Linux

  6.   Modem said

    Yog tias tsuas muaj cov ntsiab lus no tau muaj ob peb lub lis piam tom qab, nws hloov tawm tias kuv muaj teeb meem nrog kuv lub kaw lus thiab kuv nyeem thiab nyeem thiab txhua qhov chaw kuv pom chroot thiab blablabla tab sis nws tsis ua haujlwm rau kuv raws li qhov kev pom zoo ntawm cov nyob uas yog tib yam li koj qhov system, tseem ceeb heev vim kuv siv x 64, lwm qhov yog rau mount lub partitions system, vim hais tias hauv kuv rooj plaub thaum kuv thov chroot thiab mounting, Kuv tau ntuav ib qho hais kom ua thiab nws tsuas yog tsis paub txog qhov hais kom ua.

    Cov ntsiab lus no yuav mus rau kuv "cov ntawv sau ua ke"

  7.   cov kua nplaum uas said

    Arch Arch LiveCD (nrog cov cuab yeej no) yog txhua yam uas xav tau los kho koj lub kaw lus thaum koj tsoo nws.

    1.    NYOO-Yooj Yim said

      Raws nraim! .. ..yog txhua yam uas tsim nyog .. txawm tias yuav pab ib tus neeg nrog lawv tus W $ leej twg txiav txim siab tsis pib ..

      Kuv ib txwm muaj nrog kuv 1gb pendrive nrog Arch nyob ... thiab chroot yog txhua yam uas tsim nyog yog li ntawd nyob rau hauv txhua qhov teeb meem, hauv 10 min koj muaj txhua yam nyob rau hauv kev txiav txim yam tsis muaj kev txhawj xeeb .. 😉

    2.    izzyvp ua said

      Koj tsuas yog yuav tsum paub tias yuav ua li cas.

    3.    Pablo said

      Nyob zoo, pom tias kuv muaj teeb meem nrog centos, nws xa kuv ntsiav ceeb thiab lwm yam. Thiab kuv tsis tuaj yeem daws nws, Kuv muaj kuv lub vev xaib thiab chaw khaws ntaub ntawv nyob rau ntawd. Kuv tsis paub dab tsi ntxiv.

  8.   jony127 ib said

    Cov ncej zoo, Kuv tau hnov ​​qee qhov chroot hauv kev dua tab sis kuv tsis paub tiag tiag siv nws li cas, tau kawg kuv tsis xav tau nws thiab yog vim li cas kuv tsis tau nyeem qee yam hauv tshwj xeeb. Tam sim no nrog koj tus ncej piav qhia meej heev, Kuv paub siv nws nyob rau hauv rooj plaub yog.

    Ua tsaug ntau thiab los ntawm txoj kev, nyob ntev Led Zeppelin hehe.

  9.   txaus ntshai said

    tsaug, thaum kawg kuv tau tawm ntawm grub tus npau suav phem

    qhov tseeb kuv ua raws txhua kauj ruam tsuas yog umount / mnt / my_linux, vim nws tau qhia kuv tias nws tsis khoom, thiab kuv fuser nws -km, tab sis tsis txawm tias, thiab thaws ...

    Kuv vam tias nws tsis tseem ceeb….

    ua tsaug, dua…
    txais tos

  10.   Jose Antonio said

    Txawm hais tias tsab xov xwm twb dhau los ua ob xyoos, Kuv xav ua tsaug rau tus sau rau nws txoj kev ua siab dav hauv kev sib qhia nws yog ib tsab xov xwm zoo vim tias lub asthiv no nws tau cawm kuv txoj sia. Tsis Txaus Ntseeg Kuv thauj tus neeg rau zaub mov txhim kho lub pob thiab thaum rov ua haujlwm nws tsis thauj khoom. Tom qab peb hnub ntawm kev sim kho nws thiab nyeem cov ntawv sib txawv, Kuv tswj kom tau txais ntawm no los ntawm lub caij nyoog thiab thaum kawg tuaj yeem rov txhim kho grub thiab kho cov neeg rau zaub mov.

    Ua tsaug ntau ntau !!!

    1.    woqer ua said

      Kuv zoo siab nws tau pab koj. Tsaug rau saib!

  11.   Helio said

    Nyob zoo, Kuv paub tias qhov no tau xa xyoo dhau los, no ua tsaug ntau rau kev faib tawm. Thiab kuv tau ua xyem xyav, hauv kuv qhov teeb meem nws tau ua kev puas tsuaj rau lub system thiab cov tsav tsheb network, yog li kuv tau ua raws li cov kauj ruam tab sis nws tsis tso cai rau kuv rub tawm pob, puas muaj lwm txoj hauv kev txuas cov network nyob nrog lub davhlau ya nyob twg

    1.    woqer ua said

      Kuv tsis tshua nkag siab koj qhov teeb meem ... Thaum koj nkag rau hauv LiveCD, lub hauv paus uas thawb yog ib qho los ntawm LiveCD, yog li koj yuav tsum tuaj yeem teeb tsa kev sib txuas hauv Internet zoo kawg nkaus. Thaum ua tiav qhov kev sib txuas, sim ua lub chroot kom pom tias koj txuas ntxiv tswj nws, yog tias tsis yog, koj yuav tsum tau kho nws dua, tab sis lub pob kws tsis zoo yuav tsum tsis muaj kev cuam tshuam chroot qhib.
      Yog tias koj tsis sau ntxiv, Kuv tuaj yeem qhia koj ...

  12.   dacha said

    Ncej Zoo Tshaj Plaws… ib qho ntawm qee cov ntsiab lus muaj nyob hauv Is Taws Nem.
    Ua tsaug ntau ntau rau txoj kev pab.

  13.   zopeck ua said

    Nyob zoo, zoo heev nyeem! Superbly piav qhia, rau peb tsuas yog mortals!

    Kuv muaj lus nug:
    Thaum koj tau hais txog qhov ntawd koj xav tau los nruab cov pob, ua qhov system hloov tshiab lossis lwm yam haujlwm tshwj xeeb, thiab xav kom muaj cov kab ke / dev / proc thiab / sys, nws tsis paub meej rau kuv yog tias cov ntawv tais ceev tseg no nyob rau hauv Cov Txheej Xwm Live uas peb pib cov khoom yuav tsum kho, lossis yog tias lawv nyob rau hauv cov cag muab faib ua ntej.

    Ua tsaug.

  14.   Orlando said

    Ua tsaug ntau ntau !!!!

bool (muaj tseeb)