LVM: Wanting to remove a partition from a Volume Grou
I have a volume group Home, created as such
Code:
# pvdisplay Code:
# vgdisplay Home Code:
# pvmove /dev/hdd8 I assume that the pvmove means that there is no data hdd8. Is that a correct assumption? If yes then I will do the below. I am thinking of booting of a Knoppix LiveCD and using vgreduce Home /dev/hdd8. I will probably try use chroot to make sure that the FC install is referenced as the root directory. |
You have a VG named "Home" that is made up of two PV's, /dev/sda14 (33Gb) and /dev/hdd8 (30Gb). VG "Home" is therefore 63Gb in size.
If you look at you pvdisplay and vgdisplay outputs, you'll see that everything is fully allocated (i.e., no more free space left). So you can't get rid of /dev/hdd8 because it's currently in use. You need to free it up before you can use vgreduce. That's what the pvmove command is for. To migrate data off of PV hdd8 to some other PV in it's same volume group. But you have no room on the other PV in that group (sda14) to move anything on to, because sda14 fully allocated just like hdd8. To get hdd8 out of there, first you will need to clear up lots of space. This can be done by deleting files and then using lvreduce or lvremove to get rid of the space taked by the LV's assigned to VG "Home". Provided you remove enough stuff from VG "Home" so that it would only require 33Gb of space total (not the 63Gb it now requires), then you can start pvmove'ing and vgreduce'ing. Use df to find out how much space you're using from your LV's. Just because you may have an LV created with 30Gb of space doesn't mean that's all in use. You may be able to do some lvreduce'ing. You will need to shrink the filesystem(s) on the LV before you can use lvreduce. Luckily you used Reiser, which is shrinkable. Some other filesystem types are not shrinkable (XFS, JFS, etc.) Reduce operations always scare me. You should run a complete backup before doing this. |
You see this is the thing that made me ask about LVM:
Here is the free space on Home: 64452MB of 64706MB free |
Quote:
You're in luck. Everything you have under /home will easily fit on a CD. So backup is a no-brainer. I suggest you backup the entirity of /home to a CD. Fix your LVM, or delete it and start over, then restore /home from your backup CD. Since you'd have a solid backup of your /home to a CD, go ahead and play around to your heart's content with LVM. Resize your /home filesystem, then lvreduce, then pvmove, then vgreduce, etc. Just mess with it to learn all the steps and expose any pitfalls. If you totally destroy things in LVM, no matter ... you have a backup and can start over from scratch with LVM (if you want). Check out the LVM HowTo to learn about all the commands if you haven't already. http://tldp.org/HOWTO/LVM-HOWTO/ I'd certainly be interested in seeing your fdisk -l and cat /etc/fstab output. Not that it's relevent to your current problem. But with sda14 (FOURTEEN) and hdd8 (EIGHT) you've got to have a mess of partitions out there. Not to mention with hdd ("D") you've got to have a minor little disk farm attached (either that, or maybe a bunch of optical drives or other peripherals). I'd just be interested in seeing what you're doing with your system. Chances are you've got plenty of other disk space to backup 250Mb of /home without resorting to burning a CD (although I'd still go the CD route myself, for safety). |
Yeah I've basically set up the sda drive to house multiple distros. I've got another non-LVM partition available which I can backup the /home directory to.
The other option I thought of was (from the LVM HOWTO): # resize_reiserfs -s-30.31G /dev/Home/lvol0 # lvreduce -L-30.31G /dev/Home/lvol0 then # vgreduce Home /dev/hdd8 |
Sorry to barge in to learn something about LVM.
I have stayed away from LVM so that I can do whatever I wish with the partitions (got 60 and 57 partitions in my two IDE disks). Looking at the problem reported here I wonder what benefit do we get ourselves into opting for LVM. I understand a LVM can link partitions across different disks but if we not not doing it what is the point of using it? I know Grub (and possibly Lilo) has a problem of booting from a LVM because at the booting stage a boot loader has no access to a kernel and can't possibly go inside a LVM to find data to load. That limitation alone is an deterrent for users wanting to multiboot different systems. Have I got this wrong? I ask the above question because it seems a user needs to do something extraordinary just to delete a partition. |
Quote:
|
Quote:
|
Code:
[root:~#] resize_reiserfs -s-30.31G /dev/Home/lvol0 Code:
[root:~#] umount /home |
I can't comment on the Reiser resizing. I've only resized ext3 and xfs, and then, only to grow them, not shrink them.
Maybe I can help on the unmounting part though. I do not know whether Reiser wnats to be mounted or unmounted for resizing. I assume unmounted, because that's what you're trying to do here. I know ext3 needs to be unmounted to resize, but xfs and jfs are resized while they are mounted. I just don't know about Reiser. I assume you checked into that. Whenever I'm doing my resizing, on my desktop system where I am the only user, I always drop down to single-user mode. That makes unmounting things much easier. Gets rid of all those other pesky user processes that cling to the filesystems making them hard to unmount (your "device is busy" errors). Here's how I would resize a filesystem on my Debian computer. The steps should be similar on whatever distro you are using, but you may have to alter the final telinit command if your default multi-user runlevel is not 2 like mine. Also, your resize'ing and fsck'ing commands will be different for Reiser. Code:
From Gnome, KDE, etc... |
Regarding the resize_reiserfs command. Does that take only whole numbers? If that's the case and I issue the commands as follows:
resize_reiserfs -s -31G /dev/Home/lvol0 lvreduce -L-31G /dev/Home/lvol0 vgreduce Home /dev/hdd8 Should that work? |
So I did what I last posted.
Then I did: Code:
# mkfs.reiserfs /dev/hdd8 Code:
[root:~#] cat /etc/fstab | grep Store |
I hadn't resized the partition so the below did the trick
# resize_reiserfs -f /dev/Store/lvol0 Which now gives: Code:
[jongi:~#] df -h /mnt/Store/ EDIT: My only concern now (and it is a small one) is that free 708MB under Home. |
I can't remember now but I think I solved the last issue by running:
# pvextend -l +177 Home /dev/Home/lvol0 |
All times are GMT -5. The time now is 03:48 AM. |