Partition Expansion DEBATE
Greetings
I am having a debate with my colleague regarding the below case and i would really like to hear your opinions: Scenario: You have an alix PC engines board which carries an 80GB HDD with CentOS 5.5 installed. You image the hard drive because you know that you will make ten (10) more of such systems with the exact same hardware. Partitions: hda1 - / (mount point) - 30GB hda2 - ext3 (or LVM) - 50GB Now, you are trying to clone the system which means you get the new hardware , which as stated is is exactly the same, and you copy the image to the new HDD. BUT The new hard drive is not 80GB it is 120GB, and i am asking: 1) When you dd the image (of 80GB) to the 120GB disk and connected to the system, what will CentOS recognize? I mean will the OS have the partitions as before and recognize the rest space as free? 2) Million dollar question: In case the OS will recognize the rest space as free, and we are able to use it, if we want to expand the hda1 partition will the procedure be the same with LVM or ext3? I mean if we want to expand the rest space to the hda2 (second partition) would it be easier if the particular partition is an LVM or just an ordinary ext3. Thanks |
Quote:
|
Nope. Once you "dd" the image over the target drive, the drive geometry (basically cylinder count) will be replaced. Your 120 Gig will magically become an 80 Gig drive.
Yet another reason to stay away from "dd". Use a kickstart or something like clonezilla - it is data aware. They also have a multicast option which I've not looked at. |
So there is no way, somehow, to achieve this WITHIN the OS even if the partitions were LVM. For isntance, what if you have an LVM volume consisted of 2 partitions and then you make the unallocated space a new LVM partition and add it to your existed with result expanding its storage? Is that possible?
|
For an ext3 or ext4 (not ext2) filesystem that was built with the "resize-inode" feature, kernel versions 2.6 and up support online resizing. See the manpage for resize2fs for details. You have several options for doing this, both with and without LVM, but working from within the OS, the size of that 30GB non-LVM root filesystem would be very hard to change. Expanding that second partition and filesystem(s) within it, however, is fairly straightforward.
Without LVM:
With LVM - Method A: Expand existing partition:
With LVM - Method B: Add a new partition (safest):
Note that this fairly simple case is easier without LVM, but using LVM would allow you to have more than one filesystem in that second partition and make it easier to redistribute the space (perhaps adding an additional drive) in the future. |
All times are GMT -5. The time now is 11:47 PM. |