存储表示和误删除恢复

1. SATA 盘在系统中的表示,如果只有一个盘着sda, 两个盘则sdb。。。。。。。
   [root@localhost ~]# fdisk -l
Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 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: 0x000d94e0

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              64        1045     7875584   8e  Linux LVM
2. 一个盘的分区表示
在盘sda下有几个分区则表示为sda1,sda2...... 如上表示
3. 挂载一个分区到一个目录下
 

比如我要挂载 /dev/hda9 到系统中;所以过程应该是这样的;

 

[root@localhost ~]# mkdir /opt/data/ 注:建立挂载点目录;

[root@localhost ~]# mount /dev/hda9 /opt/data/ 注:挂载;
4.挂载信息查询

   [root@localhost ~]# df -lh
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root                       6.5G  646M  5.5G  11% /
tmpfs                 250M     0  250M   0% /dev/shm
/dev/sda1             485M   30M  430M   7% /boot


恢复删除的文件步骤:
参考: http://jingyan.baidu.com/article/2f9b480d6c2bcd41cb6cc223.html
http://www.datazg.net/dongtai/2012-03-23/115.html
最完整的方法见: https://www.ibm.com/developerworks/cn/linux/l-cn-filesrc/
或如我已经下载在115上的“如何恢复_Linux_上删除的文件.pdf

[root@localhost ~]# mkdir test
[root@localhost ~]# ls
anaconda-ks.cfg  install.log  install.log.syslog  test  test.sh
[root@localhost ~]# cd test
[root@localhost test]# :> test.txt
[root@localhost test]# ls
test.txt
[root@localhost test]# rm -f test.txt
[root@localhost test]# ls
[root@localhost test]# debugfs
debugfs 1.41.12 (17-May-2010)
debugfs:  open /dev/mapper/VolGroup-lv_root
debugfs:  quit
[root@localhost test]# ls
[root@localhost test]# pwd
/root/test
[root@localhost test]# debugfs
debugfs 1.41.12 (17-May-2010)
debugfs:  open /dev/mapper/VolGroup-lv_root
debugfs:  ls -d /root/test
 267294  (12) .    257541  (4084) ..   <267295> (4072) test.txt
debugfs:  quite
debugfs: Unknown request "quite".  Type "?" for a request list.
debugfs:  quite
debugfs: Unknown request "quite".  Type "?" for a request list.
debugfs:  quit
[root@localhost test]# dd if=/dev/mapper/VolGroup-lv_root of=/tmp/text.bak bs=4096 count=1 skip=267295
1+0 records in
1+0 records out
4096 bytes (4.1 kB) copied, 0.000375655 s, 10.9 MB/s
[root@localhost test]# cd /tmp
[root@localhost tmp]# ls
text.bak  yum.log
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值