windows7mbr修复-(win10mbr修复)

来源:191路由网 2022-12-13 18:38:31

windows7mbr修复 (win10mbr修复)

.什么是MBR,MBR损坏如何恢复?

linux主机开机启动,会加载MBR启动引导程序,MBR启动引导程序存在硬盘的0磁道0柱面1扇区的前446字节,而1扇区后64字节存放的分区表,而后面还有两字节存放的是分区表的结束标识符55AA

1)模拟MBR引导程序损坏:删除MBR引导程序文件

[root@lixiang grub]# rm grub.conf

rm: remove regular file `grub.conf'? y

2)重启系统reboot,此时我们看见系统出现了下面画面

3)首先大家可以使用find (hd0,0)/后面接tab按键

4)输入root (hd0,0),出现下图:

5)输入kernel /vmlinuz-2.6.32-504.el6.x86_64 ro root=/dev/sda1 rhgb quiet,或者输入kernel /vmlinuz-2.6.32-504.el6.x86_64 ro root=LABEL=/ rhgb quiet (此法通用)【 注意由于我的是Centos6.6版本的,你可以从其他地方拷贝试试,具体文件在这个地方/boot/grub/grub.conf,这个内容是我先记录下来的 ro root=UUID=2acb0807-4ecd-4305-a2e9-28446b3d85ca rd_NO_LUKS rd_NO_LVM.UTF-8;不过忘记也没有关系下面我还会交另外一种方法来恢复】



6)输入initrd /initramfs-2.6.32-504.el6.x86_64.img

7)最后一步boot重启,下面奇迹的时刻发生了,系统就会成功启动。不过只是这一次成功登陆,下次登陆仍然会出现这个问题,所以我将我备份的grub.conf.bak更改为grub.conf

MBR恢复方法二:

通过光盘恢复救援模式恢复,下面是具体恢复方法:

1)开机启动选择加载光盘启动,选择救援模式

2)选择默认即可

3)选择OK

4)网络选择NO

5)选择continue

6)默认ok

7)选择shell Start shell,选择Ok

8)执行命令chroot /mnt/sysimage

9)下面执行mv /boot/grub/grub.conf.bak /boot/grub/grub.conf

10)设置本地硬盘启动,重新启动系统就可以了

6.磁盘挂载,如果磁盘容量小于2T可以使用fdisk挂载,如果大于2T使用parted挂载

1)下面让我们来做一下,例如将/dev/sdb磁盘划分为两个区,1P+1L


[root@GW ~]# fdisk /dev/sdb

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to

switch off the mode (command 'c') and change display units to

sectors (command 'u').

Command (m for help): m

Command action

a toggle a bootable flag

b edit bsd disklabel

c toggle the dos compatibility flag

d delete a partition

l list known partition types

m print this menu

n add a new partition

o create a new empty DOS partition table

p print the partition table

q quit without saving changes

s create a new empty Sun disklabel

t change a partition's system id

u change display/entry units

v verify the partition table

w write table to disk and exit

x extra functionality (experts only)

Command (m for help): n

Command action

e extended

p primary partition (1-4)

p

Partition number (1-4): 1

First cylinder (1-102, default 1):

Using default value 1

Last cylinder, +cylinders or +size{K,M,G} (1-102, default 102): +20MB

Command (m for help): n

Command action

e extended

p primary partition (1-4)

e

Partition number (1-4): 2

First cylinder (21-102, default 21):

Using default value 21

Last cylinder, +cylinders or +size{K,M,G} (21-102, default 102):

Using default value 102

Command (m for help): p

Disk /dev/sdb: 106 MB, 106954752 bytes

64 heads, 32 sectors/track, 102 cylinders

Units = cylinders of 2048 * 512 = 1048576 bytes

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

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

Disk identifier: 0x000602e5

Device Boot Start End Blocks Id System

/dev/sdb1 1 20 20464 83 Linux

/dev/sdb2 21 102 83968 5 Extended

Command (m for help): n

Command action

l logical (5 or over)

p primary partition (1-4)

l

First cylinder (21-102, default 21):

Using default value 21

Last cylinder, +cylinders or +size{K,M,G} (21-102, default 102):

Using default value 102

Command (m for help): p

Disk /dev/sdb: 106 MB, 106954752 bytes

64 heads, 32 sectors/track, 102 cylinders

Units = cylinders of 2048 * 512 = 1048576 bytes

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

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

Disk identifier: 0x000602e5

Device Boot Start End Blocks Id System

/dev/sdb1 1 20 20464 83 Linux

/dev/sdb2 21 102 83968 5 Extended

/dev/sdb5 21 102 83952 83 Linux

分区完毕之后,我们可以使用mkfs -t ext4 格式化分区

[root@GW ~]# mkfs -t ext4 /dev/sdb1

挂载分区,将sdb1挂载到/tmp目录下

[root@GW ~]# mount /dev/sdb1 /tmp

将文件挂载文件写入开机自启动

UUID=2acb0807-4ecd-4305-a2e9-28446b3d85ca / ext4 defaults 1 1

UUID=edab26eb-e5da-47e2-914b-40f4bdf8347d /boot ext4 defaults 1电脑 2

UUID=ff7ab69d-bdc2-40cd-816f-8c30a3e76737 swap swap defaults 0 0

tmpfs /dev/shm tmpfs defaults 0 0

devpts /dev/pts devpts gid=5,mode=620 0 0

sysfs /sys sysfs defaults 0 0

proc /proc proc defaults 0 0

/dev/sdb1 /tmp ext4 defaults 0 0

~

"/etc/fstab" 16L, 841C written


[root@GW ~]# mount -a #检测挂载是否有问题


[root@GW ~]# tune2fs -c -1 /dev/sdb1

tune2fs是调整和查看ext2/ext3文件系统的文件系统参数,Windows下面如果出现意外断电死机情况,下次卡机一般都会出现系统自检。Linux系统下面也有文件系统自检,而且是可以通过tune2fs命令,自定义自检周期及方式

现在我们在模拟一下,将硬盘用parted分区

电脑

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

[root@GW ~]# parted /dev/sdb

GNU Parted 2.1

Using /dev/sdb

Welcome to GNU Parted! Type 'help' to view a list of commands.

(parted) help

align-check TYPE N check partition N for TYPE(min|opt) alignment

check NUMBER do a simple check on the file system

cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another partition

help [COMMAND] print general help, or help on COMMAND

mklabel,mktable LABEL-TYPE create a new disklabel (partition table)

mkfs NUMBER FS-TYPE make a FS-TYPE file system on partition 电脑 NUMBER

mkpart PART-TYPE [FS-TYPE] START END make a partition

mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system

move NUMBER START END move partition NUMBER

name NUMBER NAME name partition NUMBER as NAME

print [devices|free|list,all|NUMBER] display the partition table, available devices, free space, all found partitions, or a

particular partition

quit exit program

rescue START END rescue a lost partition near START and END

resize NUMBER START END resize partition NUMBER and its file system

rm NUMBER delete partition NUMBER

select DEVICE choose the device to edit

set NUMBER FLAG STATE change the FLAG on partition NUMBER

toggle [NUMBER [FLAG]] toggle the state of FLAG on partition NUMBER

unit UNIT set the default unit to UNIT

version display the version number and copyright information of GNU Parted

(parted) mklabel gpt

Warning: The existing disk label on /dev/sdb will be destroyed and all data on this disk will be lost. Do you want to continue?

Yes/No? y

(parted) p

Model: VMware, VMware Virtual S (scsi)

Disk /dev/sdb: 107MB

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

Partition Table: gpt

Number Start End Size File system Name Flags

(parted) mkpart primary 0 30

Warning: The resulting partition is not properly aligned for best performance.

Ignore/Cancel? I

(parted) p

Model: VMware, VMware Virtual S (scsi)

Disk /dev/sdb: 107MB

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

Partition Table: gpt

Number Start End Size File system Name Flags

1 17.4kB 30.0MB 30.0MB primary

(parted) mkpart logical 30 106

(parted) p

Model: VMware, VMware Virtual S (scsi)

Disk /dev/sdb: 107MB

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

Partition Table: gpt

Number Start End Size File system Name Flags

1 17.4kB 30.0MB 30.0MB primary

2 30.4MB 106MB 75.5MB logical

(parted) q

此时需要将新建分区写入内核 partprobe /dev/sdb

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

[root@GW ~]# parted /dev/sdb p

Model: VMware, VMware Virtual S (scsi)

Disk /dev/sdb: 107MB

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

Partition Table: gpt

Number Start End Size File system Name Flags

1 17.4kB 30.0MB 30.0MB primary

2 30.4MB 106MB 75.5MB logical

[root@GW ~]# mkfs.ext4 /dev/sda1

mke2fs 1.41.12 (17-May-2010)

/dev/sda1 is mounted; will not make a filesystem here!

[root@GW ~]# mkfs.ext4 /dev/sdb1

mke2fs 1.41.12 (17-May-2010)

Filesystem label=

OS type: Linux

Block size=1024 (log=0)

Fragment size=1024 (log=0)

Stride=0 blocks, Stripe width=0 blocks

7328 inodes, 29280 blocks

1464 blocks (5.00%) reserved for the super user

First data block=1

Maximum filesystem blocks=30146560

4 block groups

8192 blocks per group, 8192 fragments per group

1832 inodes per group

Superblock backups stored on blocks:

8193, 24577

Writing inode tables: done

Creating journal (1024 blocks): done

Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 24 mounts or

180 days, whichever comes first. Use tune2fs -c or -i to override.

[root@GW ~]# mkfs.ext4 /dev/sdb2

mke2fs 1.41.12 (17-May-2010)

Filesystem label=

OS type: Linux

Block size=1024 (log=0)

Fragment size=1024 (log=0)

Stride=0 blocks, Stripe width=0 blocks

18432 inodes, 73728 blocks

3686 blocks (5.00%) reserved for the super user

First data block=1

Maximum filesystem blocks=67371008

9 block groups

8192 blocks per group, 8192 fragments per group

2048 inodes per group

Superblock backups stored on blocks:

8193, 24577, 40961, 57345

Writing inode tables: done

Creating journal (4096 blocks): done

Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 32 mounts or

180 days, whichever comes first. Use tune2fs -c or -i to override

最后一行出现了tune2fs -c or -i to override,这个是linux文件系统询问自检的,需要设置tune2fs -c -1 /dev/sdb1 ;tune2fs -c -1 /dev/sdb2这样就不会出现巡检文件系统了


电脑
点击展开全文

相关阅读

win10怎么重置账户密码多少-(win10怎么重置账户密码多少啊)

win10怎么重置账户密码多少(win10怎么重置账户密码多少啊)忘记Windows系统登录密码是一个很常见的问题,如果你因此无法登录系统,那么可以参照《忘记Win10登录密码怎么办?-Windows10.Pro》重置微软帐户和本地帐户密码。如果你设置了Win10自动登录能够进入系...

2022-12-13

windows7mbr修复-(win10mbr修复)

windows7mbr修复(win10mbr修复).什么是MBR,MBR损坏如何恢复?linux主机开机启动,会加载MBR启动引导程序,MBR启动引导程序存在硬盘的0磁道0柱面1扇区的前446字节,而1扇区后64字节存放的分区表,而后面还有两字节存放的是分区表的结束标识符55AA1)模拟MBR引导程序损坏:删除MBR引导程序文件[root@lixianggrub]#rmgrub.confrm:re...

2022-12-13

电脑开机到桌面后蓝屏怎么办-(电脑开机到桌面后蓝屏怎么办啊)

电脑开机到桌面后蓝屏怎么办(电脑开机到桌面后蓝屏怎么办啊)电脑开机后出现蓝屏,相信很多小伙伴都遇到过这种情况。其实造成蓝屏的情况有很多种,比如软件冲突、内存故障、硬盘故障、硬盘引导区错误、文件丢失、中病毒等。电脑今天极姐就教大家3种快速解决的办法。使用最近一次正确配置恢复其实简单的蓝屏故障,是可以自我修复的,例如软件冲突、驱动程序错误、启动区域错误等。如果发现计算机蓝屏,可以先关闭计算机,然后重新...

2022-12-13

雨林木风win7开机密码自动删除-()

雨林木风win7开机密码自动删除()跟我一起,穿越时间!2008年底,制作盗版WindowsXP的雨林木风工作室宣布解散,但直到2014年微软正式停止XP技术支持之时,国内仍然有近2亿的WindowsXP用户,虽然原来的雨林木风解散了,市场上却...

2022-12-13

为什么看不到u盘启动-(为什么看不到u盘启动项)

为什么看不到u盘启动(为什么看不到u盘启动项)u盘启动盘怎么进入PE,今天小编给大家带来的系统u盘的启动教程现在我们看到的呢这一台是联想的笔记本电脑准备工具:u启动u盘启动盘、任意电脑或者笔记本一台现在电脑处于一种关机的状态我们把u盘插入到usb接口然后首先的第一步联想的快捷键是f12我们按下开机键按一...

2022-12-13

191路由网 - 192.168.1.1,192.168.0.1无线路由器设置教程

版权声明:本站的文章和图片来自互联网收集,仅做分享之用如有侵权请联系站长,我们将在24小时内删除