Linux挂载硬盘教程
买的云服务器发现系统盘空间不足,但是买的时候是80GB,可用只有8GB
问了客服说硬盘没有挂载上
于是有了下面的操作
[root@localhost ~]# lsblk -f
NAME FSTYPE LABEL UUID MOUNTPOINT
fd0
sda
├─sda1 xfs 34f79a00-9e0e-4010-9d60-3718240cca6c /boot
└─sda2 LVM2\_member P6xf6f-NPgl-s3Dm-123h-B5e3-NJBh-GbNM1n
├─centos-root xfs f65437ea-e2e7-4ecd-a451-915233311ab3 /
└─centos-swap swap bb86b211-c24a-4212-9501-d349111c24aa [SWAP]
sdb
sr0
[root@localhost ~]# fdisk /dev/sdb
欢迎使用 fdisk (util-linux 2.23.2)。
更改将停留在内存中,直到您决定将更改写入磁盘。
使用写入命令前请三思。
Device does not contain a recognized partition table
使用磁盘标识符 0x11c8c1af 创建新的 DOS 磁盘标签。
The device presents a logical sector size that is smaller than
the physical sector size. Aligning to a physical sector (or optimal
I/O) size boundary is recommended, or performance may be impacted.
命令(输入 m 获取帮助):m
命令操作
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
g create a new empty GPT partition table
G create an IRIX (SGI) partition table
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
命令(输入 m 获取帮助):n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p):
Using default response p
分区号 (1-4,默认 1):
起始 扇区 (2048-146800639,默认为 2048):
将使用默认值 2048
Last 扇区, +扇区 or +size{K,M,G} (2048-146800639,默认为 146800639):
将使用默认值 146800639
分区 1 已设置为 Linux 类型,大小设为 70 GiB
命令(输入 m 获取帮助):w
The partition table has been altered!
Calling ioctl() to re-read partition table.
正在同步磁盘。
[root@localhost ~]# lsblk -f
NAME FSTYPE LABEL UUID MOUNTPOINT
fd0
sda
├─sda1 xfs 34f79a00-9e0e-4010-9d60-3718240cca6c /boot
└─sda2 LVM2\_member P6xf6f-NPgl-s3Dm-123h-B5e3-NJBh-GbNM1n
├─centos-root xfs f65437ea-e2e7-4ecd-a451-915233311ab3 /
└─centos-swap swap bb86b211-c24a-4212-9501-d349111c24aa [SWAP]
sdb
└─sdb1
sr0
[root@localhost ~]# mkfs -t ext4 /dev/sdb1
mke2fs 1.42.9 (28-Dec-2013)
Discarding device blocks: 完成
文件系统标签=
OS type: Linux
块大小=4096 (log=2)
分块大小=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
4587520 inodes, 18349824 blocks
917491 blocks (5.00%) reserved for the super user
第一个数据块=0
Maximum filesystem blocks=2166358016
560 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424
Allocating group tables: 完成
正在写入inode表: 完成
Creating journal (32768 blocks): 完成
Writing superblocks and filesystem accounting information: 完成
[root@localhost ~]# lsblk -f
NAME FSTYPE LABEL UUID MOUNTPOINT
fd0
sda
├─sda1 xfs 34f79a00-9e0e-4010-9d60-3718240cca6c /boot
└─sda2 LVM2\_member P6xf6f-NPgl-s3Dm-123h-B5e3-NJBh-GbNM1n
├─centos-root xfs f65437ea-e2e7-4ecd-a451-915233311ab3 /
└─centos-swap swap bb86b211-c24a-4212-9501-d349111c24aa [SWAP]
sdb
└─sdb1 ext4 f78eb13e-a5aa-46cb-839b-940defcd9dd2
sr0
[root@localhost ~]# mount /dev/sdb1 /www