Hi Everyone, I have a 3GB Linux disk image. When creating a new VM, I create a new LVM LV of size 25GB, then I dd the 3GB image over to an LVM LV, then do "efsck -f /path/to/lv", then "resize2fs /path/to/lv 25G" Is this the correct and safe thing to do? Thanks _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
2010/10/6 Jonathan Tripathy <jonnyt@abpni.co.uk>:> Hi Everyone, > > I have a 3GB Linux disk image. When creating a new VM, I create a new LVM LV > of size 25GB, then I dd the 3GB image over to an LVM LV, then do "efsck -f > /path/to/lv", then "resize2fs /path/to/lv 25G" > > Is this the correct and safe thing to do? > > Thanks > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users >That''s correct. But only if you''re using ext3. If you''re using reiserfs you must use resize_reiserfs /path/to/lv 25G. Cheers. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
-----Original Message----- From: Boris Quiroz [mailto:bquiroz.work@gmail.com] Sent: Wed 06/10/2010 19:22 To: Jonathan Tripathy Cc: Xen-users@lists.xensource.com Subject: Re: [Xen-users] LVM and resize2fs 2010/10/6 Jonathan Tripathy <jonnyt@abpni.co.uk>:> Hi Everyone, > > I have a 3GB Linux disk image. When creating a new VM, I create a new LVM LV > of size 25GB, then I dd the 3GB image over to an LVM LV, then do "efsck -f > /path/to/lv", then "resize2fs /path/to/lv 25G" > > Is this the correct and safe thing to do? > > Thanks > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users > >------------------------------------------------------------------- >That''s correct. But only if you''re using ext3. If you''re using >reiserfs you must use resize_reiserfs /path/to/lv 25G.>Cheers.Thanks. I am indeed using ext3. I was getting worried that by specifying 25G in both e2fsck and resize2fs that may have caused problems.. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Wed, Oct 6, 2010 at 1:23 PM, Jonathan Tripathy <jonnyt@abpni.co.uk> wrote:> I was getting worried that by specifying 25G in both e2fsck and resize2fs > that may have caused problems..it is somewhat safer not to specify the size to resize2fs and let it simply use the device''s size. otherwise, you expose yourself to slighly different interpretations of ''25G''. not too likely, but can you be sure that 24.78G is exactly the same number of bytes to LVM and resize2fs? -- Javier _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On 06/10/10 20:19, Javier Guerra Giraldez wrote:> On Wed, Oct 6, 2010 at 1:23 PM, Jonathan Tripathy<jonnyt@abpni.co.uk> wrote: > >> I was getting worried that by specifying 25G in both e2fsck and resize2fs >> that may have caused problems.. >> > it is somewhat safer not to specify the size to resize2fs and let it > simply use the device''s size. > > otherwise, you expose yourself to slighly different interpretations of > ''25G''. not too likely, but can you be sure that 24.78G is exactly the > same number of bytes to LVM and resize2fs? > >No I can''t be sure. That''s what I was worried about. Do you think it''s an issue? I guess I could not specify the size, however when I want to shrink a disk for a customer, then this becomes a bit trickier, as I have to resize2fs first and then lvresize. What would I do in this case? _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Jonathan Tripathy wrote:>No I can''t be sure. That''s what I was worried about. Do you think >it''s an issue? I guess I could not specify the size, however when I >want to shrink a disk for a customer, then this becomes a bit >trickier, as I have to resize2fs first and then lvresize. What would >I do in this case?What I do is resize the filesystem to slightly smaller than I want, resize the volume, and then resize the filesystem to match. But I have another question about this. I know almost nothing about the internals of ext2/3 filesystems - if you create a small one and grow it, does that in any way affect any options or optimisations ? I know in days of old, there were issues where the allocation chunk size was directly related to filesystem size - but I also know that ext2/3 is somewhat more intelligent than that. Also, if you use dd to create your cloned filesystem, does that result in any duplicate identifiers ? Or are things like UUIDs create at partitioning time ? An alternative approach would be to create the filesystem the size you want it (ie create the volume, create a new filesystem on it), and then use something like rsync (or just a recursive option to cp) to copy the contents of the base filesystem into it. -- Simon Hobson Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed author Gladys Hobson. Novels - poetry - short stories - ideal as Christmas stocking fillers. Some available as e-books. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
> -----Original Message----- > From: xen-users-bounces@lists.xensource.com [mailto:xen-users- > bounces@lists.xensource.com] On Behalf Of Jonathan Tripathy > Sent: Wednesday, October 06, 2010 4:14 PM > To: Javier Guerra Giraldez; Xen-users@lists.xensource.com > Subject: Re: [Xen-users] LVM and resize2fs > > > otherwise, you expose yourself to slighly different interpretations of > > '25G'. not too likely, but can you be sure that 24.78G is exactly the > > same number of bytes to LVM and resize2fs? > > > > > No I can't be sure. That's what I was worried about. Do you think it's an issue? I guess > I could not specify the size, however when I want to shrink a disk for a customer, then > this becomes a bit trickier, as I have to resize2fs first and then lvresize. What would I > do in this case?I tend to be paranoid about the same thing. So when shrinking a filesystem, I often resize2fs it to a slightly smaller size, then resize it up to the device's size. Growing is much faster than shrinking anyhow. -Jeff _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Wed, Oct 6, 2010 at 3:40 PM, Jeff Sturm <jeff.sturm@eprize.com> wrote:> I tend to be paranoid about the same thing. So when shrinking a filesystem, I often resize2fs it to a slightly smaller size, then resize it up to the device''s size. Growing is much faster than shrinking anyhow.same here -- Javier _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On 06/10/10 21:47, Javier Guerra Giraldez wrote:> On Wed, Oct 6, 2010 at 3:40 PM, Jeff Sturm<jeff.sturm@eprize.com> wrote: > >> I tend to be paranoid about the same thing. So when shrinking a filesystem, I often resize2fs it to a slightly smaller size, then resize it up to the device''s size. Growing is much faster than shrinking anyhow. >> > same here > >Ah right, so let''s say I wanted to reduce my 25GB LV down to 15GB, are the following steps correct and safe? e2fsck -f /path/to/lv resize2fs /path/to/lv 14G lvresize /path/to/lv -L15G resize2fs /path/to/lv Thanks _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Jonathan Tripathy wrote:>Ah right, so let''s say I wanted to reduce my 25GB LV down to 15GB, >are the following steps correct and safe? > >e2fsck -f /path/to/lv >resize2fs /path/to/lv 14G >lvresize /path/to/lv -L15G >resize2fs /path/to/lvYes -- Simon Hobson Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed author Gladys Hobson. Novels - poetry - short stories - ideal as Christmas stocking fillers. Some available as e-books. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
-----Original Message----- From: xen-users-bounces@lists.xensource.com on behalf of Simon Hobson Sent: Thu 07/10/2010 07:51 To: Xen-users@lists.xensource.com Subject: Re: [Xen-users] LVM and resize2fs Jonathan Tripathy wrote:>Ah right, so let''s say I wanted to reduce my 25GB LV down to 15GB, >are the following steps correct and safe? > >e2fsck -f /path/to/lv >resize2fs /path/to/lv 14G >lvresize /path/to/lv -L15G >resize2fs /path/to/lvYes ---------------------------------------------------------------------------------- Would resize2fs allow you to "over-commit" ? I''d imagine that if the LV size was smaller than expected, wouldn''t it throw an error? _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Jonathan Tripathy wrote:>Would resize2fs allow you to "over-commit" ? I''d imagine that if the >LV size was smaller than expected, wouldn''t it throw an error?Indeed it does : # lvm lvcreate -n test -L 1G vg0 Logical volume "test" created # mkfs -t ext3 /dev/vg0/test ... # fsck -f /dev/vg0/test ... # resize2fs /dev/vg0/test 2G resize2fs 1.41.3 (12-Oct-2008) The containing partition (or device) is only 262144 (4k) blocks. You requested a new size of 524288 blocks. So there''s no problem resizing the filesystem. What that won''t help with is if you resize the underlying volume to be too small for the filesystem : # lvm lvcreate -n test -L 3G vg0 Logical volume "test" created # mkfs -t ext3 /dev/vg0/test ... # fsck -f /dev/vg0/test ... # resize2fs /dev/vg0/test 2G resize2fs 1.41.3 (12-Oct-2008) Resizing the filesystem on /dev/vg0/test to 524288 (4k) blocks. The filesystem on /dev/vg0/test is now 524288 blocks long. # lvm lvresize -L 1G /dev/vg0/test WARNING: Reducing active logical volume to 1.00 GB THIS MAY DESTROY YOUR DATA (filesystem etc.) Do you really want to reduce test? [y/n]: y Reducing logical volume test to 1.00 GB Logical volume test successfully resized # fsck -f /dev/vg0/test fsck 1.41.3 (12-Oct-2008) e2fsck 1.41.3 (12-Oct-2008) Superblock has an invalid ext3 journal (inode 8). Clear<y>? no fsck.ext3: Illegal inode number while checking ext3 journal for /dev/vg0/test To prevent that, LVM would need to know about what might be in the volume and prompt you accordingly - but then it would lose that decoupling between storage volumes and filesystems. Ie, if LVM "knew about" ext2/3 (and all the other) filesystems, then it could check the contents of the volume and ask you if you were sure you wanted to screw up your data. It would significantly increase the complexity of LVM to be able to do that though. -- Simon Hobson Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed author Gladys Hobson. Novels - poetry - short stories - ideal as Christmas stocking fillers. Some available as e-books. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
________________________________ From: xen-users-bounces@lists.xensource.com on behalf of Simon Hobson Sent: Thu 07/10/2010 09:56 To: Xen-users@lists.xensource.com Subject: RE: [Xen-users] LVM and resize2fs Jonathan Tripathy wrote:>Would resize2fs allow you to "over-commit" ? I''d imagine that if the >LV size was smaller than expected, wouldn''t it throw an error?Indeed it does : # lvm lvcreate -n test -L 1G vg0 Logical volume "test" created # mkfs -t ext3 /dev/vg0/test ... # fsck -f /dev/vg0/test ... # resize2fs /dev/vg0/test 2G resize2fs 1.41.3 (12-Oct-2008) The containing partition (or device) is only 262144 (4k) blocks. You requested a new size of 524288 blocks. So there''s no problem resizing the filesystem. What that won''t help with is if you resize the underlying volume to be too small for the filesystem : # lvm lvcreate -n test -L 3G vg0 Logical volume "test" created # mkfs -t ext3 /dev/vg0/test ... # fsck -f /dev/vg0/test ... # resize2fs /dev/vg0/test 2G resize2fs 1.41.3 (12-Oct-2008) Resizing the filesystem on /dev/vg0/test to 524288 (4k) blocks. The filesystem on /dev/vg0/test is now 524288 blocks long. # lvm lvresize -L 1G /dev/vg0/test WARNING: Reducing active logical volume to 1.00 GB THIS MAY DESTROY YOUR DATA (filesystem etc.) Do you really want to reduce test? [y/n]: y Reducing logical volume test to 1.00 GB Logical volume test successfully resized # fsck -f /dev/vg0/test fsck 1.41.3 (12-Oct-2008) e2fsck 1.41.3 (12-Oct-2008) Superblock has an invalid ext3 journal (inode 8). Clear<y>? no fsck.ext3: Illegal inode number while checking ext3 journal for /dev/vg0/test To prevent that, LVM would need to know about what might be in the volume and prompt you accordingly - but then it would lose that decoupling between storage volumes and filesystems. Ie, if LVM "knew about" ext2/3 (and all the other) filesystems, then it could check the contents of the volume and ask you if you were sure you wanted to screw up your data. It would significantly increase the complexity of LVM to be able to do that though. ----------------------------------------------------------------------------------------------------------- Ah right, so this issues only really occurs when downsizing a disk then? When upsizing (as mentioned in my first post), there isn''t an issue, as resize2fs would have thrown an erro, correct? Also, on a slightly off-top note, I made a mistake: I dd''ed an image file over to a non-exsistent LV. However, dd created a new file in /dev/vg0 !! Is this really bad? Could I have currupted some of the LVs? Or is it safe to just remove the new file using rm? Thanks _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Jonathan Tripathy wrote:>Ah right, so this issues only really occurs when downsizing a disk >then? When upsizing (as mentioned in my first post), there isn''t an >issue, as resize2fs would have thrown an erro, correct?Looks like it.>Also, on a slightly off-top note, I made a mistake: I dd''ed an image >file over to a non-exsistent LV. However, dd created a new file in >/dev/vg0 !! Is this really bad? Could I have currupted some of the >LVs? Or is it safe to just remove the new file using rm?I wouldn''t have thought LVM would get too upset - it keeps it''s own details on disk. But I would expect your new file to disappear when you reboot since AFAIK /dev is dynamically built. -- Simon Hobson Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed author Gladys Hobson. Novels - poetry - short stories - ideal as Christmas stocking fillers. Some available as e-books. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
>> Also, on a slightly off-top note, I made a mistake: I dd''ed an image >> file over to a non-exsistent LV. However, dd created a new file in >> /dev/vg0 !! Is this really bad? Could I have currupted some of the >> LVs? Or is it safe to just remove the new file using rm? > > I wouldn''t have thought LVM would get too upset - it keeps it''s own > details on disk. But I would expect your new file to disappear when > you reboot since AFAIK /dev is dynamically built. >As it turns out, /dev/vg0 is just a normal folder with symlinks to /dev/mapper, so i just removed the file with rm and all is well with the world again :) _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Thu, Oct 7, 2010 at 3:25 PM, Jonathan Tripathy <jonnyt@abpni.co.uk> wrote:> As it turns out, /dev/vg0 is just a normal folder with symlinks to > /dev/mapper, so i just removed the file with rm and all is well with the > world again :)/dev/mapper is a normal directory too. the only non-normal entities are the files, which are block device files. that is, their inodes have a ''block device'' flag, and the major and minor numbers. having those, you could recreate them with ''mknod''. -- Javier _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
I am interested in knowing if this update would allow 2+ cards, or is it just set to 2 cards maximum. I have a 7 slot server board that I would like to fill with 8400 GS cards and run 7 domU''s using each of the seven cards as their output. Mike _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users