下面看我操作的步骤:1.先用Fdisk -l 来查看当前状态下磁盘情况 [root@linux1 ~]# fdisk -lDisk /dev/hda: MB, bytes heads, sectors/track, cylindersUnits = cylinders of * = bytesDevice Boot Start End Blocks Id System/dev/hda1 * 1 Linux/dev/hda2 8e Linux LVMDisk /dev/hdb: MB, bytes heads, sectors/track, cylindersUnits = cylinders of * = bytesDisk /dev/hdb doesn't contain a valid partition table上面红色标识行可以看出,我添加了一块新硬盘/dev/hdb,大小为2G,未分区格式化状态。 2.用Fdisk /dev/hdb来进行分区操作。 [root@linux1 ~]# fdisk /dev/hdbDevice contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabelBuilding a new DOS disklabel. Changes will remain in memory only,until you decide to write them. After that, of course, the previouscontent won't be recoverable. The number of cylinders for this disk is set to .There is nothing wrong with that, but this is larger than ,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 0x of partition table 4 will be corrected by w(rite) Command (m for help): n //输入N表示新建一个分区Command actione extendedp primary partition (1-4)p //p 表示建立一个原始分区Partition number (1-4): 1 //1 表示此分区编号为1.First cylinder (1-, default 1): 1 //1表示使用默认起始柱面号.如果要分多个区的话,先盘算好要多大,再输入数字Last cylinder or size or sizeM or sizeK (1-, default ): // 输入: 回车 表示使用默认结束柱面号.即此分区使用整个硬盘空间 Using default value Command (m for help): w //保存分区 The partition table has been altered! Calling ioctl() to re-read partition table.Syncing disks. 3.再次查看当前分区状态:[root@linux1 ~]# fdisk -l Disk /dev/hda: MB, bytes heads, sectors/track, cylindersUnits = cylinders of * = bytes Device Boot Start End Blocks Id System/dev/hda1 * 1 Linux/dev/hda2 8e Linux LVM Disk /dev/hdb: MB, bytes heads, sectors/track, cylindersUnits = cylinders of * = bytes Device Boot Start End Blocks Id System/dev/hdb1 1 Linux可以看出,已经出来了一个/dev/hdb1的新分区。下一步将其格式化,再使用 4.用mkfs.ext3格式化新分区[root@linux1 ~]# mkfs.ext3 /dev/hdb1mke2fs 1. (-May-)Filesystem label=OS type: LinuxBlock size= (log=2)Fragment size= (log=2) inodes, blocks blocks (5.%) reserved for the super userFirst data block=0Maximum filesystem blocks= block groups blocks per group, fragments per group inodes per groupSuperblock backups stored on blocks:, , , , Writing inode tables: doneWriting superblocks and filesystem accounting information: done This filesystem will be automatically checked every mounts or days, whichever comes first. Use tune2fs -c or -i to override. 5.挂载使用。[root@linux1 ~]# mkdir /mnt/hdb1 //新建一个挂载点。[root@linux1 ~]# mount /dev/hdb1 /mnt/hdb1 //挂载。[root@linux1 ~]# df -h文件系统 容量 已用 可用 已用% 挂载点/dev/mapper/VolGroup-LogVol.3G 3.6G M % //dev/hda1 M M M % /boottmpfs M 0 M 0% /dev/shm/dev/hdb1 2.0G 3.0M 1.9G 1% /mnt/hdb1 6 .开机自动挂载三.设置新硬盘开机自动挂载在vi /etc/fstab中添加新硬盘的挂载信息.添加下面一行:/dev/hdb1 /mnt/hdb1 ext3 defaults 1 2(如果还有一个分区就是1 3,以此类推)这样,每次开机后,系统会自动将/dev/hdb1挂载到/mnt/hdb1
推荐整理分享CentOS下添加新硬盘并分区格式化的详细步骤(centos5.5加固),希望有所帮助,仅作参考,欢迎阅读内容。
文章相关热门搜索词:centos7添加新硬盘然后分区,centos5.5加固,centos7添加新硬盘然后分区,centos7添加新硬盘然后分区,centos添加新用户,centos添加新用户,centos添加硬盘分区,centos添加新用户,内容如对您有帮助,希望把文章链接给更多的朋友!
Centos设置静态IP及修改Centos配置文件的方法 特别值得一提的是Centos设置IP有很多值得学习的地方,这里我们主要介绍Centos设置静态IP,包括介绍Centos配置文件,CentOS系统TCP/IP网络配置、系统引导和
CentOS 6.2(位/位) 安装步骤图文详解 一、CentOS简介CentOS是Linux的发行版之一,它安全、稳定、高效,是我最喜欢的Linux发行版之一。CentOS根据RedHatEnterpriseLinux开放源代码编译而成,与RedHatLinu
RedHat Linux5.5下Oracle g安装图解教程 Linux下安装Oracle系统最好是1G内存,2G的swap空间,硬盘至少需要4.5G空间。至少环境在LinuxServerrelease5.3以上如果是LinuxServerrelease5.1,改装oracle.2g吧一、查