原文网址:https://www.youyong.top/article/1158e50d79cd
Linux服务器在挂载磁盘或者分区之前,需要对磁盘获取分区进行格式化。如果没有格式化,进行挂载会报错:
1)mount /dev/xvdc /mnt/
2)mount: you must specify the filesystem type
原文网址:https://www.youyong.top/article/1158e50d79cd
Linux服务器在挂载磁盘或者分区之前,需要对磁盘获取分区进行格式化。如果没有格式化,进行挂载会报错:
1)mount /dev/xvdc /mnt/
2)mount: you must specify the filesystem type
原文网址:https://www.youyong.top/article/1158e50d79cd
如果磁盘或者分区已经格式化,那么会生成文件系统,否则不会生成文件系统。所以,使用可以查看磁盘或者分区是否有文件系统来判断是否格式化。
比如:
[root@xxxxx ~]# fdisk -l
Disk /dev/xvda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 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: 0x00078f9c
Device Boot Start End Blocks Id System
/dev/xvda1 * 1 2611 20970496 83 Linux
Disk /dev/xvdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 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
[root@xxxxx ~]# parted /dev/xvdb
GNU Parted 2.1
Using /dev/xvdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Error: /dev/xvdb: unrecognised disk label
(parted)
可以看到 /dev/xvdb 这个磁盘没有分区(unrecognised disk label)。
如果使用 fdisk /dev/xvdb 进行分区,格式化 /dev/xvdb1 后,是可以看到具体的文件系统为 ext3。
[root@xxxxx ~]# parted /dev/xvdb1
GNU Parted 2.1
Using /dev/xvdb1
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Model: Unknown (unknown)
Disk /dev/xvdb1: 5379MB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Number Start End Size File system Flags
1 0.00B 5379MB 5379MB ext
共 0 条留言