Welcome 微信登录

首页 / 操作系统 / Linux / 新增硬盘扩容Linux下的分区大小


   
主题新增硬盘扩容Linux下的分区大小
关键词Linux分区 调整大小
操作环境VMWare7.0+RHEL5
问题分析在目录大小不足的情况下在线对其进行扩容
一、首先是在关机的环境下点击虚拟机的属性,对其添加一块硬盘 二、查看硬盘状态[root@localhost~]# fdisk -lDisk /dev/sda:21.4 GB, 21474836480 bytes255 heads, 63sectors/track, 2610 cylindersUnits =cylinders of 16065 * 512 = 8225280 bytes    Device Boot      Start         End      Blocks  Id  System/dev/sda1   *          1          13      104391  83  Linux/dev/sda2              14        2610   20860402+  8e  Linux LVM Disk /dev/sdb:21.4 GB, 21474836480 bytes255 heads, 63sectors/track, 2610 cylindersUnits =cylinders of 16065 * 512 = 8225280 bytes Disk /dev/sdbdoesn"t contain a valid partition table//显示找到一个盘sdb,但是没有有效的分区表 三、查看新盘的信息[root@localhost~]# df /dev/sdbFilesystem           1K-blocks      Used Available Use% Mounted on-                       257604       100   257504   1% /dev 四、对新盘进行分区[root@localhost~]# fdisk /dev/sdbDevice containsneither a valid DOS partition table, nor Sun, SGI or OSF disklabelBuilding a newDOS disklabel. Changes will remain in memory only,until youdecide to write them. After that, of course, the previouscontent won"tbe recoverable.The number ofcylinders for this disk is set to 2610.There isnothing wrong with that, but this is larger than 1024,and could incertain setups cause problems with:1) softwarethat runs at boot time (e.g., old versions of LILO)2) booting andpartitioning software from other OSs   (e.g., DOS FDISK, OS/2 FDISK)Warning:invalid flag 0x0000 of partition table 4 will be corrected by w(rite) Command (m forhelp): n//创建一个新的逻辑磁盘Command action   e  extended//扩展分区   p  primary partition (1-4)p//主分区Partitionnumber (1-4): 1//相当于盘符First cylinder(1-2610, default 1): 1//第一柱头Last cylinderor +size or +sizeM or +sizeK (1-2610, default 2610): 2610//最后的柱头Command (m forhelp): t//选择分区类型Selectedpartition 1Hex code (typeL to list codes): 83//83是Linux类型,,具体类型可以在l下面看到Command (m forhelp): w//写入分区表The partitiontable has been altered! Calling ioctl()to re-read partition table.Syncing disks.//下面是格式化分区为ext3格式[root@localhost~]# mkfs.ext3 /dev/sdb1mke2fs 1.39(29-May-2006)Filesystemlabel=OS type: LinuxBlock size=4096(log=2)Fragmentsize=4096 (log=2)2621440 inodes,5241198 blocks262059 blocks(5.00%) reserved for the super userFirst datablock=0Maximumfilesystem blocks=0160 blockgroups32768 blocksper group, 32768 fragments per group16384 inodesper groupSuperblockbackups stored on blocks:         32768, 98304, 163840, 229376, 294912,819200, 884736, 1605632, 2654208,         4096000 Writing inodetables: done                            Creatingjournal (32768 blocks): doneWritingsuperblocks and filesystem accounting information: done This filesystemwill be automatically checked every 37 mounts or180 days,whichever comes first.  Use tune2fs -c or-i to override.
  • 1
  • 2
  • 3
  • 下一页
Linux做iSCSI共享存储实验Linux下命令行实现秒级关机相关资讯      Linux基础教程 
  • Linux基础教程:对文件打包压缩  (03月08日)
  • 基础教程:Linux 新手应该知道的   (09/06/2015 21:17:20)
  • Linux基础教程:find 与 xargs  (04/05/2015 10:20:11)
  • Linux基础教程:tar 命令使用介绍  (12/03/2015 13:19:47)
  • Linux基础教程(1)操作系统基础   (08/15/2015 20:44:01)
  • Linux基础教程:从源码安装软件  (04/05/2015 10:14:45)
本文评论 查看全部评论 (0)
表情: 姓名: 字数