linux下恢复硬盘分区数据

今天下午在linux 下删除操作,想安装oracle 数据库,整理硬盘的时候用fdisk 重新划分分区,我的硬盘分区表是这样的:
QUOTE
# fdisk -l /dev/hda
Disk /dev/hda
82.3 GB 82348277760 bytes 255 heads 63 sectors/track 10011 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Device
 Boot  Start   End    Blocks   Id  System /dev/hda1  *    1    1044   8385898+   7  HPFS/NTFS  C/dev/hda2    1045    1057   104422+   83  Linux  /boot /dev/hda3    1058    1249  1542240   82  Linux swap /dev/hda4    1250    10011 70380765   f  W95 Extd LBA
/dev/hda8
   1250    2032   6289384+   83  Linux  /usr /dev/hda9    2033    2293   2096451   83  Linux  /tmp /dev/hda10    2294    2554   2096451   83  Linux  /var /dev/hda11    2555    2746   1542208+   83  Linux  / /dev/hda12    2747    3046   2409718+   83  Linux  /home /dev/hda5    3047    3189   1025860+   83  Linux not used /dev/hda6    3190    3380   2048108+   83  Linux not used /dev/hda7    3381    3670   2048108+   83  Linux not used /dev/hda13    3671   6287    21021021   b  W95 FAT32 D/dev/hda14    6288   10011   29912998+   b  W95 FAT32 E :我想把第567 分区删除然后重新建立两个分区,分别安装oracle 数据库程序文件和数据库文件,我用fdisk 是这样操作的:
QUOTE
# fdisk /dev/hda
The number of cylinders for this disk is set to 10011. There is nothing wrong with that
but this is larger than 1024and could in certain setups cause problems with1 software that runs at boot time e.g. old versions of LILO
2
booting and partitioning software from other OSse.g. DOS FDISK OS/2 FDISK
Command
m for help ): d Partition number 1-13 ): 5
Command
m for help ): d Partition number 1-12 ): 6
Command
m for help ): d Partition number 1-11 ): 7
Command
m for help ): w 退出fdisk 后才发现删错了,竟然把第579 分区删除了!其中hda928G ,里面存了好多有价值的东西,难受死我了!这才想起来fdisk 在每一次删除分区后都会自动把后面的分区重新排序,即:删除第5 分区时,第6 分区变成5 ,第7 分区成为6……
郁闷!……
天无绝人之路:我想到今天早上刚刚把hda 的分区表备份了,并且放到了其它分区!也没有细想,把那个备份拿过来就开始恢复硬盘分区(别笑话我啊):
QUOTE
#dd if=hda-2006-03-21.mbr of=/dev/hda bs=512 count=1 #reboot 重启电脑用fdisk 再看分区表—— 没有效果!
怎么回事?从分区表开始想—— 太简单了—— 分区表只有512 字节,其中只有64 字节存储分区信息,开始的时候硬盘容量很小,64 字节够用了,后来随着硬盘空间增大显得不够了,因此开始有了扩展分区,而我删除的分区正好都在扩展分区内!恢复mbr 肯定是不行的了!
怎么办啊!!!从硬件管理器盯着我的hda 看了半天!发现我删除的分区都是几个独立的空间,就想能不能重新建立我的逻辑分区表来恢复分区内容呢???一不做二不休,反正没有别的办法了,试试吧!
QUOTE
# fdisk /dev/hda
The number of cylinders for this disk is set to 10011. There is nothing wrong with that
but this is larger than 1024and could in certain setups cause problems with1 software that runs at boot time e.g. old versions of LILO
2
booting and partitioning software from other OSse.g. DOS FDISK OS/2 FDISK
Command
m for help ): n First cylinder 3047-10011 default 3047 ):Using default value 3047 Last cylinder or +size or +sizeM or +sizeK 3047-3189default 3047 ):Using default value 3047
Command
m for help ): n First cylinder 3381-10011 default 3670 ):Using default value 3670 Last cylinder or +size or +sizeM or +sizeK 3381-3670 default 3670 ):Using default value 3670
Command
m for help ): n First cylinder 6288-10011 default 628Using default value 6288 Last cylinder or +size or +sizeM or +sizeK 6288-10011 default 10011 ):Using default value 10011
Command
m for help ): t Partition number 1-14 ): 14 Hex code type L to list codes ): b
Command
m for help ): w 接下来该干什么呢?按照常规应该是mkfs.vfat 啦!可是为什么呢?如果只是建立分区表来恢复数据,那么这么做不就是重新建立文件分配表了吗?!绝对不行

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值