[root@lichao520 ~]# fsck /dev/sdc1
fsck from util-linux-ng 2.17.2
e2fsck 1.41.12 (17-May-2010)
/dev/sdc1 was not cleanly unmounted, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Inode bitmap differences: -(12--14)
Fix? yes 输入y,修复
/dev/sdc1: ***** FILE SYSTEM WAS MODIFIED *****
/dev/sdc1: 11/183264 files (0.0% non-contiguous), 28970/732160 blocks
[root@lichao520 ~]# dumpe2fs /dev/sdc1|more
dumpe2fs 1.41.12 (17-May-2010)
Filesystem volume name:
Last mounted on:
Filesystem UUID: 942af69a-e741-4b29-bb30-a81ab4ef2c70
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr resize_inode dir_index f
iletype extent flex_bg sparse_super large_file huge_file uninit_bg dir_
nlink extra_isize
Filesystem flags: signed_directory_hash
Default mount options: (none)
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 183264
Block count: 732160
Reserved block count: 36608
Free blocks: 703190
Free inodes: 183253
First block: 0
Block size: 4096
Fragment size: 4096
[root@lichao520 ~]#
修复好,可以挂载使用
[root@lichao520 ~]# mount /dev/sdc1 /music/
[root@lichao520 ~]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
/dev/sda3 ext4 18G 2.9G 14G 18% /
tmpfs tmpfs 186M 260K 186M 1% /dev/shm
/dev/sda1 ext4 485M 35M 426M 8% /boot
/dev/sr0 iso9660 2.9G 2.9G 0 100% /media/RHEL_6.3 i386 Disc 1
/dev/sdc1 ext4 2.8G 69M 2.6G 3% /music
[root@lichao520 ~]#
===
[root@lichao520 music]# cd
[root@lichao520 ~]# umount /music/
[root@lichao520 ~]# dumpe2fs /dev/sdc1|more
dumpe2fs 1.41.12 (17-May-2010)
dumpe2fs: Bad magic number in super-block while trying to open /dev/sdc1
Couldn't find valid filesystem superblock.
[root@lichao520 ~]# fsck -y /dev/sdc1
===
[root@lichao520 ~]# fsck -y /dev/sdc1
fsck from util-linux-ng 2.17.2
e2fsck 1.41.12 (17-May-2010)
fsck.ext2: Superblock invalid, trying backup blocks...
/dev/sdc1 was not cleanly unmounted, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sdc1: ***** FILE SYSTEM WAS MODIFIED *****
/dev/sdc1: 11/183264 files (0.0% non-contiguous), 28970/732160 blocks
[root@lichao520 ~]#
[root@lichao520 ~]# dumpe2fs /dev/sdc1|more 修复后,可以查看,说明它是用来查看superblock里的信息的
===
破坏boot :情况1
破坏/boot分区---》/dev/sda1
[root@localhost ~]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
/dev/sda5 ext4 58G 1.8G 53G 4% /
tmpfs tmpfs 492M 0 492M 0% /dev/shm
/dev/sda1 ext4 485M 31M 429M 7% /boot
/dev/sda2 ext4 20G 172M 19G 1% /home
[root@localhost ~]# dd if=/dev/zero of=/dev/sda1 bs=512 count=8
8+0 records in
8+0 records out
4096 bytes (4.1 kB) copied, 0.00857931 s, 477 kB/s
[root@localhost ~]#
出现grub>
进入营救模式
切换根:
修复:
破坏/boot分区:(没有/boot启动不了)
破坏/分区:(所有数据都存在这里)
营救模式:相当于windows中的PE,光盘启动
LVM和标准分区破坏有些不同
破坏boot :情况2
dd if=/dev/zero of=/dev/sda1 bs=512 count=4
umount /boot
仍然能mkdir等操作,只是重启不能进入系统了
fsck -y /dev/sda1
修复,但是还是不能重启
重启后的情况:
进入营救模式
情况如下:
需要进入/mnt/sysimage 进行umount /dev/sda1 再进行修复