最新消息:宝塔服务器面板,一键全能部署及管理,送你3188元礼包,点我领取

Linux服务器下添加磁盘

云计算 admin 48浏览 0评论

今天有朋友送我一台闲置的服务器,自身8g,外加一个70g的磁盘,研究了很久才挂载上,下面放出我的挂载过程。

Linux下云服务器挂载硬盘

首先看一下配置:

# fdisk -l

Disk /dev/sda: 10.7 GB, 10737418240 bytes, 20971520 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x000f1903

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 1026047 512000 83 Linux
/dev/sda2 1026048 20971519 9972736 8e Linux LVM

  • Disk /dev/sdb: 75.2 GB, 75161927680 bytes, 146800640 sectors
  • Units = sectors of 1 * 512 = 512 bytes
  • Sector size (logical/physical): 512 bytes / 4096 bytes
  • I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  • Disk label type: dos
  • Disk identifier: 0xf7ff5b54

Device Boot Start End Blocks Id System
/dev/sdb1 2048 146800639 73399296 83 Linux

Disk /dev/mapper/centos-root: 9093 MB, 9093251072 bytes, 17760256 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/mapper/centos-swap: 1073 MB, 1073741824 bytes, 2097152 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

磁盘信息就是这个样子,上面的70g的磁盘已经加粗,所以我们可以直接对其格式化:

mkfs -t ext3 /dev/sdb

如果不分区的话直接一路不用管就行了,像我这样:

# mkfs -t ext3 /dev/sdb
mke2fs 1.42.9 (28-Dec-2013)
/dev/sdb is entire device, not just one partition!
Proceed anyway? (y,n) y
Discarding device blocks: done
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
4587520 inodes, 18350080 blocks
917504 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
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: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

这就完事了,之后找个目录挂载就完事了。

mount /dev/sdb /www

感谢 凨神传说  的文章:传送门

转载请注明:网红IT » Linux服务器下添加磁盘

发表我的评论
取消评论
表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址