<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: 调整 Xen 虚拟硬盘大小</title>
	<atom:link href="http://www.vpsee.com/2009/09/resize-xen-vm-image/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.vpsee.com/2009/09/resize-xen-vm-image/</link>
	<description></description>
	<lastBuildDate>Fri, 03 Feb 2012 12:22:23 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: wfm</title>
		<link>http://www.vpsee.com/2009/09/resize-xen-vm-image/comment-page-1/#comment-5403</link>
		<dc:creator>wfm</dc:creator>
		<pubDate>Fri, 29 Jul 2011 12:05:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.vpsee.com/?p=628#comment-5403</guid>
		<description>请问下,windows磁盘如何动态增加大小</description>
		<content:encoded><![CDATA[<p>请问下,windows磁盘如何动态增加大小</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 领翔网络</title>
		<link>http://www.vpsee.com/2009/09/resize-xen-vm-image/comment-page-1/#comment-4166</link>
		<dc:creator>领翔网络</dc:creator>
		<pubDate>Wed, 06 Apr 2011 06:35:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.vpsee.com/?p=628#comment-4166</guid>
		<description>我是这样做的：

dd if=/dev/zero of=vm01.img bs=1 count=1 seek=20G conv=notrunc

e2fsck -f vm01.img -y

resize2fs -p vm01.img</description>
		<content:encoded><![CDATA[<p>我是这样做的：</p>
<p>dd if=/dev/zero of=vm01.img bs=1 count=1 seek=20G conv=notrunc</p>
<p>e2fsck -f vm01.img -y</p>
<p>resize2fs -p vm01.img</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: elai</title>
		<link>http://www.vpsee.com/2009/09/resize-xen-vm-image/comment-page-1/#comment-2652</link>
		<dc:creator>elai</dc:creator>
		<pubDate>Thu, 02 Dec 2010 13:19:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.vpsee.com/?p=628#comment-2652</guid>
		<description>1. 关闭虚拟机
$ xm shutdown myvm1.faladay.cublog.cn
2. 增加虚拟磁盘文件空间（4G）
$ dd if=/dev/zero bs=1024k count=4096 &gt;&gt; /home/myvm/myvm1.faladay.cublog.cn.img
3. 重新创建虚拟磁盘分区表
$ losetup -f
/dev/loop0
$ losetup /dev/loop0 /home/myvm/myvm1.faladay.cublog.cn.img
$ losetup -a
/dev/loop0: [fd01]:10977283 (/home/myvm/myvm1.faladay.cublog.cn.img)
$ fdisk /dev/loop0
下面是fdisk界面的输入和输出信息（摘要）：
Command (m for help): p
      Device Boot      Start         End      Blocks   Id  System
/dev/loop0p1   *           1           6       48163+  83  Linux
/dev/loop0p2               7         764     6088635   8e  Linux LVM
Command (m for help): d 
Partition number (1-4): 2
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (7-1281, default 7): 
Using default value 7
Last cylinder or +size or +sizeM or +sizeK (7-1281, default 1281): 
Using default value 1281
Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): 8e
Changed system type of partition 2 to 8e (Linux LVM)
Command (m for help): p
/dev/loop0p1   *           1           6       48163+  83  Linux
/dev/loop0p2               7        1281    10241437+  8e  Linux LVM
Command (m for help): w

4. 以root用户登录虚拟机
$ xm create myvm1.faladay.cublog.cn
$ ssh root@myvm1.faladay.cublog.cn

5. 修改LVM物理分卷大小
$ pvscan
  PV /dev/xvda2   VG sys   lvm2 [5.75 GB / 0 GB free]
  Total: 1 [5.75 GB] / in use: 1 [5.75 GB] / in no VG: 0 [0   ]
$ pvresize +4096M /dev/xvda2 
$ pvscan 
  PV /dev/xvda2   VG sys   lvm2 [9.75 GB / 3.97 GB free]
  Total: 1 [9.75 GB] / in use: 1 [9.75 GB] / in no VG: 0 [0   ]
$ lvscan
  ACTIVE            &#039;/dev/sys/root&#039; [4.00 GB] inherit
  ACTIVE            &#039;/dev/sys/home&#039; [1.28 GB] inherit
  ACTIVE            &#039;/dev/sys/swap&#039; [512.00 MB] inherit
$ lvextend -L +1024M /dev/sys/root  
$ lvextend -L +3072M /dev/sys/home 
$ resize2fs -f /dev/sys/root
$ resize2fs -f /dev/sys/home

6. 退出虚拟机，执行下列命令
$ losetup -d /dev/loop0

    至此，虚拟机磁盘扩容完毕，通过df -h命令可以看到虚拟机磁盘空间root已经扩大1G，home已经扩大3G。</description>
		<content:encoded><![CDATA[<p>1. 关闭虚拟机<br />
$ xm shutdown myvm1.faladay.cublog.cn<br />
2. 增加虚拟磁盘文件空间（4G）<br />
$ dd if=/dev/zero bs=1024k count=4096 &gt;&gt; /home/myvm/myvm1.faladay.cublog.cn.img<br />
3. 重新创建虚拟磁盘分区表<br />
$ losetup -f<br />
/dev/loop0<br />
$ losetup /dev/loop0 /home/myvm/myvm1.faladay.cublog.cn.img<br />
$ losetup -a<br />
/dev/loop0: [fd01]:10977283 (/home/myvm/myvm1.faladay.cublog.cn.img)<br />
$ fdisk /dev/loop0<br />
下面是fdisk界面的输入和输出信息（摘要）：<br />
Command (m for help): p<br />
      Device Boot      Start         End      Blocks   Id  System<br />
/dev/loop0p1   *           1           6       48163+  83  Linux<br />
/dev/loop0p2               7         764     6088635   8e  Linux LVM<br />
Command (m for help): d<br />
Partition number (1-4): 2<br />
Command (m for help): n<br />
Command action<br />
   e   extended<br />
   p   primary partition (1-4)<br />
p<br />
Partition number (1-4): 2<br />
First cylinder (7-1281, default 7):<br />
Using default value 7<br />
Last cylinder or +size or +sizeM or +sizeK (7-1281, default 1281):<br />
Using default value 1281<br />
Command (m for help): t<br />
Partition number (1-4): 2<br />
Hex code (type L to list codes): 8e<br />
Changed system type of partition 2 to 8e (Linux LVM)<br />
Command (m for help): p<br />
/dev/loop0p1   *           1           6       48163+  83  Linux<br />
/dev/loop0p2               7        1281    10241437+  8e  Linux LVM<br />
Command (m for help): w</p>
<p>4. 以root用户登录虚拟机<br />
$ xm create myvm1.faladay.cublog.cn<br />
$ ssh <a href="mailto:root@myvm1.faladay.cublog.cn">root@myvm1.faladay.cublog.cn</a></p>
<p>5. 修改LVM物理分卷大小<br />
$ pvscan<br />
  PV /dev/xvda2   VG sys   lvm2 [5.75 GB / 0 GB free]<br />
  Total: 1 [5.75 GB] / in use: 1 [5.75 GB] / in no VG: 0 [0   ]<br />
$ pvresize +4096M /dev/xvda2<br />
$ pvscan<br />
  PV /dev/xvda2   VG sys   lvm2 [9.75 GB / 3.97 GB free]<br />
  Total: 1 [9.75 GB] / in use: 1 [9.75 GB] / in no VG: 0 [0   ]<br />
$ lvscan<br />
  ACTIVE            &#8216;/dev/sys/root&#8217; [4.00 GB] inherit<br />
  ACTIVE            &#8216;/dev/sys/home&#8217; [1.28 GB] inherit<br />
  ACTIVE            &#8216;/dev/sys/swap&#8217; [512.00 MB] inherit<br />
$ lvextend -L +1024M /dev/sys/root<br />
$ lvextend -L +3072M /dev/sys/home<br />
$ resize2fs -f /dev/sys/root<br />
$ resize2fs -f /dev/sys/home</p>
<p>6. 退出虚拟机，执行下列命令<br />
$ losetup -d /dev/loop0</p>
<p>    至此，虚拟机磁盘扩容完毕，通过df -h命令可以看到虚拟机磁盘空间root已经扩大1G，home已经扩大3G。</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: elai</title>
		<link>http://www.vpsee.com/2009/09/resize-xen-vm-image/comment-page-1/#comment-2651</link>
		<dc:creator>elai</dc:creator>
		<pubDate>Thu, 02 Dec 2010 11:47:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.vpsee.com/?p=628#comment-2651</guid>
		<description>我的系统是centos5.4的，按你的方法也不行。
e2fsck -b 8193 ossvr-1.img    
e2fsck 1.39 (29-May-2006)
e2fsck: Bad magic number in super-block while trying to open ossvr-1.img

The superblock could not be read or does not describe a correct ext2
filesystem.  If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 


 resize2fs -f ossvr-1.img 
resize2fs 1.39 (29-May-2006)
resize2fs: Bad magic number in super-block while trying to open ossvr-1.img
Couldn&#039;t find valid filesystem superblock.</description>
		<content:encoded><![CDATA[<p>我的系统是centos5.4的，按你的方法也不行。<br />
e2fsck -b 8193 ossvr-1.img<br />
e2fsck 1.39 (29-May-2006)<br />
e2fsck: Bad magic number in super-block while trying to open ossvr-1.img</p>
<p>The superblock could not be read or does not describe a correct ext2<br />
filesystem.  If the device is valid and it really contains an ext2<br />
filesystem (and not swap or ufs or something else), then the superblock<br />
is corrupt, and you might try running e2fsck with an alternate superblock:<br />
    e2fsck -b 8193 </p>
<p> resize2fs -f ossvr-1.img<br />
resize2fs 1.39 (29-May-2006)<br />
resize2fs: Bad magic number in super-block while trying to open ossvr-1.img<br />
Couldn&#8217;t find valid filesystem superblock.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vpsee</title>
		<link>http://www.vpsee.com/2009/09/resize-xen-vm-image/comment-page-1/#comment-1611</link>
		<dc:creator>vpsee</dc:creator>
		<pubDate>Thu, 05 Aug 2010 23:42:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.vpsee.com/?p=628#comment-1611</guid>
		<description>请确定你的 test2.img 里只含有1个分区，并且文件系统是 ext2/ext3 的。</description>
		<content:encoded><![CDATA[<p>请确定你的 test2.img 里只含有1个分区，并且文件系统是 ext2/ext3 的。</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 请教</title>
		<link>http://www.vpsee.com/2009/09/resize-xen-vm-image/comment-page-1/#comment-690</link>
		<dc:creator>请教</dc:creator>
		<pubDate>Thu, 11 Mar 2010 06:54:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.vpsee.com/?p=628#comment-690</guid>
		<description>您好，按照您的操作步骤，在该步出错，请指点：
/sbin/e2fsck -f /xenos/test2.img
e2fsck 1.39 (29-May-2006)
Couldn&#039;t find ext2 superblock, trying backup blocks...
/sbin/e2fsck: Bad magic number in super-block while trying to open /xenos/test2.img

The superblock could not be read or does not describe a correct ext2
filesystem.  If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 </description>
		<content:encoded><![CDATA[<p>您好，按照您的操作步骤，在该步出错，请指点：<br />
/sbin/e2fsck -f /xenos/test2.img<br />
e2fsck 1.39 (29-May-2006)<br />
Couldn&#8217;t find ext2 superblock, trying backup blocks&#8230;<br />
/sbin/e2fsck: Bad magic number in super-block while trying to open /xenos/test2.img</p>
<p>The superblock could not be read or does not describe a correct ext2<br />
filesystem.  If the device is valid and it really contains an ext2<br />
filesystem (and not swap or ufs or something else), then the superblock<br />
is corrupt, and you might try running e2fsck with an alternate superblock:<br />
    e2fsck -b 8193</p>
]]></content:encoded>
	</item>
</channel>
</rss>

