zoukankan      html  css  js  c++  java
  • linux下挂载磁盘

    1.使用fdisk 查看硬盘信息

    [root@localhost ~]# fdisk -l
    
    Disk /dev/sdb: 107.4 GB, 107374182400 bytes
    255 heads, 63 sectors/track, 13054 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: 0x00000000
    
    
    //Disk /dev/sda: 161.1 GB, 161061273600 bytes
    255 heads, 63 sectors/track, 19581 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: 0x0000955d
    
       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         325     2097152   82  Linux swap / Solaris
    Partition 2 does not end on cylinder boundary.
    /dev/sda3             325       19582   154676224   83  Linux
    [root@localhost ~]# 
    

      

    2.格式化硬盘、挂载硬盘、卸载挂载

    mkfs -t ext4 /dev/sda  //格式化硬盘
    mkdir data //创建挂载目录
    
    
    #mount 硬盘地址  要挂载的地址、需指定文件目录
    #mount /dev/sdb  /data //挂载
    
    #df -h //查看是否挂载
    #umount /dev/sdb  //卸载硬盘挂载
    

      

    3.配置开机自动挂载

    //因为mount挂载在重启服务器后会失效,所以需要将分区信息写到/etc/fstab文件中让它永久挂载:
    [root@oracle /]# vim /etc/fstab
    
    加入:
    /dev/sdb1(磁盘分区)  /data1(挂载目录) ext3(文件格式)defaults  0  0
    

      

    另附:linux硬盘分区:http://blog.chinaunix.net/uid-25829053-id-3067619.html

  • 相关阅读:
    JS 字符串
    JS 变量
    JS 数据类型与运算符
    HTML加载动画实现
    DOM Document.readyState 属性
    html中怎么去掉input获取焦点时候的边框
    原生js获取子元素
    CSS3 Animation动画
    slice,substr和substring的区别
    a链接嵌套无效,嵌套链接最优解决办法
  • 原文地址:https://www.cnblogs.com/Alexr/p/9385584.html
Copyright © 2011-2022 走看看