Adding a new hard drive

Cheetoz

[H]ard|Gawd
Joined
Mar 3, 2003
Messages
1,972
My current hard drive is running out of space, and I will buy a new drive. Problem is I want to expand the space of where the first hard drive is mounted, and not create a new point for the second drive. I cant to lose my data, so I can't setup a RAID0.

What can I do?
 
As Boomslang said, you'll need to use LVM to accomplish what you're talking about. It stands for Logical Volume Manager and allows you to group multiple physical partitions together into one logical partition (eg / is spread across both discs). In order to accomplish this, you'll need to boot a LiveCD and configure your new drive for LVM and get it formatted and whatnot. (Make sure to leave /boot off LVM because getting grub to boot from LVM can be a bitch, if i remember correctly) Then you copy your current system over to the new drive, and reconfigure grub to point to the copy. Unplug your old drive and make sure the system is still functional on the new drive. Once you're up and running on the copy, you can safely delete the data on the original drive. Configure it for LVM and add it to your new drive's logical partition.

Too complicated? If I am to assume the system in your sig is the one you want to upgrade, then a new drive is going to be significantly larger. Also, I'm going to assume you built that system ages ago and the hard drive in it is aging closer and closer to data loss. What I'm trying to say is, if I were you I'd get a new drive, install a clean system to the new drive and copy the data from /home to the new install, and leave nothing critical on the old hard drive (like use the entire 80GB for windows :-p)
 
I need help with LVM. (I'm using webmin as the frontend)

I formatted the new drive for lvm, shifted the files, and it worked fine. I then added my old drive as a physical volume to the LVM, it said all the data on the drive will be erased. Ok, good. But then I couldn't see how to add the hard drive to the logical volume.

I google'd and found the lvextend command. So i did that, and got the logical volume to the complete size of both drives. But mounting it showed only the free space on one hard drive. I guess I have to format it to LVM and then EXT3 myself...

So now trying to remove the physical volume from the volume group gives me an error that there is no extends to allocate the data. Using vgreduce tells me the hard drive is in use.
 
lvextend only deals with the logical volume, it doesn't touch the filesystem contained within. You'll need to manually grow the filesystem.
 
Back
Top