Rajiv Rajaian
2008-Feb-12 16:47 UTC
[Xen-users] Reg Disk space in guest domain with fedora img
Hi I had installed Xen-3.0.4 in Scientific linux 4 (kernel version 2.6.16.33) by following the instructions given in following link project-xen.web.cern.ch/project-xen/xen/howto_slcXen.html I ve created the guest Domain with fedora image of size 2.2GB , disk space as 10GB and the domain started successfully . when i logged into the xm console and checked the disk space its showing only 2.2GB .. is there any thing worng with my configuration ?? Here''s my configruation file which i ve used to create domain cat /usr/local/vm_creator/workspace/images/fedora #This Configuration file is Automatically Generated on Tue Feb 12 19:33:17 IST 2008 kernel = "/boot/vmlinuz-2.6.16.33-xen" memory = 256 extra = "fastboot" ramdisk = "/boot/initrd-2.6.16.33-xen.img" disk = [''phy:vg/fedora,sda6,w'',''phy:vg/compswap,sda7,w'', ''phy:vg/modules,sda5,r''] name = "fedora.compnode.grid" root = "/dev/sda6 ro" vif=[''bridge=xenbr0''] The logical volumes look like [root@g40 ~]# lvs LV VG Attr LSize Origin Snap% Move Copy% compswap vg -wi-ao 1.00G fedora vg -wi-ao 10.00G modules vg -wi-ao 100.00M In the guest domain when i checked the following commands i got the output as [root@fedora ~]# df -H Filesystem Size Used Avail Use% Mounted on /dev/sda6 2.2G 904M 1.2G 46% / none 135M 0 135M 0% /dev/shm /dev/sda5 102M 90M 7.2M 93% /lib/modules [root@fedora ~]# fdisk -l Disk /dev/sda7: 1073 MB, 1073741824 bytes 255 heads, 63 sectors/track, 130 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/sda7 doesn''t contain a valid partition table Disk /dev/sda6: 10.7 GB, 10737418240 bytes 255 heads, 63 sectors/track, 1305 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/sda6 doesn''t contain a valid partition table Disk /dev/sda5: 104 MB, 104857600 bytes 255 heads, 63 sectors/track, 12 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/sda5 doesn''t contain a valid partition table [root@fedora ~]# cat /etc/fstab # This file is edited by fstab-sync - see ''man fstab-sync'' for details /dev/sda6 / ext3 defaults 1 1 none /dev/pts devpts gid=5,mode=620 0 0 none /dev/shm tmpfs defaults 0 0 none /proc proc defaults 0 0 none /sys sysfs defaults 0 0 /dev/sda7 swap swap defaults 0 0 /dev/sda5 /lib/modules ext2 defaults 0 1 Is there any thing to be configured to get the full disk space as 10GB or any thing wrong with my configuration ?? Please help me Thanks in advance Rajiv Project Associate , CARE,MIT,Annauniversity ,Chennai _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Todd Deshane
2008-Feb-12 18:50 UTC
Re: [Xen-users] Reg Disk space in guest domain with fedora img
Hi, On Feb 12, 2008 11:47 AM, Rajiv Rajaian <rajiv.grid@gmail.com> wrote:> Hi > I had installed Xen-3.0.4 in Scientific linux 4 (kernel version 2.6.16.33) > by following the instructions given in following link > > project-xen.web.cern.ch/project-xen/xen/howto_slcXen.html > > I ve created the guest Domain with fedora image of size 2.2GB , disk space > as 10GB and the domain started successfully . when i logged into the xm > console and checked the disk space its showing only 2.2GB .. is there any > thing worng with my configuration ?? > > Here''s my configruation file which i ve used to create domain > > > cat /usr/local/vm_creator/workspace/images/fedora > > #This Configuration file is Automatically Generated on Tue Feb 12 19:33:17 > IST 2008 > kernel = "/boot/vmlinuz-2.6.16.33-xen" > memory = 256 > extra = "fastboot" > ramdisk = "/boot/initrd-2.6.16.33-xen.img" > disk = [''phy:vg/fedora,sda6,w'',''phy:vg/compswap,sda7,w'', > ''phy:vg/modules,sda5,r''] > name = "fedora.compnode.grid" > root = "/dev/sda6 ro" > vif=[''bridge=xenbr0''] > > The logical volumes look like > > [root@g40 ~]# lvs > LV VG Attr LSize Origin Snap% Move Copy% > compswap vg -wi-ao 1.00G > fedora vg -wi-ao 10.00G > modules vg -wi-ao 100.00M > > In the guest domain when i checked the following commands i got the output > as > > [root@fedora ~]# df -H > Filesystem Size Used Avail Use% Mounted on > /dev/sda6 2.2G 904M 1.2G 46% / > none 135M 0 135M 0% /dev/shm > /dev/sda5 102M 90M 7.2M 93% /lib/modules > > > [root@fedora ~]# fdisk -l > > Disk /dev/sda7: 1073 MB, 1073741824 bytes > 255 heads, 63 sectors/track, 130 cylinders > Units = cylinders of 16065 * 512 = 8225280 bytes > > Disk /dev/sda7 doesn''t contain a valid partition table > > Disk /dev/sda6: 10.7 GB, 10737418240 bytes > 255 heads, 63 sectors/track, 1305 cylinders > Units = cylinders of 16065 * 512 = 8225280 bytes > > Disk /dev/sda6 doesn''t contain a valid partition table > > Disk /dev/sda5: 104 MB, 104857600 bytes > 255 heads, 63 sectors/track, 12 cylinders > Units = cylinders of 16065 * 512 = 8225280 bytes > > Disk /dev/sda5 doesn''t contain a valid partition table > >This output is the one that seems strange to me. fdisk things that the partitions are hard drives for some reason. My guess is that there is something wrong with the logical volume. I would suggest to stop the guest and mount the fedora logical volume manually. See if the right size then. If not then it is a problem with how Xen is recognizing it. Regards, Todd> > [root@fedora ~]# cat /etc/fstab > # This file is edited by fstab-sync - see ''man fstab-sync'' for details > /dev/sda6 / ext3 defaults 1 1 > none /dev/pts devpts gid=5,mode=620 0 0 > none /dev/shm tmpfs defaults 0 0 > none /proc proc defaults 0 0 > none /sys sysfs defaults 0 0 > /dev/sda7 swap swap defaults 0 0 > /dev/sda5 /lib/modules ext2 defaults 0 1 > > > Is there any thing to be configured to get the full disk space as 10GB or > any thing wrong with my configuration ?? > > Please help me > > Thanks in advance > > Rajiv > > Project Associate , > > CARE,MIT,Annauniversity ,Chennai > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Todd Deshane
2008-Feb-13 13:59 UTC
Re: [Xen-users] Reg Disk space in guest domain with fedora img
Hi Rajiv, You should keep replies to the list as others may have insights that I don''t know about. I think I might notice something though... On Feb 13, 2008 1:53 AM, Rajiv Rajaian <rajiv.grid@gmail.com> wrote:> Hi Todd > > These are the steps I''d used to create the fedora domain > lvcreate -L10G -n compnode vg > cat fedora.img > /dev/vg/fedora >What is fedora.img? if fedora fedora.img is a file acting as a partition (or disk) than that may be the problem. You would need to use the resize2fs command (or a similar command based on the file system type of the fedora.img) that you mention below. The size of the partition needs to match the 10G that you are using for the logical volume. It depends on how fedora.img was created as to how to work with it. The two cases as stated above are: 1) It''s a partition image (or in other words simply a file system) In this case, the best bet to get the resize to work is to first make sure it isn''t in use and not mounted. Then do something like: resize2fs fedora.img 10G (you may also need the -F option, since it is not actually a file system partition, but a file representing one) 2) It''s a disk image losetup -f losetup `losetup -f` fedora.img kpartx -av /dev/loopX <-- replace X with the appropriate number from losetup -f output above fdisk -l /dev/mapper/loopX resize2fs /dev/mapper/loopXpY 10G <-- replace Y with appropriate number from fdisk -l output (resize command changes if file system is not ext2 or ext3 a similar process is documented in [1] If you don''t know if you fall into case 1 or 2, then you have two ways to check 1) fdisk -l fedora.img (is there partitions?) 2) mount -o loop fedora.img /mnt/temp be sure to umount /mnt/temp before resizing etc. Hope that helps. Best regards, Todd [1] http://docs.cosi/wiki/Resizing_an_Image> Also i found one commad to resize2fs > resize2fs /dev/vg/fedora > Is this step has to done or optional > > Now i ve seen the lvm size of created domain as 10GB with lvdisplay command > > [root@g40 vm_creator]# lvdisplay /dev/vg/fedora > --- Logical volume --- > LV Name /dev/vg/fedora > VG Name vg > LV UUID MwIi5u-kZRD-q4co-8imB-i9cf-PvuO-cO3fI5 > LV Write Access read/write > LV Status available > # open 1 > LV Size 10.00 GB > Current LE 2560 > Segments 1 > Allocation inherit > Read ahead sectors 0 > Block device 253:0 > > In my xm config file disk option given by me was > > > disk = [''phy:vg/fedora,sda6,w'',''phy:vg/compswap,sda7,w'', > ''phy:vg/modules,sda5,r''] > > Also the size of the feora image ive used is > [root@g40 images]# ls -ls fedora.img > 2100232 -rw-r--r-- 1 root root 2148532224 Feb 12 12:06 fedora.img > > Only this disk space is shown in df -H command inside the created domain > > df -H > Filesystem Size Used Avail Use% Mounted on > /dev/sda6 2.2G 904M 1.2G 46% / > > Whether it will show this disk size as 2GB only or it will show 10GB as my > lvdisplay shows > > Fdisk command shows like this > > Disk /dev/sda6: 10.7 GB, 10737418240 bytes > > 255 heads, 63 sectors/track, 1305 cylinders > Units = cylinders of 16065 * 512 = 8225280 bytes > > Disk /dev/sda6 doesn''t contain a valid partition table > > Is this an error ??? Im getting little bit confused.. > > Thanks in advanced > > Rajiv > Project Associate > CARE,MIT > Anna University > > > >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Todd Deshane
2008-Feb-13 16:14 UTC
Re: [Xen-users] Reg Disk space in guest domain with fedora img
On Feb 13, 2008 9:56 AM, Rajiv Rajaian <rajiv.grid@gmail.com> wrote:> Thanks Todd > I d manually mounted my /dev/vg/fedora before copying the > fedora.img(bootable image) > Total size shows 10GB > And after copying the image it shows only 2.2GB > Now i need to resize the lvm.. But my host os(Scientific linux ) > doesn''t have resize2fs command .. > Also my the filesystem type is ext3...How to resize the ext3 filesystem. >http://e2fsprogs.sourceforge.net/> > Thanks in Advance > Rajiv > > > On 2/13/08, Todd Deshane <deshantm@gmail.com> wrote: > > Hi Rajiv, > > > > You should keep replies to the list as others may have insights that I > > don''t know about. > > > > I think I might notice something though... > > > > On Feb 13, 2008 1:53 AM, Rajiv Rajaian <rajiv.grid@gmail.com> wrote: > > > Hi Todd > > > > > > These are the steps I''d used to create the fedora domain > > > lvcreate -L10G -n compnode vg > > > cat fedora.img > /dev/vg/fedora > > > > > > > What is fedora.img? > > > > if fedora fedora.img is a file acting as a partition (or disk) than > > that may be the problem. > > > > You would need to use the resize2fs command (or a similar command > > based on the file system type of the fedora.img) that you mention > > below. > > > > The size of the partition needs to match the 10G that you are using > > for the logical volume. > > > > It depends on how fedora.img was created as to how to work with it. > > > > The two cases as stated above are: > > > > 1) It''s a partition image (or in other words simply a file system) > > > > In this case, the best bet to get the resize to work is to first make > > sure it isn''t in use and not mounted. Then do something like: > > > > resize2fs fedora.img 10G (you may also need the -F option, since it is > > not actually a file system partition, but a file representing one) > > > > 2) It''s a disk image > > > > losetup -f > > > > losetup `losetup -f` fedora.img > > kpartx -av /dev/loopX <-- replace X with the appropriate number from > > losetup -f output above > > fdisk -l /dev/mapper/loopX > > resize2fs /dev/mapper/loopXpY 10G <-- replace Y with appropriate > > number from fdisk -l output (resize command changes if file system is > > not ext2 or ext3 > > > > a similar process is documented in [1] > > > > If you don''t know if you fall into case 1 or 2, then you have two ways to > > check > > > > 1) fdisk -l fedora.img (is there partitions?) > > > > 2) mount -o loop fedora.img /mnt/temp > > be sure to umount /mnt/temp before resizing etc. > > > > Hope that helps. > > > > Best regards, > > Todd > > > > [1] http://docs.cosi/wiki/Resizing_an_Image > > > > > Also i found one commad to resize2fs > > > resize2fs /dev/vg/fedora > > > Is this step has to done or optional > > > > > > Now i ve seen the lvm size of created domain as 10GB with lvdisplay > > command > > > > > > [root@g40 vm_creator]# lvdisplay /dev/vg/fedora > > > --- Logical volume --- > > > LV Name /dev/vg/fedora > > > VG Name vg > > > LV UUID MwIi5u-kZRD-q4co-8imB-i9cf-PvuO-cO3fI5 > > > LV Write Access read/write > > > LV Status available > > > # open 1 > > > LV Size 10.00 GB > > > Current LE 2560 > > > Segments 1 > > > Allocation inherit > > > Read ahead sectors 0 > > > Block device 253:0 > > > > > > In my xm config file disk option given by me was > > > > > > > > > disk = [''phy:vg/fedora,sda6,w'',''phy:vg/compswap,sda7,w'', > > > ''phy:vg/modules,sda5,r''] > > > > > > Also the size of the feora image ive used is > > > [root@g40 images]# ls -ls fedora.img > > > 2100232 -rw-r--r-- 1 root root 2148532224 Feb 12 12:06 fedora.img > > > > > > Only this disk space is shown in df -H command inside the created domain > > > > > > df -H > > > Filesystem Size Used Avail Use% Mounted on > > > /dev/sda6 2.2G 904M 1.2G 46% / > > > > > > Whether it will show this disk size as 2GB only or it will show 10GB as my > > > lvdisplay shows > > > > > > Fdisk command shows like this > > > > > > Disk /dev/sda6: 10.7 GB, 10737418240 bytes > > > > > > 255 heads, 63 sectors/track, 1305 cylinders > > > Units = cylinders of 16065 * 512 = 8225280 bytes > > > > > > Disk /dev/sda6 doesn''t contain a valid partition table > > > > > > Is this an error ??? Im getting little bit confused.. > > > > > > Thanks in advanced > > > > > > Rajiv > > > Project Associate > > > CARE,MIT > > > Anna University > > > > > > > > > > > > > > >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Rajiv Rajaian
2008-Feb-14 05:30 UTC
Re: [Xen-users] Reg Disk space in guest domain with fedora img
Sorted out the issue of lvm size in guest domain. Steps I have done are as follows lvcreate -L10G -n fedora vg mkfs.ext3 /dev/vg/fedora cat fedora.img >/dev/vg/fedora mount /de/vg/fedora /mnt/tmp df -H /mnt/tmp Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg-fedora 2.2G 2.0G 82M 96% /mnt/tmp Now i ve resized the lvm using the command resize2fs -f /dev/vg/fedora Afer resizing the lvm size looks like this df -H /mnt/tmp Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg-fedora 11G 2.2G 8.0G 22% /mnt/tmp Also Inside the guest domain the disk usage shows [root@fedora ~]# df -H Filesystem Size Used Avail Use% Mounted on /dev/sda6 11G 2.2G 8.0G 22% / none 135M 0 135M 0% /dev/shm /dev/sda5 102M 90M 7.2M 93% /lib/modules Thanks to Todd and Xen users list Thanks Rajiv Project Associate , CARE ,MIT,Anna University _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Possibly Parallel Threads
- Problem in DHCP Server with XEN no free leases Error
- Slow response from new Athlon 1.4Ghz machine?
- How to create a guest os from existing disk image file with virt-install
- raid setup
- Re: Using diskOnKey as additional disk - is it possible with default configuration?