BLOG


一些关于ubuntu linux数据恢复常用命令

更新时间:2018-11-07

浏览次数:746

Tags: , , , ,

一些关于ubuntu linux数据恢复常用命令

ubuntu linux查看存储器,分区,容量大小,文件系统格式命令

命令


lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL

参数你这次是:分区名称,分区格式,分区大小,挂载点,标签。

root@ubuntu:~# lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL
NAME   FSTYPE  SIZE MOUNTPOINT     LABEL
loop0  squash 87.9M /snap/core/566 
loop2  squash 87.9M /snap/core/554 
loop3  squash 87.9M /snap/core/574 
sda             60G                
├─sda1           1M                
└─sda2 ext4     60G /              
sr0           1024M                
sr1    iso966 51.1M

另一个命令


df -h

root@ubuntu:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            1.5G     0  1.5G   0% /dev
tmpfs           301M  2.5M  298M   1% /run
/dev/sda2        59G  5.7G   51G  11% /
tmpfs           1.5G     0  1.5G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           1.5G     0  1.5G   0% /sys/fs/cgroup
/dev/loop2       88M   88M     0 100% /snap/core/5548
/dev/loop0       88M   88M     0 100% /snap/core/5662
/dev/loop3       88M   88M     0 100% /snap/core/5742
tmpfs           301M     0  301M   0% /run/user/1000

root@ubuntu:~$ dmesg | grep tty
[    0.000000] console [tty0] enabled
[    0.696002] 00:06: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
[   11.432689] usb 3-9: cp210x converter now attached to ttyUSB0


    +-----[configuration]------+
            | Filenames and paths      |
            | File transfer protocols  |
            | Serial port setup        |
            | Modem and dialing        |
            | Screen and keyboard      |
            | Save setup as dfl        |
            | Save setup as..          |
            | Exit                     |
            | Exit from Minicom        |
            +--------------------------+



选择第三项设置 “Serial port setup”

+-----------------------------------------------------------------------+
    | A -    Serial Device      : /dev/ttyUSB0                              |
    | B - Lockfile Location     : /var/lock                                 |
    | C -   Callin Program      :                                           |
    | D -  Callout Program      :                                           |
    | E -    Bps/Par/Bits       : 38400 8N1                                 |
    | F - Hardware Flow Control : Yes                                       |
    | G - Software Flow Control : No                                        |
    |                                                                       |
    |    Change which setting?                                              |
    +-----------------------------------------------------------------------+

#按A设置USB端口,通常是USB0,记得USB要大写,改完后按回车。
然后再按E选项速率“E – Bps/Par/Bits : 38400 8N1 ‘


                      +-------------------+----------------+
                      |                                    |                
                      |     Current: 38400 8N1             |                
                      | Speed            Parity      Data  |                
                      | A:         L: None     S: 5  |                
                      | B:         M: Even     T: 6  |                
                      | C:   9600        N: Odd      U: 7  |                
                      | D:  38400        O: Mark     V: 8  |                
                      | E: 115200        P: Space          |                
                      |                                    |                
                      | Stopbits                           |
                      | W: 1             Q: 8-N-1          |
                      | X: 2             R: 7-E-1          |
                      |                                    |
                      |                                    |
                      | Choice, or  to exit?        |
                      +------------------------------------+

#按相应的字母选择需要的速率。 设置好后按ESC退回菜单

选择 ”Save setup as dfl“ 保存设置
然后“Exit from Minicom ”退出设置。