我是靠谱客的博主 曾经超短裙,最近开发中收集的这篇文章主要介绍空白硬盘(不分区)挂载方式1、查看所有硬盘状况2、格式化新加硬盘3、修改/etc/fstab4、使/etc/fstab生效,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

1、查看所有硬盘状况

fdisk -l

Disk /dev/vda: 40 GiB, 42949672960 bytes, 83886080 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
Disklabel type: dos
Disk identifier: 0x586e0d2f
Device
Boot Start
End
Sectors Size Id Type
/dev/vda1
*
2048 83886046 83883999
40G 83 Linux
Disk /dev/vdc: 1 TiB, 1099511627776 bytes, 2147483648 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

2、格式化新加硬盘

mkfs.ext4 /dev/vdc

# 使用ext4格式化空白硬盘 filesystem ext4
mke2fs 1.42.13 (17-May-2015)
/dev/vdc contains a ext4 file system
last mounted on Thu Dec 14 07:16:20 2017
Proceed anyway? (y,n) y
Creating filesystem with 268435456 4k blocks and 67108864 inodes
Filesystem UUID: 9c12e85e-6f1f-4bfe-afa6-13fa0b37657c
Superblock backups stored on blocks: 
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000, 214990848
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done 

3、修改/etc/fstab

vi /etc/fstab

uuid 是硬盘的唯一标识,而/dev/vda(b,c,d,e)是根据磁盘连接顺序来接入的,序号可能发生改变,uuid通过 blkid 查看
添加一行:

UUID=9c12e85e-6f1f-4bfe-afa6-13fa0b37657c /var/lib/elasticsearch ext4 defaults 0 0

4、使/etc/fstab生效

mount -a

最后

以上就是曾经超短裙为你收集整理的空白硬盘(不分区)挂载方式1、查看所有硬盘状况2、格式化新加硬盘3、修改/etc/fstab4、使/etc/fstab生效的全部内容,希望文章能够帮你解决空白硬盘(不分区)挂载方式1、查看所有硬盘状况2、格式化新加硬盘3、修改/etc/fstab4、使/etc/fstab生效所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(62)

评论列表共有 0 条评论

立即
投稿
返回
顶部