Linux-mount
linux挂载相关命令
注意挂载操作不要在挂载目录里面操作
1 | 查看磁盘分区情况 |
hyper-v centos挂载其他vhd 硬盘
mount: unknown filesystem type 'LVM2_member'
1 | fdisk -l |
腾讯云初始化和挂载硬盘
fdisk -l
查看磁盘, 如果没有输出硬盘检查云盘状态是否已挂载1
Disk /dev/vdb: 107.4 GB, 107374182400 bytes, 209715200 sectors
fdisk /dev/vdb
创建新分区依次输入“n”(新建分区)、“p”(新建主分区)、“1”(使用第1个主分区),两次回车(使用默认配置),输入“wq”(保存分区表)1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x45f0094c.
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-209715199, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-209715199, default 209715199):
Using default value 209715199
Partition 1 of type Linux and of size 100 GiB is set
Command (m for help): wq
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.fdisk -l
检查1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19Disk /dev/vda: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000c5e30
Device Boot Start End Blocks Id System
/dev/vda1 * 2048 104857599 52427776 83 Linux
Disk /dev/vdb: 107.4 GB, 107374182400 bytes, 209715200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x45f0094c
Device Boot Start End Blocks Id System
/dev/vdb1 2048 209715199 104856576 83 Linuxmkdir /data
如果没有创建挂载目录mkfs.ext3 /dev/vdb1
格式化硬盘mount /dev/vdb1 /data
设置挂载vim /etc/fstab
设置开机启动自动挂载,fstab追加行1
/dev/vdb1 /data ext3 defaults 0 0
青云centos7.8挂载扩容docker目录
1 | # 分区 n ——>p ——>1 ——>回车 ——>回车 ——>w |
参考
How to Mount a NTFS Drive on CentOS / RHEL / Scientific Linux