On September 29, 2010 12:11:50 pm Mark Allums wrote: > On 9/29/2010 11:00 AM, Chris Purves wrote: > > On September 29, 2010 11:46:05 am Mark Allums wrote: > >> On 9/29/2010 10:19 AM, Chris Purves wrote: > >>> I have a 500 GB disk that is full and I would like to use it and a new 1 > >>> TB disk to create a 1.5 TB logical volume. Is it possible to do this > >>> without destroying the data on the 500 GB disk? > >>> > >>> The manpage for pvcreate gives a warning that running pvcreate on a whole > >>> disk will erase the partition table (and therefore the data), but doesn't > >>> say what the effect is when running on an existing partition. > >>> > >>> I haven't used lvm2 before, and although it seems straightforward to > >>> create logical volumes with empty disks, I couldn't find any info for > >>> disks with existing data. > >> > >> It's not clear to me reading your post: Is the existing data on LVM? > >> If so, then moving it is easy. If not, then it's a little too late to > >> use LVM to move the data. > >> > >> However, you should definitely use LVM for your new setup. > >> > >> If not on LVM, it is easiest to move the data with the partition *not* > >> mounted as / (root). If you have another computer running Linux, you > >> can just temporarily move both drives over there and do it. If you only > >> have the one, then you might want to use a live CD. Boot from it, then > >> do the work. > >> > >> But *do* definitely use LVM on the new drive, and next time, you will be > >> ahead of the game. > >> > >> Some people would use rsync, and some might use chroot shenanigans, but > >> I think it's safer to mount the partition read-only and then copy the > >> files. > >> > > > > The existing data is not on LVM, but I should clarify: The 500 GB disk is > > used for file storage and is not mounted as root. I can unmount it without > > affecting the system. It occurs to me after reading your post that I could > > create the logical volume using the 1 TB drive, copy the data from the 500 > > GB drive to the logical volume, then extend the logical volume to include > > the 500 GB drive, giving me the 1.5 TB storage volume that I was looking > > for. > > > > It's still not clear to me though, if I can create the logical volume using > > the 500 GB drive without losing the data and saving the time it takes to > > copy the data over. > > > > I would have to give that some thought. I think that using LVM has to > be done on a whole drive before anything else (don't do this---don't use > it on an unpartitioned drive, you are just asking for trouble) or on a > partition at the time of partitioning. If you put LVM on a partition, > you are preparing it for further operations. So, you would be > overwriting some of the metadata and losing whatever data is on it data > on it. > > So, yeah, you have to copy it first, and then add it to the volume group > as an extent to the (1 TB) volume. >
That makes sense. Thanks for your help. -- Chris Purves "Just look at the world around you; tell me why is there so much need. Because of greed." - Damien Dempsey -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/201009291217.46324.ch...@northfolk.ca