Under linux partition is mounted

Huawei recorded mount virtual machine disk experience .....

Linux fdisk is a program for creating and maintaining the partition table, which is compatible with DOS type partition table, BSD or SUN type of disk list.

fdisk -l displays the current partition, the data see: https://www.runoob.com/linux/linux-comm-fdisk.html

 Seen below, Huawei 2T space allocated, but have not been partitioned. Actually mounts the steps of:

  • Physical space for the partition
  • Create a file system disk partition (xfs / ext)
  • Mounting

 

1. The physical space for the partition

Partitioning can be found:

>>>fdisk  /dev/vdb

>>> Common: m # menu display command

>>> Common: n # to add a new partition

>>> Common: select the prompts (continuous press Enter to select the default option

>>> Common: w # save changes

>>> fdisk -l # to view more partitions, partition device called vdb1

 

2. Create a file system disk partition (xfs / ext)

>>>mkfs.xfs -f /dev/vdb1

xfs and ext Overview:

  1. centos7.0 start is the default file system xfs, centos6 is ext4, centos5 is ext3
  2. ext3 and ext4 biggest difference is that, when the ext3 fsck time-consuming (more files, the longer the time), but in the fsck with ext4 time will be very much less
  3. ext4 is the fourth generation of extended file system (English: Fourth EXtended filesystem, abbreviated as ext4) is the log file system in linux system, is the successor to ext3 file system
  4. ext4的文件系统容量达到1EB,而文件容量则达到16TB,这是一个非常大的数字了。对一般的台式机和服务器而言,这可能并不重要,但对于大型磁盘阵列的用户而言,这就非常重要了。
  5. ext3目前只支持32000个子目录,而ext4取消了这一限制,理论上支持无限数量的子目录
  6. xfs是一种非常优秀的日志文件系统,它是SGI公司设计的。xfs被称为业界最先进的、最具可升级性的文件系统技术
  7. xfs是一个64位文件系统,最大支持8EB减1字节的单个文件系统,实际部署时取决于宿主操作系统的最大块限制。对于一个32位Linux系统,文件和文件系统的大小会被限制在16TB
  8. xfs在很多方面确实做的比ext4好,ext4受限制于磁盘结构和兼容问题,可扩展性和scalability确实不如xfs,另外xfs经过很多年发展,各种锁的细化做的也比较好

一旦创建完文件系统以后,就可以查看此分区的唯一标识UUID(Universally Unique Identifier) 及文件类型

>>>ls -l /dev/disk/by-uuid/  #查看每个设备的唯一标识(UUID)

>>>blkid          #查看blockid及类型

 

3.挂载

  •  /etc/fstab配置挂载选项
  • 执行挂载操作

fstab配置参见:https://blog.csdn.net/lanmolei814/article/details/45692153

 

>>> mount -o ro /dev/vdb1 /data  #以ro(只读)模式挂载后,则/data路径下将无法创建文件

>>>umount /data #如果提示target is busy,可能是/data目录被占用,退出即可,或则用lsof /dev/vdb1查看相关信息

>>>mount -o rw /dev/vdb1 /data

 

 BINGO!!!

 

Guess you like

Origin www.cnblogs.com/rockg/p/11290432.html