zoukankan      html  css  js  c++  java
  • Linux分区管理

    Using fdisk to create a partition

    1.Type fdisk -l to view a list of all the partitions on all hard drives. Notice the empty hard drive (/dev/sdb) where no partitions are defined. 


    Linux 分区管理(图一)


    2.Type fdisk /dev/sdb to open the Linux fdisk program with the second hard drive as the target. 


    Linux 分区管理(图二)
    3.Type n to create a new partition on the drive. 


    Linux 分区管理(图三)
    4.Type p to designate the new partition as a primary partition. e can be selected if an extended partition needs to be created. 


    Linux 分区管理(图四)
    5.Type 1 to create the first partition on the hard disk. To create other partitions, type the appropriate number. 


    Linux 分区管理(图五)
    6.Type 1 to start the new partition on the first hard drive cylinder. When adding more partitions, the first cylinder available will be the default. 


    Linux 分区管理(图六)
    7.Type 1 and press [Enter] to start the new partition on the first hard drive cylinder. When adding more partitions, the first available cylinder will be the default. Type in the last cylinder or define the size of the new partition by typing +500M for a 500mb partition. Substitute the number for your desired partition size. Press [Enter] when finished. 


    Linux 分区管理(图七)
    8.Type t to set the partition type. 


    Linux 分区管理(图八)
    9.Type 1 to signify the partition that needs the partition type assigned. Next, type the hex partition identifier for the new partition. Type L to get a list of available partition types, if the partition hex number isn't known. 


    Linux 分区管理(图九)
    10.Notice that the Linux native partition type is 83 and the Linux swap partition type is 82. 


    Linux 分区管理(图十)
    11.Type 83 to set the partition hex code to Linux native. 


    Linux 分区管理(图十)
    12.Type w to write the new partition information to the MBR of the hard drive. 
     
    The partition configuration in fdisk is done in memory. Nothing is written to the MBR of the hard drives until the w command is issued.


    Linux 分区管理(图十二)


    Creating a Filesystem

    13.Type mkfs -t ext2 /dev/sdb1 to create an ext2 filesystem on the first partition of the second hard drive. Substitute the drive and partition numbers if working with a partition other than /dev/sdb1. 
     
    Converting to ext3 - a partition must be an ext2 partition before converting it to ext3. After creating the ext2 partition, type tune2fs -j [device-partition]. This will convert the partition to ext3. From this point on, the partition will need to be mounted as ext3 for journaling functionality.


    Linux 分区管理(图十三)
    14.Type mkdir /mnt/data to create a new mount point for the new partition. 


    Linux 分区管理(图十四)
    15.Type mount /dev/sdb1 /mnt/data to mount the partition. Substitute the drive, partition numbers and mount point if working with a partition other than /dev/sdb1 and /mnt/data. 


    Linux 分区管理(图十五)
    16.Add an entry in the /etc/fstab file to mount the partition automatically on bootup. 


    Linux 分区管理(图十六)

    NOTE:The source of the blog can't be found.

  • 文章声明
  • 作者:Owen
  • 出处: http://www.cnblogs.com/owenyang
  • 本文版权归作者,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。该博客同步发在 HEXO-博客
查看全文
  • 相关阅读:
    ddl(数据定义语言) ,dml (数据操控语言),dcl(数据控制语言)
    集合框架
    泛型(模拟list)
    Clone
    线程问题以及调用
    面向对象(封装、继承、多态、抽象)
    SpringMVC的四个核心接口
    VUE项目报错 This is probably not a problem with npm. There is likely additional logging output above.
    debian java8 cacerts 证书的丢失
    yii2 ,thinkphp的伪静态
  • 原文地址:https://www.cnblogs.com/owenyang/p/3579073.html
  • Copyright © 2011-2022 走看看