- 环境介绍
- 增加步骤
- 浏览: 65131 次
- 性别:
- 来自: 北京
文章分类
最新评论
一、环境介绍
原主机有500G硬盘,现在新增一颗2T硬盘。
二、增加步骤
- 查看硬盘
- 新建分区
- 格式化
- 挂载使用
- 设置开机自动挂载
1.查看硬盘
# fdisk -l Disk /dev/sda: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 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: 0xba24d924 Device Boot Start End Blocks Id System /dev/sda1 * 1 26 204800 83 Linux Partition 1 does not end on cylinder boundary. /dev/sda2 26 287 2097152 82 Linux swap / Solaris Partition 2 does not end on cylinder boundary. /dev/sda3 287 60802 486083584 83 Linux Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes 255 heads, 63 sectors/track, 243201 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0x97d16691 Device Boot Start End Blocks Id System
可见一颗sdb硬盘2T存在系统中,但未被格式化。
2.新建分区
使用fdisk命令对新增的sdb硬盘进行操作
# fdisk /dev/sdb 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. WARNING: DOS-compatible mode is deprecated. It's strongly recommended to switch off the mode (command 'c') and change display units to sectors (command 'u'). Command (m for help): p #查看此颗硬盘分区状况 Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes 255 heads, 63 sectors/track, 243201 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0x97d16691 Device Boot Start End Blocks Id System Command (m for help): n #新建分区 Command action e extended p primary partition (1-4) p #新建原始分区 Partition number (1-4): 1 #分区编号 First cylinder (1-243201, default 1): 1#从第一个扇区开始 Last cylinder, +cylinders or +size{K,M,G} (1-243201, default 243201): #直接回车使用所有空间 Using default value 243201 Command (m for help): p#再次查看分区情况 Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes 255 heads, 63 sectors/track, 243201 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0x97d16691 Device Boot Start End Blocks Id System /dev/sdb1 1 243201 1953512001 83 Linux Partition 1 does not start on physical sector boundary. Command (m for help): w#保存分区 The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks.
再次使用fdisk命令查看服务器硬盘情况
# fdisk -l Disk /dev/sda: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 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: 0xba24d924 Device Boot Start End Blocks Id System /dev/sda1 * 1 26 204800 83 Linux Partition 1 does not end on cylinder boundary. /dev/sda2 26 287 2097152 82 Linux swap / Solaris Partition 2 does not end on cylinder boundary. /dev/sda3 287 60802 486083584 83 Linux Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes 255 heads, 63 sectors/track, 243201 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0x97d16691 Device Boot Start End Blocks Id System /dev/sdb1 1 243201 1953512001 83 Linux Partition 1 does not start on physical sector boundary.
此时可以看见新建的sdb1分区,还需要格式化才能使用。
3.格式化
使用mkfs命令将新增硬盘格式化为ext3格式
# mkfs.ext3 /dev/sdb1 mke2fs 1.41.12 (17-May-2010) /dev/sdb1 alignment is offset by 512 bytes. This may result in very poor performance, (re)-partitioning suggested. Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=1 blocks, Stripe width=0 blocks 122101760 inodes, 488378000 blocks 24418900 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=0 14905 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, 20480000, 23887872, 71663616, 78675968, 102400000, 214990848 Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 20 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override.
4.挂载使用
# mkdir /eda_bak #建立新挂载点 # mount /dev/sdb1 /eda_bak #挂载使用此硬盘 # mount #查看系统挂载情况 /dev/sda3 on / type ext3 (rw) proc on /proc type proc (rw) sysfs on /sys type sysfs (rw) devpts on /dev/pts type devpts (rw,gid=5,mode=620) tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0") /dev/sda1 on /boot type ext3 (rw) none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw) gvfs-fuse-daemon on /root/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev) /dev/sdb1 on /eda_bak type ext3 (rw) # df -h #查看使用空间 Filesystem Size Used Avail Use% Mounted on /dev/sda3 457G 3.0G 431G 1% / tmpfs 995M 260K 994M 1% /dev/shm /dev/sda1 194M 26M 158M 15% /boot /dev/sdb1 1.8T 196M 1.7T 1% /eda_bak
5.设置开机自动挂载
# vi /etc/fstab 增加 /dev/sdb1 /eda_bak ext3 defaults 1 2
至此、完成。
发表评论
-
CentOS Too many open files
2013-12-13 16:50 968打开Terminal提示下列报错 There was a ... -
vi/vim 快捷操作
2013-12-02 11:45 553删除空行 :g/^$/d 替换空格为回车 :s ... -
firefox is already running
2013-11-25 12:43 670出现firefox is already running的 ... -
Kernel Panic - not syncing: Attempted to kill init!
2013-11-19 16:58 815Ghost CentOS新系统后提示报错: Ker ... -
Yum 参数
2013-11-19 14:43 6031.使yum安装i686以及X86_64全部软件包 vim ... -
CentOS 释放内存
2013-11-18 15:59 1497内存占用原因当读写文件的时候,Linux内核为了提高读写性 ... -
no device found for connection 'System eth0'
2013-11-15 14:55 904使用cloneZlia Ghost CentOS系统后,启动 ... -
CentOS 内核裁剪
2013-11-11 19:18 18361.下载系统对应内核版本 https://www.kern ... -
CentOS 安装网卡驱动
2013-11-11 17:15 12771.查看网卡型号 # lspci00:00.0 Hos ... -
CentOS 安装显卡驱动
2013-11-11 16:44 20031.查看CentOS显卡型号 # lspci 0 ... -
No package 'gtk+-2.0' found
2013-11-07 17:30 885编译安装Gtk2提示 No package 'gtk+-2 ... -
No package 'cairo' found
2013-11-07 17:16 1030编译安装Cairo提示 No package 'cairo ... -
fsck.ext3 no such file or directory while trying to open /dev/sdb1
2013-10-28 19:25 2245问题现象 解决步骤 一、问题现象 启动linux主 ... -
Yum Warning: RPMDB altered outside of yum.
2013-10-15 10:33 1583错误现象 解决步骤 一、错误现象 # yum -y ... -
Ubuntu 10.04 强制关机Target filesystem doesn't have /sbin/init错误
2013-09-29 11:31 1741错误现象 解决步骤 一、错误现象 Ub ... -
Centos 挂载NTFS格式硬盘
2013-09-10 11:27 839背景说明 挂载方法 一、背景说明 ... -
checking for UNITY... configure: error: Package requirements
2013-09-02 13:01 1698问题现象 解决方法 一、问题现象 编 ...
相关推荐
Centos7挂载硬盘说明详细操作步骤,添加完成直接生效,无需重启服务器
VMware虚拟机,CentOS7系统,添加、格式化、挂载硬盘详细教程
Linux磁带备份,所以我先添加一块硬盘,并相应的建立分区,格式化,然后挂载使用。下面看我操作的步骤: 1.先用Fdisk -l 来查看当前状态下磁盘情况 [root@aaaa ~]# fdisk -l Disk /dev/sda: 300.0 GB, ...
CentOS在不重启的情况下为其虚拟机添加新硬盘的教程.docx
主要介绍了使用VMware为centos添加硬盘,在现有系统上加一块硬盘,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
CentOS55添加一块新硬盘,分区并设置系统启动自动挂载的方法.doc
centos7建LVM添加硬盘及扩容.doc
fdisk /dev/sdb //这里的sdb是新添加出来的硬盘 n //添加新分区 p //创建主分区 1 分区号1 按回车 //起始扇区选择默认 也是回车默认 //为了不浪费空间 p //查看创建出来的分区 w //保存 格式化分区 格式化为ext4 ...
VMware虚拟机CentOS 7 磁盘扩容
Linux 作为一款开源免费的...单击这个就是删除了—>单击“Remove”左边的“Add…(添加)”,下一步,“Hard Disk”(硬盘),Create a new vitual disk(创建一个新的虚拟硬盘),下一步,选择IDE,然后下一步就OK了。
本篇文章主要介绍了详解如何在 CentOS 7 中添加新磁盘而不用重启系统,具有一定的参考价值,感兴趣的小伙伴们可以参考一下。
rescan-scsi-bus.sh 博文链接:https://lht.iteye.com/blog/699986
系统提示我容量不足 就利用LVM的方式进行扩容吧。 系统是RHEL7(centos7差不多一样) 先查看磁盘信息及根目录 fdisk -l 注意:sda为硬盘,需要扩容的是系统的根目录,这里RHEL的系统根目录为/dev/...n //添加新分区
找到新添加的磁盘的编号为/dev/vdc 1.2硬盘分区 进入fdisk模式 [root@cgsl ]# /sbin/fdisk /dev/vdc 输入n进行分区 [root@cgsl ]# Command (m for help): n 选择分区类型 [root@cgsl ]# Select (default p): p ...
一个参考性质的安装,查询增加硬盘,硬盘分区,.新添加的硬盘默认是不能使用的,需要先进行分区,然后再格式化才能使用,这个文档会帮助使用fdisk命令进行分区
centos添加新磁盘 需要格式化并挂载,如果有大量新磁盘需要挂载,使用脚本就比较方便。挂载后还可以选择创建lvm
安装Centos 5.2 LINUX服务器并在其上配置 iSCSI SAN 存储服务(提供 iSCSI Target Server 角色),在Windows Server 2003上安装 Microsoft iSCSI Initiator驱动,添加 ISCSI硬盘,扩充 PC 服务器或客户机的硬盘空间...
centos6、rhel6安装kvm详细文档 包括需要的硬件说明和软件的安装指导,还有添加网卡硬盘和克隆等等说明。
1.给目标虚拟机(centos7_web_serv1)添加一块虚拟磁盘,容量为 10GB 2.给目标虚拟机添加一个虚拟光驱,使用 centos7 的镜像 iso