您的位置:首页 > 其它

存储表示和误删除恢复

2013-08-29 09:00 190 查看
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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: