ThinkSSL🔒 一键申购 5分钟快速签发 30天无理由退款 购买更放心 广告
[TOC] [ VMware虚拟机Linux系统根目录空间扩充操作](http://blog.itpub.net/177006/viewspace-1382842/) 关键点:由于Redhat7中默认的文件系统开始使用xfs,总结下xfs的一些内容: [如何创建一个分区挂载/home目录](http://blog.sina.com.cn/s/blog_605f5b4f01014god.html) 知识点:`$find . -depth -print0 | cpio --null --sparse -pvd /mnt/newhome/` # 硬盘挂载 ## hdb 和 sdb `fdisk -l` 会看到有一块新的设置,如果你先前有一块硬盘(sda1, sda3...),新加的这块应该是(/dev/sdb)。 (如果添加的第二块硬盘是IDE硬盘,应该看到hdb,如果是SCSI硬盘,看到的就是应该sdb) ~~~ [root@localhost ~]# fdisk -l Disk /dev/sda: 8589 MB, 8589934592 bytes 255 heads, 63 sectors/track, 1044 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 13 104391 83 Linux /dev/sda3 14 1044 8281507+ 83 Linux Disk /dev/sdb: 8589 MB, 8589934592 bytes 255 heads, 63 sectors/track, 1044 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/sdb doesn't contain a valid partition table ~~~ ## 关于 Partition 1 does not end on cylinder boundary 的理解 在Ubuntu上的终端运行命令:`sudo fdisk –l`后,终端出现如下图情况: ![document/2015-08-17/55d14481c3fed](http://box.kancloud.cn/document_2015-08-17_55d14481c3fed.png) sda2是拓展分区,sda5,6,7,8都是sda2下的逻辑分区,可以看到sda1的End位置和sda5的Start位置重叠了,终端提示: Partition 1 does not end on cylinder boundary。这句话的意思是说:分区 1 没有在柱面上结束。 网上查了一下资料,很多论坛上都说出现这种情况的原因是正常的,总体的原因如下: 因为 sudo fdisk –l 命令是按照柱面来进行分区显示的,所以需要按照垂直的空间进行理解,但现在的计算机在显示时仍然会按照扇区来理解(因为现在磁盘是使用LBA(使用扇区进行寻址)取代以前的CHS(柱面、磁头、扇区)方式记录硬盘分区的),所以会判断分区没有在柱面结束;如果我们使用命令 sudo fdisk –uS -l ,这个命令的意思是:“give size in sectors instead of sylinders”即是按照扇区的来进行分区显示,这样就可以看到以扇区方式显示分区的了。可以看到相邻逻辑分区之间都有 64 扇区的空间,那里存放逻辑分区表。如上图。 ## W95 Ext'd (LBA) 这个是扩展分区。 W95 Ext'd (LBA) It simply states that your 4th partition is an extended partition instead of a primary partition. The partition info in stored in MBR. However, the MBR can only store four partition entries. If you want more than four partitions, you will have to create an extended parition and with in which you can create more. In your case partition 5,6,7,8 Actually,W95 Ext'd (LBA) is extended partition, that is "扩展分区". For instance: ~~~ /sbin/fdisk -l Disk /dev/sda: 80.0 GB, 80032038912 bytes 255 heads, 63 sectors/track, 9730 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 131 1052226 83 Linux /dev/sda2 132 9730 77103967+ f Win95 Ext'd (LBA) /dev/sda5 132 9055 71681998+ 83 Linux /dev/sda6 9056 9730 5421906 82 Linux swap ~~~ `sda2=sda5+sda6 ` 应该是关于逻辑分区的东东。(只是名字是sda2,实际不存在,已经划分为了sda5,sda6,我们要操作sda5和sda6。)