欢迎来到天天文库
浏览记录
ID:51691288
大小:103.44 KB
页数:12页
时间:2020-03-15
《Linux非LVM下文件系统扩容.docx》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、原来linux不用LVM也能扩展文件系统以前总以为UNIX/LINUX使用了lvm才能扩展或缩小卷和文件系统,今天才发现我错了:即使没有lvm,linux也能扩展卷和及其相应的文件系统而不会丢失原有数据。以下是测试步骤,记录备查。 1、系统是redhatlinux6[root@localhostku]#uname-r2.6.32-131.0.15.el6.x86_64[root@localhostku]#more/etc/redhat-releaseRedHatEnterpriseLinuxSe
2、rverrelease6.1(Santiago)[root@localhostku]# 2、创建/dev/sdb1及其文件系统,创建文本文件[root@localhostku]#echowelcometoredhatworld>ricky[root@localhostku]#morerickywelcometoredhatworld 3、目前/dev/sdb1对应的文件系统/ku为1.2G[root@localhostku]#df-hFilesystem Size UsedA
3、vailUse%Mountedon/dev/mapper/VolGroup-lv_root 16G 3.7G 11G 25%/tmpfs 613M 88K 613M 1%/dev/shm/dev/sda1 485M 32M 428M 7%/boot/dev/sdb1 1.2G 34M 1.1G 3%/ku 4、卸载/ku[root@localhostku]#cd/[r
4、oot@localhost/]#umount/ku[root@localhost/]# 5、用fdisk命令删除/dev/sdb1分区,然后重新创建/dev/sdb1分区,并指定大小为4G[root@localhost/]#fdisk/dev/sdbWARNING:DOS-compatiblemodeisdeprecated.It'sstronglyrecommendedto switchoffthemode(command'c')andchangedisplayunitsto
5、 sectors(command'u').Command(mforhelp):pDisk/dev/sdb:5368MB,5368709120bytes255heads,63sectors/track,652cylindersUnits=cylindersof16065*512=8225280bytesSectorsize(logical/physical):512bytes/512bytesI/Osize(minimum/optimal):512bytes/512bytesDiskid
6、entifier:0x54f7c6df DeviceBoot Start End Blocks Id System/dev/sdb1 1 393 3156741 83 LinuxCommand(mforhelp):dSelectedpartition1Command(mforhelp):nCommandaction e extended p primarypartition(1-4)pPartitionnu
7、mber(1-4):1Firstcylinder(1-652,default1): Usingdefaultvalue1Lastcylinder,+cylindersor+size{K,M,G}(1-652,default652):+4GCommand(mforhelp):wThepartitiontablehasbeenaltered!Callingioctl()tore-readpartitiontable.Syncingdisks.[root@localhost/]# 6、fdisk-l/
8、dev/sdb输出可以看出,cylinder已经由393扩为523[root@localhost/]#fdisk-l/dev/sdbDisk/dev/sdb:5368MB,5368709120bytes255heads,63sectors/track,652cylindersUnits=cylindersof16065*512=8225280bytesSectorsize(logical/physical):512bytes/512bytesI/Osize(minimum/optimal):51
此文档下载收益归作者所有