centos 6.4下fdisk分区、格式化、挂载新硬盘
centos 6.4下fdisk分区、格式化、挂载新硬盘
1、# fdisk -l
查看当前磁盘信息,就会发现最下面显示新加入的硬盘不是有效分区,如下:
Disk /dev/sdc: 1500.3 GB, 1500301910016 bytes
255 heads, 63 sectors/track, 182401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdc doesn’t contain a valid partition table
2、# fdisk /dev/sdc
对新硬盘分区,并根据提示进一步操作:
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won’t be recoverable.
The number of cylinders for this disk is set to 182401.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0×0000 of partition table 4 will be corrected by w(rite)
=======================================================
Command (m for help): h 输入h可查看帮助命令
h: unknown command
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
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)
=======================================================
Command (m for help): n 输入n进行分区
Command action
e extended
p primary partition (1-4)
p 输入p为主分区,e为逻辑分区
Partition number (1-4): 1 由于是新盘我们输入1来分第一个主分区,共可以分4个主分区
First cylinder (1-182401, default 1): 选择该分区的起始磁盘数,如无特殊需求强烈建议选择默认,也就是1来分区(直接按回车)
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-182401, default 182401):
定义该分区的大小,如果按默认(按回车)即是使用全部可用存储额,如分一个1G的空间,输入+1024m
Using default value 182401
Command (m for help): w 写入分区
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
3、# fdisk -l
可以找到我们刚才分的一个分区,内容如下:
Disk /dev/sdc: 1500.3 GB, 1500301910016 bytes
255 heads, 63 sectors/track, 182401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 182401 1465136001 83 Linux
4、# mkfs -t ext4 -c /dev/sdc1
对分区使用ext3格式化,如多个分区sdc2等以此类推,
因为新硬盘加了-c参数要先检测磁盘坏道,此过程万分漫长(150G),等待。。。
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
183156736 inodes, 366284000 blocks
18314200 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
11179 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000, 214990848
Checking for bad blocks (read-only test): done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 22 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
5、# mkdir /data2
新建挂载目录
6、# mount -t ext4 /dev/sdc1 /data2
挂载新硬盘
7、# df -hal
查看分区大小是否和我们预定的一样:
文件系统 容量 已用 可用 已用% 挂载点
/dev/sda7 9.5G 3.2G 5.9G 35% /
/dev/sda6 9.5G 151M 8.9G 2% /tmp
/dev/sda5 19G 3.6G 15G 20% /usr
/dev/sda3 19G 719M 18G 4% /home
/dev/sda2 230G 23G 196G 11% /var
/dev/sda1 99M 25M 69M 27% /boot
/dev/sdb1 233G 156G 78G 67% /var/samba2
tmpfs 1008M 0 1008M 0% /dev/shm
/dev/sdc1 1.4T 198M 1.3T 1% /var/samba 此行为新硬盘
8、# vi /etc/fstab
设置系统自动挂载硬盘,加入一行:
/dev/sdc1 /data ext4 defaults 0 0
9、重启服务器,用步骤7检查一下,一切正常挂载完成
centos 6.4下fdisk分区、格式化、挂载新硬盘的更多相关文章
- (转)centos7.4 fdisk磁盘分区 格式化 挂载
centos7.4 fdisk磁盘分区 格式化 挂载 原文:http://blog.csdn.net/capecape/article/details/78499351 1.查看系统中有多少可以识别的 ...
- Linux下磁盘分区、挂载、卸载操作记录
Linux下磁盘分区.挂载.卸载操作记录. 操作环境:CentOS release 6.5 (Final) Last :: from 118.230.194.76 [root@CentOS ~]# [ ...
- CentOS创建管理LVM分区(挂载新分区)
来源: CentOS 8.0 创建管理LVM分区(挂载新分区) https://www.iwmyx.cn/centos80cjgllvmfa.html 1.查看可用磁盘 fdisk -l 2.新盘(/ ...
- linux挂载新硬盘并进行分区格式化
最近要给小伙伴们写几篇文章,关于<linux下误删除文件之后该如何恢复>.对于没有进程占用的文件想要进行数据恢复,不同的文件系统格式需要使用不同的工具,比如:ext4.xfs等.我找遍了我 ...
- CentOS添加并挂载新硬盘
1.查看当前硬盘使用状况: [test@master Desktop]$ df -hFilesystem Size Used Avail Use% Mounted on/dev/sda2 13G 12 ...
- 【转】linux挂载新硬盘,开机自动挂载
[转]linux挂载新硬盘,开机自动挂载 ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※ Linux的硬盘识别: 2.6 kernel以后,linux会将 ...
- linux下fdisk分区管理、文件系统管理、挂载文件系统等
分区管理工具有:fdisk, parted, sfdisk fdisk:对于一块硬盘来讲,最多只能管理15分区: # fdisk -l [-u] [device...] 查看硬盘设备分区信息 # f ...
- CentOS ext4 磁盘分区 格式化 挂载
[root@appserver ~]# df -h /*查看现有分区情况*/文件系统 容量 已用 可用 已用%% 挂载点/dev/vda1 9.9G 8.2G 1.2G 88% /tmpfs 3.9G ...
- Linux磁盘分区/格式化/挂载(树莓派3挂载硬盘)
[前言] 本文将要讲解的功能为Linux环境下对磁盘进行操作.包括分区.格式化.挂载外接移动存储设备等. 该文的写作背景为本人的树莓派需要外接一个固态硬盘作为存储设备,因此,便开始了一系列的折腾. [ ...
- Linux下快速分区格式化大于2T磁盘存储
在生产环境中,我们会遇到分区大于2T的磁盘(比如:添加一个10TB的存储),由于MBR分区表只支持2T磁盘,所以大于2T的磁盘必须使用GPT分区表,而我们在做raid时会划分多个VD来进行装系统,但系 ...
随机推荐
- element_ui实现表格内套表单,点击可以编辑
<template> <div class="app-container"> <el-table :data="list" str ...
- [.Net]使用Soa库+Abp搭建微服务项目框架(一):Abp与DDD相关知识回顾
在企业中大型项目中,随着业务的不断拓展,项目发展到一定程度,需要寻求项目的各模块解耦,独立成为微服务.如何实现呢? 首先我们先来简单回顾一下Abp框架怎样实现(DDD)领域驱动设计的,Abp框架的 ...
- 心电芯片ADS1292 KS1081 AD8232等的比较
首先看ADS1292, 从品牌和信誉,TI出品,这个来说应该是相对好一点的,医疗级水准的信号.内置24位的ADC,,噪声和整体功能都很全面,放大倍数1-12倍.应用在穿戴场合的缺点是:这个芯片封装尺寸 ...
- Navicat 15 最新破解版下载_永久激活注册码(附图文安装教程)
Navicat 15 最新破解版下载_永久激活注册码(附图文安装教程) 欢迎关注博主公众号「java大师」, 专注于分享Java领域干货文章, 关注回复「资源」, 免费领取全网最热的Java架构师学习 ...
- 逆向通达信Level-2 续九 (无帐号打开itrend研究版)
此itrend研究版的版本比较旧. 本篇演示三图,用例进程同为0x4970. 1. itrend不支持脱机,游客登陆.没有帐号不能打开.现在以无帐号打开. 2. itrend支持高清,当打开主界面就会 ...
- AOSP源码编译—交换空间扩容
编译AOSP源码的时候会出现提示如下: 意思是需要16G左右的内存(实际上编译会超过16G),而我们之前安装Ubuntu的时候只分配了8G,编 译一定会失败!此时需要添加虚拟内存(swap交换空间) ...
- 20_使用SDL显示BMP图片
文本的主要内容是:使用SDL显示一张BMP图片,算是为后面的<显示YUV图片>做准备. 为什么是显示BMP图片?而不是显示JPG或PNG图片? 因为SDL内置了加载BMP的API,使用起来 ...
- C++中虚表是什么
虚函数表,以及虚函数指针是实现多态性(Polymorphism)的关键机制.多态性允许我们通过基类的指针或引用来调用派生类的函数 定义 虚函数(Virtual Function) 定义:类中使用vir ...
- WPF设置传参、点击按钮改变长度
前台代码 <!-- 通过传递ElementName --> <Button x:Name="btn1" Width="200" Height= ...
- 一款超酷、功能强大的一体化网站测试工具:Web-Check
今天给大家一款网站一体化测试工具:Web-Check! Web-Check 是一款功能强大的一体化工具,用于发现网站/主机的相关信息.用于检查网页的工具,用于确保网页的正确性和可访问性.它可以帮助开发 ...