linux磁盘挂载
Posted Davygeek
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了linux磁盘挂载相关的知识,希望对你有一定的参考价值。
大部分机器是做的raid5和raid10,分别做了vd1:100G,vd2:其余容量(大于2T)。
针对大于2T的盘的挂载,可以参考下面的操作方法:
1、parted分区
parted /dev/sdb GNU Parted 3.1 使用 /dev/sdb Welcome to GNU Parted! Type ‘help‘ to view a list of commands. (parted) mklabel gpt 警告: The existing disk label on /dev/sdb will be destroyed and all data on this disk will be lost. Do you want to continue? 是/Yes/否/No? yes (parted) mkpart primary 0-1 结束点? 结束点? y 错误: Invalid number. (parted) mkpart primary 0 -1 警告: The resulting partition is not properly aligned for best performance. 忽略/Ignore/放弃/Cancel? Ignore (parted) p Model: DELL PERC H730 Mini (scsi) Disk /dev/sdb: 4089GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags: Number Start End Size File system Name 标志 1 17.4kB 4089GB 4089GB primary (parted) quit
信息: You may need to update /etc/fstab.
2、格式化挂载:
mkfs.xfs /dev/sdb1 meta-data=/dev/sdb1 isize=256 agcount=4, agsize=249601962 blks = sectsz=512 attr=2, projid32bit=1 = crc=0 finobt=0 data = bsize=4096 blocks=998407847, imaxpct=5 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0 ftype=0 log =internal log bsize=4096 blocks=487503, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 [[email protected]-R12-302F0412-I37-51 ~]# mkdir /export [[email protected]-R12-302F0412-I37-51 ~]# mount /dev/sdb1 /export/ [[email protected]-R12-302F0412-I37-51 ~]# df -h 文件系统 容量 已用 可用 已用% 挂载点 /dev/sda2 84G 1.6G 83G 2% / devtmpfs 63G 0 63G 0% /dev tmpfs 63G 0 63G 0% /dev/shm tmpfs 63G 9.0M 63G 1% /run tmpfs 63G 0 63G 0% /sys/fs/cgroup /dev/sdb1 3.8T 33M 3.8T 1% /export 抓取磁盘的uuid,然后配置到fstab文件内 [[email protected]-R12-302F0412-I37-51 ~]# blkid /dev/sdb1 /dev/sdb1: UUID="b1dc2ce3-c73c-404d-96fa-825bf2883a3c" TYPE="xfs" PARTLABEL="primary" PARTUUID="8f19fd33-a236-4f88-b58a-8e6a772d19d5" [[email protected]-R12-302F0412-I37-51 ~]# vim /etc/fstab [[email protected]-R12-302F0412-I37-51 ~]# cat /etc/fstab # # /etc/fstab # Created by anaconda on Wed Sep 23 13:13:52 2015 # # Accessible filesystems, by reference, are maintained under ‘/dev/disk‘ # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info # UUID=114e0106-7682-49da-85dc-f3f915c60f20 / xfs defaults 0 0 UUID=b2556164-aa91-4753-9236-9690b5b1e40f swap swap defaults 0 0 UUID=b1dc2ce3-c73c-404d-96fa-825bf2883a3c /export xfs defaults 1 2
以上是关于linux磁盘挂载的主要内容,如果未能解决你的问题,请参考以下文章