• 온라인 도구
  • - 계산기
    • 문자 수
  • - 다운로드
    • TikTok 다운로드
    • DouYin 다운로드
  • - 웹 도구
    • BASE64
    • Base64→이미지
    • 이미지→Base64
    • URL 인코딩
    • JavaScript
    • 타임스탬프
    • 유니코드 변환기
    • JSON 형식
    • 확장자 수정
    • 목록 만들기
    • CSS 최적화
  • - 암호화 도구
    • MD5 암호화
    • 랜덤 생성기
  • - 이미지 도구
    • 이미지 압축
    • QR 코드 생성기
    • QR 코드 리더
    • 배경 화면 미리보기
  • - 정보 시트
    • 혈액형 유전
    • 의류 사이즈
  • [email protected]
DopuBox
  • English
  • Español
  • Français
  • 日本語
  • 한국어
  • 简体中文
  • 繁體中文
全部 ニュース Meta Code 文化・アート
CentOS 6が誤って削除したbootパーティションはどのように回復を復元するのか
2022-01-14

CentOS 6システムでは,不注意や操作ミスによりbootパーティションが削除される場合,削除されたbootパーティションを復元できるかどうか.実はいいです。次は編集者と一緒に理解してみましょう。

  1.まずcentos 6ミラーを利用してlinux rescue救援モードに入ります。

  2.sshdサービスを起動し、eth 0で取得したipアドレスを表示し、ssh secure shellで接続します。

  SSH Secure Shell 3.2.9 (Build 283)

  Copyright (c) 2000-2003 SSH Communications Security Corp - http://www.ssh.com/

  This copy of SSH Secure Shell is a non-commercial version.

  This version does not include PKI and PKCS #11 functionality.

  [root@localhost~〕#cd/boot//入/bootパーティション

  [root@localhostboot〕#ls//bootパーティションの内容の表示

  config-2.6.32-71.el6.i686 symvers-2.6.32-71.el6.i686.gz

  grub System.map-2.6.32-71.el6.i686

  initramfs-2.6.32-71.el6.i686.img vmlinuz-2.6.32-71.el6.i686

  [root@localhost boot]# cd 。。//上位ディレクトリに戻る

  [root@localhost/〕#rm-rf/boot/*//削除/bootパーティションのすべてのコンテンツ

  [root@localhost/〕#ls/boot//表示/bootパーティションの内容が空です

  [root@localhost/〕#mount/dev/sr 0/mnt//cdromデバイスを/mntディレクトリにマウント

  mount: block device /dev/sr0 is write-protected, mounting read-only

  [root@localhost /]# rpm -ivh /mnt/Packages/kernel-2.6.32-71.el6.i686.rpm--root=/--force//CDをインストールするkernelパッケージ

  Preparing.。。 ########################################### [100%]

  1:kernel ########################################### [100%]

  [root@localhost/〕#ls/boot//表示/bootパーティションの内容

  config-2.6.32-71.el6.i686 System.map-2.6.32-71.el6.i686

  initramfs-2.6.32-71.el6.i686.img vmlinuz-2.6.32-71.el6.i686

  symvers-2.6.32-71.el6.i686.gz

  [root@localhost/〕#mkdir/boot/grub///bootディレクトリにgrubディレクトリを新規作成

  [root@localhost /]# touch /boot/grub/grub.conf//grubを新規作成します。confプロファイル

  [root@localhost/〕#cp-rf/usr/share/grub/i 386-pc/*/boot/grub//////usr/share/grub/i 386-pcのすべてのコンテンツを/boot/grubにコピーします。

  [root@localhost/〕#ls/boot//表示/bootパーティションの内容

  config-2.6.32-71.el6.i686 symvers-2.6.32-71.el6.i686.gz

  grub System.map-2.6.32-71.el6.i686

  initramfs-2.6.32-71.el6.i686.img vmlinuz-2.6.32-71.el6.i686

  [root@localhost/〕#ls/boot/grub///表示/boot/grubディレクトリ内容

  e2fs_stage1_5 iso9660_stage1_5 stage1 vstafs_stage1_5

  fat_stage1_5 jfs_stage1_5 stage2 xfs_stage1_5

  ffs_stage1_5 minix_stage1_5 stage2_eltorito

  grub.conf reiserfs_stage1_5 ufs2_stage1_5

  [root@localhost/〕#fdisk-l//パーティションの表示

  Disk /dev/sda: 21.5 GB, 21474836480 bytes

  255 heads, 63 sectors/track, 2610 cylinders

  Units = cylinders of 16065 * 512 = 8225280 bytes

  Sector size (logical/physical): 512 bytes / 512 bytes

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

  Disk identifier: 0x000b1db4

  Device Boot Start End Blocks Id System

/dev/sda 1*1 13 102400 83 Linux//これは/boot起動パーティションです

  Partition 1 does not end on cylinder boundary.

  /dev/sda2 13 144 1048576 82 Linux swap / Solaris

  Partition 2 does not end on cylinder boundary.

/dev/sda 3 144 2611 19819520 83 Linux//これは/ルートパーティション

  [root@localhost/〕#mount//すべてのマウントパーティションの表示

/dev/sda 3 on/type ext 4(rw)/ルートパーティション

/dev/sda 1 on/boot type ext 4(rw)/bootパーティションsda 1

  devpts on /dev/pts type devpts (rw)

  tmpfs on /dev/shm type tmpfs (rw)

  proc on /proc type proc (rw)

  sysfs on /sys type sysfs (rw)

  /dev/sr0 on /mnt type iso9660 (ro)

  [root@localhost//grub//grubを起動する

  Probing devices to guess BIOS drives. This may take a long time.

  GNU GRUB version 0.97 (640K lower / 3072K upper memory)

  [ Minimal BASH-like line editing is supported. For the first word, TAB

  lists possible command completions. Anywhere else TAB lists the possible

  completions of a device/filename.]

grub』root(hd 0,0)/まずfind/grub/stage 1表示/bootパーティションは(hd 0,0)

root(hd 0,0)/設定/bootパーティション/dev/sda 1

  Filesystem type is ext2fs, partition type 0x83

grub』setup(hd 0)/grubの再インストール

  setup (hd0)

  Checking if “/boot/grub/stage1” exists.。。 no

  Checking if “/grub/stage1” exists.。。 yes

  Checking if “/grub/stage2” exists.。。 yes

  Checking if “/grub/e2fs_stage1_5” exists.。。 yes

  Running “embed /grub/e2fs_stage1_5 (hd0)”。。。 26 sectors are embedded.

  succeeded

  Running “install /grub/stage1 (hd0) (hd0)1+26 p (hd0,0)/grub/stage2 /grub/grub.conf”。。。 succeeded

  Done.

grub』quit//退出

  3.再reboot起動システムgrubインタフェーステストへ

  4.find/grub/stage 1を検索し、/bootパーティション(hd 0,0)を見つけ、kernel,initrd,boot起動システムを指定して成功しました。

  5.システムの起動に成功し、システムの再書き込み/boot/grub/grubに入ります。confファイル。

  6.[root@localhost /]# vi /boot/grub/grub.confプロファイルは次のとおりです。

最後にgrubに記入します。confファイルの内容

default=0//デフォルトメニューは1つ目

timeout=6//待ち時間6秒

タイトルmylinux//スタートアップmylinux

root(hd 0,0)/bootが存在するパーティションは/dev/sda 1

  kernel /vmlinuz-2.6.32-71.el6.i 686 roroot=/dev/sda 3 rhgb quiet//kernelが存在する場所は、/dev/sda 3本のパーティションrhgb quietを読み取り専用モードでマウント/dev/sda 3本のパーティションrhgb quietとしてカーネル情報は表示されません。

  initrd /initramfs-2.6.32-71.el6.i686.img//initrdミラーをロードします。

  7.最後にlinux rescueに入ってgrubを再構築します

  8.最後の起動画面は次のとおりです。

上にはCentOS 6が削除されたbootパーティションを復元する方法が紹介されていますが、手順が長いので、面倒ならシステムを再インストールして、同じようにbootパーティションを復元することができます。


ソース元URL:https://dopubox.com/article/p/89296675b5a819fe

기타 도구
  • 문자 수 TikTok 다운로드 DouYin 다운로드 BASE64 Base64→이미지 이미지→Base64 URL 인코딩 JavaScript 타임스탬프 유니코드 변환기 JSON 형식 확장자 수정 목록 만들기 CSS 최적화 MD5 암호화 랜덤 생성기 이미지 압축 QR 코드 생성기 QR 코드 리더 배경 화면 미리보기 혈액형 유전 의류 사이즈
  • 「ねこクラゲ」被告、脱税認める 原稿優先で申告せず、福岡地裁
    2024-05-31

    森トラストが平安女学院から有栖川宮旧邸を取得…今度の活用は京都市とも引き続き協議
    2024-06-01

    日本の「木」の文化を家具を通して世界へ【ミラノデザインウィーク】
    2024-06-01

    テレ東が警察密着番組の担当者らを懲戒処分
    2024-06-03

    特別展 「工芸的美しさの行方―うつわ・包み・装飾」が東京と京都で開催。日本の美術工芸を世界へ 
    2024-06-04

    ペース・ギャラリーが9月にグランドオープン。7月には特別内覧会を開催へ
    2024-06-04

    「三島喜美代―未来への記憶」(練馬区美術館)開幕レポート。最大規模のインスタレーションも
    2024-06-05

    お台場エリアを舞台に新芸術祭「東京お台場トリエンナーレ 2025」が誕生
    2024-06-05

    石川九楊の個展「石川九楊大全」が上野の森美術館で2ヶ月連続開催へ
    2024-06-05

    謎多き家形埴輪 「考古学の空白」に挑む橿考研ベテラン研究員、念願の特別展開催中
    2024-06-04

    【1971年の今日 : 6月5日】京王プラザホテル全面開業―今からは想像もできない着工前の巨大な貯水池だった頃の写真も
    2024-06-05

    105歳で死去した画家弥勒祐徳さん おごらず、黙々と、ひたすらに神楽など描く
    2024-06-05

    ビル・エヴァンスの名言「才能なんて取るに足りない」【本と名言365】
    2024-06-05

    書評:「日本美術史」を書き換える100年単位の挑戦。『この国(近代日本)の芸術──〈日本美術史〉を脱帝国主義化する』
    2024-06-05

    田名網敬一が新作の巨大インスタレーションを発表へ。世界初の大規模回顧展「田名網敬一 記憶の冒険」
    2024-06-06

    青森で来年夏に音楽祭 沖澤のどかさんが総監督
    2024-06-06

    藤井、棋聖戦5連覇へ白星発進
    2024-06-06

    佐渡金山の世界遺産登録、「情報照会」勧告
    2024-06-06

    今週末に見たい展覧会ベスト8。閉幕の横浜トリエンナーレから、「梅津庸一 クリスタルパレス」、石川九楊の2ヶ月連続個展まで
    2024-06-06

    パートナーとの強い絆から生まれた、ベンジャミン・ブリテンの代表作【クラシック今日は何の日?】
    2024-06-06

    ©  Dopu Box
    💛