Hi, thanks for the response!
You've pretty much got what I was trying to do. Using your advice and what I could learn from your linked sources (plus
http://www.linuxhomenetworking.com/l...m#_Toc92547584), I've done a lot since.
I got a bit carried away with the LVM thing in that I've gone and created a second Volume Group "VolGroup01" with Logical Volume "LogVol01" for use as the back-up area when, as you say, it could have just been a normal partition or I could have just added it as another logical volume to the VolGroup00. Oh well, that part seems to be working OK, anyway.
All I have left to do is finish enlarging the original Volume Group (VolGroup00). I'm now confused/stuck on how to finish this. I think my issues are:
- I need to unmount VolGroup00/LogVol00 before resizing it, to include the file system space added from the PV "/dev/hda3" which is now part of LV "LogVol00". I've done all the below so far in a normal terminal window (nothing affected any files in use). Where VolGroup00 contains the filesystem root "/" (which is always in use?), how do I do the required unmount, resize2fs and mount? Can I just exit to single user mode and do it there?
- I believe the commands I will need to run are:
Code:
umount /dev/VolGroup00/LogVol00/dev/VolGroup00/LogVol00
resize2fs /dev/VolGroup00/LogVol00
mount /dev/VolGroup00/LogVol00 /
Does this look correct?
A run down of what I've done already is below.
Thanks!
Don
Actions taken since last post:
Created two new partitions /dev/hda3 & /dev/hda4 using QTparted. Created as ext3, later changed to type LVM using fdisk. Picking up from there:
First, figure out where we are:
Code:
[root@localhost ~]# fdisk -l
Disk /dev/hda: 120.0 GB, 120034123776 bytes
128 heads, 63 sectors/track, 29072 cylinders
Units = cylinders of 8064 * 512 = 4128768 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 25 100768+ 83 Linux
/dev/hda2 26 969 3806208 8e Linux LVM
/dev/hda3 970 14458 54387648 8e Linux LVM
/dev/hda4 14459 29072 58923648 8e Linux LVM
Next, create new physical volumes, new volume group, and associated new logical volume:
Code:
[root@localhost ~]# pvcreate /dev/hda3
Physical volume "/dev/hda3" successfully created
[root@localhost ~]# pvcreate /dev/hda4
Physical volume "/dev/hda4" successfully created
[root@localhost ~]# vgscan
Reading all physical volumes. This may take a while...
Found volume group "VolGroup00" using metadata type lvm2
[root@localhost ~]# vgdisplay VolGroup00
--- Volume group ---
VG Name VolGroup00
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size 3.62 GB
PE Size 32.00 MB
Total PE 116
Alloc PE / Size 115 / 3.59 GB
Free PE / Size 1 / 32.00 MB
VG UUID 3D0xJe-q1Bv-JGwN-B41j-10sG-hiOa-DEDQb4
[root@localhost ~]# vgcreate VolGroup01 /dev/hda4
Volume group "VolGroup01" successfully created
[root@localhost ~]# vgdisplay VolGroup01
--- Volume group ---
VG Name VolGroup01
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 1
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size 56.19 GB
PE Size 4.00 MB
Total PE 14385
Alloc PE / Size 0 / 0
Free PE / Size 14385 / 56.19 GB
VG UUID tybcVI-5RZZ-7x7l-2vCZ-ixt0-SD0i-QmSljO
[root@localhost ~]# lvcreate -l 14385 VolGroup01 -n LogVol01
Logical volume "LogVol01" created
[root@localhost ~]# vgdisplay VolGroup00
--- Volume group ---
VG Name VolGroup00
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size 3.62 GB
PE Size 32.00 MB
Total PE 116
Alloc PE / Size 115 / 3.59 GB
Free PE / Size 1 / 32.00 MB
VG UUID 3D0xJe-q1Bv-JGwN-B41j-10sG-hiOa-DEDQb4
Extend VolGroup00 to include new physical volume, verify:
Code:
[root@localhost ~]# vgextend VolGroup00 /dev/hda3
Volume group "VolGroup00" successfully extended
[root@localhost ~]# vgdisplay VolGroup00
--- Volume group ---
VG Name VolGroup00
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 4
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 2
Act PV 2
VG Size 55.47 GB
PE Size 32.00 MB
Total PE 1775
Alloc PE / Size 115 / 3.59 GB
Free PE / Size 1660 / 51.88 GB
VG UUID 3D0xJe-q1Bv-JGwN-B41j-10sG-hiOa-DEDQb4
Finish up with the new VG/LV via formatting it:
Code:
[root@localhost ~]# mkfs -t ext3 /dev/VolGroup01/LogVol01
mke2fs 1.36 (05-Feb-2005)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
7372800 inodes, 14730240 blocks
736512 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=16777216
450 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 35 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
Need to be able to access VolGroup01 through a named mount point, so why not use "/backup" as the name, as it is intended to support backups of the rest of the machine...
Code:
[root@localhost ~]# mkdir /backup
[root@localhost ~]# vi /etc/fstab
used vi to add the following line to fstab:
Code:
/dev/VolGroup01/LogVol01 /backup ext3 defaults 1 2
and finishing from there, confirming where things are left...
Code:
[root@localhost ~]# mount -a
[root@localhost ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
3.1G 2.8G 136M 96% /
/dev/hda1 96M 16M 76M 17% /boot
none 125M 0 125M 0% /dev/shm
/dev/mapper/VolGroup01-LogVol01
56G 85M 53G 1% /backup
[root@localhost ~]# ls /backup
lost+found
[root@localhost ~]# vgscan
Reading all physical volumes. This may take a while...
Found volume group "VolGroup01" using metadata type lvm2
Found volume group "VolGroup00" using metadata type lvm2
Now all is done except for completing the original resizing of VolGroup00-LogVol00...?