Re: resizing an lvm volume with setup-storage
Hello Michael, Could you give 3.3.4+experimental2 another chance? That one should not do pvcreate on volumes that are part of that volume group already. I found another issue on the LVM resize option : it always preserves the partition. This is not appropriate, as when resizing /usr like I do one is expecting the partition to be cleaned before the new installation. Also, setup-storage fails if the partition does not already exist : Can't preserve /dev/vg0/usr because it does not exist IMHO the resize option should behave as follows: if (the volume exists) { resize the volume if (a preserve* flag is also set for this volume) { resize the filesystem } else { create a new filesystem } } else { ignore the resize flag and create a new volume + filesystem } -- Nicolas
Re: resizing an lvm volume with setup-storage
> Hello Michael, > > Could you give 3.3.4+experimental2 another chance? That one should not do > pvcreate on volumes that are part of that volume group already. > I found another issue on the LVM resize option : it always preserves > the partition. This is not appropriate, as when resizing /usr like I > do one is expecting the partition to be cleaned before the new > installation. Also, setup-storage fails if the partition does not > already exist : > > Can't preserve /dev/vg0/usr because it does not exist > > > IMHO the resize option should behave as follows: > if (the volume exists) { > resize the volume > if (a preserve* flag is also set for this volume) { >resize the filesystem > } else { >create a new filesystem > } > } else { > ignore the resize flag and create a new volume + filesystem > } > I believe that it's mostly a matter of naming and/or using the options somewhat differently: - If you don't want to preserve data, there is no reason to use resize or preserve. Just specify the size and you get what you want. - If you want to preserve data but need to change sizes, you use "resize". - If you really want setup-storage not to touch some volume, use one of the preserve options. Where preserve is one of preserve_always, preserve_reinstall or preserve_lazy. The latter seems to be still buggy, as you noted, that has to be fixed. I'm not sure whether this was a problem of missing documentation/clarification or rather a real wish to alter behaviour. Best, Michael pgpTn3n6hfJBD.pgp Description: PGP signature
setup-storage and preserving partitions
We have been using FAI for several years, but have just started to try disk partitioning with setup-storage. Our standard disk configuration uses 2 primary partitions and 3 logical partitions. We would like to preserve the *size* of all partitions and preserve the *contents* of only the last two logical partitions. Here is how we did this with setup_harddisks: disk_config sda primary / preserve1 defaults,errors=remount-ro ; -j ext3 format primary swappreserve2 sw ; format logical /varpreserve5 defaults,errors=remount-ro ; -j ext3 format logical /home preserve6 defaults,nosuid,nodev,errors=remount-ro ; ext3 logical /d1 preserve7 defaults,nosuid,nodev,errors=remount-ro ; ext3 I have not been able to find the proper syntax to use with setup-storage to achieve this same result. I think it should look something like the following, but I'm not sure what to put in the "size" column: disk_config sda disklabel:msdos bootable:1 preserve_always:6,7 primary / ?? ext3 defaults,errors=remount-rocreateopts="-j" primary swap ?? swap sw logical /var ?? ext3 defaults,errors=remount-rocreateopts="-j" logical /home ?? ext3 defaults,nosuid,nodev,errors=remount-ro logical /d1?? ext3 defaults,nosuid,nodev,errors=remount-ro (Note that the partition sizes may vary from machine to machine.) Any help or suggestions would be appreciated. Thank you. Jeff Stolte
Re: setup-storage and preserving partitions
> We have been using FAI for several years, but have just started to try > disk partitioning with setup-storage. Our standard disk configuration > uses 2 primary partitions and 3 logical partitions. We would like > to preserve the *size* of all partitions and preserve the *contents* > of only the last two logical partitions. Here is how we did this > with setup_harddisks: > > disk_config sda > primary / preserve1 defaults,errors=remount-ro ; -j ext3 format > primary swappreserve2 sw ; format > logical /varpreserve5 defaults,errors=remount-ro ; -j ext3 format > logical /home preserve6 defaults,nosuid,nodev,errors=remount-ro ; ext3 > logical /d1 preserve7 defaults,nosuid,nodev,errors=remount-ro ; ext3 > > I have not been able to find the proper syntax to use with setup-storage > to achieve this same result. I think it should look something like the > following, but I'm not sure what to put in the "size" column: > > disk_config sda disklabel:msdos bootable:1 preserve_always:6,7 > primary / ?? ext3 defaults,errors=remount-rocreateopts="-j" > primary swap ?? swap sw > logical /var ?? ext3 defaults,errors=remount-rocreateopts="-j" > logical /home ?? ext3 defaults,nosuid,nodev,errors=remount-ro > logical /d1?? ext3 defaults,nosuid,nodev,errors=remount-ro > > (Note that the partition sizes may vary from machine to machine.) > > Any help or suggestions would be appreciated. Thank you. > I think I never thought of such a use case :-) - whatever the reasons may be that you are so keen on preserving sizes, as apparently nobody requested "preserve the size only" before, that feature is indeed missing. For partitions 6 and 7 you can either say preserve6, preserve7 or just put some arbitrary size in there. For the others, however, we'll need a new option :-( For the moment, the only workaround I can see is a hook that does the formatting after setup-storage has run, but that shall not be the long-term solution. The easiest approach would be some additional option preserve_size, but I'm not sure whether this is the best thing to do. Could you maybe give me a brief account of your rationale behind preserving the size only to gain a better understanding? Thanks a lot, Michael pgpk1KLjUw6b4.pgp Description: PGP signature
Re: resizing an lvm volume with setup-storage
I found another issue on the LVM resize option : it always preserves the partition. This is not appropriate, as when resizing /usr like I do one is expecting the partition to be cleaned before the new installation. Also, setup-storage fails if the partition does not already exist : Can't preserve /dev/vg0/usr because it does not exist IMHO the resize option should behave as follows: if (the volume exists) { resize the volume if (a preserve* flag is also set for this volume) { resize the filesystem } else { create a new filesystem } } else { ignore the resize flag and create a new volume + filesystem } I believe that it's mostly a matter of naming and/or using the options somewhat differently: - If you don't want to preserve data, there is no reason to use resize or preserve. Just specify the size and you get what you want. - If you want to preserve data but need to change sizes, you use "resize". - If you really want setup-storage not to touch some volume, use one of the preserve options. Where preserve is one of preserve_always, preserve_reinstall or preserve_lazy. The latter seems to be still buggy, as you noted, that has to be fixed. I'm not sure whether this was a problem of missing documentation/clarification or rather a real wish to alter behaviour. Right, remove the existing volume and create a new one is just as good as resizing. I have just missed the easier way to do it. The only remaining question is what to do if the volume to be resized does not exist : setup-storage may either complain as it currently does, or ignore the resize flag. As you say it's mainly a documentation issue. My feeling is that the volume line (IE I want an 8GiB volume) has a higher weight than the resize option, but although I represent 100% of the users by now I may be wrong. -- Nicolas
Re: setup-storage and preserving partitions
On Fri, Mar 26, 2010 at 05:01:00PM +0100, Michael Tautschnig wrote: > > I think I never thought of such a use case :-) - whatever the reasons > may be that you are so keen on preserving sizes, as apparently > nobody requested "preserve the size only" before, that feature is > indeed missing. For partitions 6 and 7 you can either say preserve6, > preserve7 or just put some arbitrary size in there. For the others, > however, we'll need a new option :-( > > For the moment, the only workaround I can see is a hook that does > the formatting after setup-storage has run, but that shall not be > the long-term solution. > > The easiest approach would be some additional option preserve_size, > but I'm not sure whether this is the best thing to do. Could you > maybe give me a brief account of your rationale behind preserving > the size only to gain a better understanding? > > Thanks a lot, > Michael Thank you for your quick reply to my question. I'm somewhat relieved to know that I wasn't missing some obvious option. :) As for our rationale behind preserving the partition sizes, I think we've always felt that there was much less risk of data loss if we modified the existing disk as little as possible. Also, many times our users have filled their /home and /d1 partitions to near capacity, so there is little disk space left for re-sizing. We also just like knowing that most of our machines (300-400) have the exact same size system partitions. (This is important for estimating backup capacity, etc.) (I should mention that one of our main uses of FAI is to upgrade machines from one Debian release to the next. However, rather than do an in-place upgrade, we do a fresh install of the new release while preserving the existing partition sizes on the disk.) I hope this makes some sense. If no one else has asked for this capability, though, maybe we need to reconsider our practice of preserving partition sizes. I don't want you to have to add an option that no one else uses or that is not considered to be a "best practice". Let me know if you need any additional information. Thanks. Jeff