linux-centOs6.5 添加新的硬盘

添加的思路为:

扩展硬盘---添加新的主分区--分区格式为文件--挂载--自动挂载设置

一、扩展硬盘

Vmware增大硬盘空间

二、添加新的主分区

查看分区 fdisk -l

[[email protected] ~]# fdisk -l

Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 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: 0x00064f31

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          39      307200   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              39        2350    18566144   83  Linux
/dev/sda3            2350        2611     2097152   82  Linux swap / Solaris

创建分区



[[email protected] ~]# fdisk /dev/sda

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): n
Command action
   e   extended
   p   primary partition (1-4)
p
Selected partition 4
First cylinder (2611-3916, default 2611):
Using default value 2611
Last cylinder, +cylinders or +size{K,M,G} (2611-3916, default 3916):
Using default value 3916

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.

再次查看分区
[[email protected] ~]# fdisk -l

Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 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: 0x00064f31

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          39      307200   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              39        2350    18566144   83  Linux
/dev/sda3            2350        2611     2097152   82  Linux swap / Solaris
/dev/sda4            2611        3916    10483750   83  Linux
[[email protected] ~]# partx -a /dev/sda4 /dev/sda ###########这个地方如果用partprobe会报错,这个是虚拟机下linux-centOs6.5的BUG

三、 分区格式为文件
[[email protected] ~]# reboot ##如果不重启。格式化会报错。

[[email protected] ~]# mkfs.ext4 /dev/sda4 mke2fs 1.41.12 (17-May-2010) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 655360 inodes, 2620937 blocks 131046 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=2684354560 80 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 Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 33 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override.

四、挂载

[[email protected] ~]# mount /dev/sda4 /opt

五、开机自动挂载

vi /etc/fstab

###在末尾加上以下内容

dev/sda4 /opt ext4 defaults 1 2

六、问题汇总

6.1- partprobe报错

Warning: WARNING: the kernel failed to re-read the partition table on /dev/sda (Device or resource busy).  As a result, it may not reflect all of your changes until after reboot.请用这个命令: partx -a /dev/sda4 /dev/sda

原文地址:https://www.cnblogs.com/zhangmin1987/p/8835316.html

时间: 2024-08-05 06:20:12

linux-centOs6.5 添加新的硬盘的相关文章

Linux系统下添加新硬盘

Linux系统下添加新硬盘.分区及挂载,通过虚拟机环境实现(VMware12pro+C6.8 2.6.32-642.el6.x86_64 ) 1.将硬盘插入后,通过fdisk -l 查看当前系统磁盘信息 [[email protected] ~]# fdisk -l Disk /dev/sda: 8589 MB, 8589934592 bytes 255 heads, 63 sectors/track, 1044 cylinders Units = cylinders of 16065 * 51

​centos6.5添加新网卡配置

     centos6.5添加新网卡配置 查看原来的网卡eth0: 查看新添加的网卡eth1: 复制ifcfg-eth0到ifcfg-eth1新文件 vi ifcfg-eth0编辑,修改网卡名字为eth1:修改对应的mac地址,修改对应ip地址,然后保存退出 (网卡名字和对应mac一定要对应) 重启网络服务 ifconfig查看ip地址

[Linux]vbox 虚拟机添加新磁盘

情况是这样的,开始创建虚拟机的时候硬盘设置太小了,只有10g,我现在通过vbox的设置给这个linux(centos6.6)虚拟机添加了一块硬盘. 下面的操作就是怎么把硬盘挂载到系统中. 通过 fdisk查看现在物理磁盘的信息(这个要用root权限才行) 以下操作均是root权限. [[email protected] ~]# fdisk -l ... Disk /dev/sdb: 32.2 GB, 32212254720 bytes 255 heads, 63 sectors/track, 3

如何在现有的 Linux 系统上添加新的磁盘

摘要: 作为一个系统管理员,我们会有这样的一些需求:作为升级服务器容量的一部分,或者有时出现磁盘故障时更换磁盘,我们需要将新的硬盘配置到现有服务器. 在这篇文章中,我会向你逐步介绍添加新硬盘到现有 RHEL/CentOS 或者 Debian/Ubuntu Linux 系统的步骤. 作为一个系统管理员,我们会有这样的一些需求:作为升级服务器容量的一部分,或者有时出现磁盘故障时更换磁盘,我们需要将新的硬盘配置到现有服务器. 在这篇文章中,我会向你逐步介绍添加新硬盘到现有 RHEL/CentOS 或者

关于linux 添加新的硬盘

在阿里上面搞了一台服务器,今天突然说空间不足了.查了一下,快满了. 接着fdisk -l了一下. 原来还有一块硬盘 还没有加进去.那就开始加吧. http://v.pps.tv/play_384DOH.html

linux BSP中添加新驱动

开发工作中,经常需要添加一些新的驱动,但是有时候不想自己写Makefile,或者是驱动需要编译到内核里,那我们该如何才能把驱动加到BSP里面,只需按照原来的编译步骤就能得到想要的ko文件,或者直接编译到uImage呢?一个新驱动添加大概需要以下三个步骤: 一,编写你的驱动文件,就是new_driver.c,并将其放到你想放的目录下,比如drivers/misc/ . 二,修改drivers/misc/Makefile,其格式,打开便知,如下: 1 obj-$(CONFIG_PLAT_NOMADI

linux添加新硬盘不需要重启识盘

 添加新物理硬盘 用ssh工具连接到服务器,执行:fdisk -l 查看磁盘,并没有新加的硬盘 fdisk -l查看硬盘及分区状态   查看主机总线号,命令:ls /sys/class/scsi_host/   重新扫描SCSI总线,以添加新设备: echo "- - -">/sys/class/scsi_host/host0/scan echo "- - -">/sys/class/scsi_host/host1/scan echo "- -

centos6.x 识别新添加的卷组

centos6.x 添加新硬盘 不重启识别 #yum install sg3_utils #rescan-scsi-bus.sh 识别新添加硬盘中的卷组 lvscan vgchange -ay 挂载新卷组 mount  /dev/mapper/lv-xxx /mnt

Linux内核中添加系统调用接口简单示例

1. Linux体系结构 Linux系统的地址空间分为用户空间和内核空间,通过系统调用和硬件中断能够完成从用户空间到内核空间的转移. 2. 系统调用接口 ① 一般情况下,用户进程不能访问内核空间.Linux内核中提供了一组用于实现各种系统功能的子程序,用户可以调用它们访问Linux内核的数据和函数,这些子程序称为系统调用接口(SCI). ② 系统调用和普通函数的区别:系统调用由操作系统内核实现,运行于内核态:普通函数调用由函数库或用户自己提供,运行于用户态. 3. 系统调用分类:主要分3大类 ①