[plug] Disk space follow-up

Dave Dartnall darts at dialix.com.au
Wed Jun 14 10:02:47 WST 2006


Regarding installation of LVM, my experience as promised.

As recently discussed with Tomasz, Ben, Patrick and Bernd about creating 
an LVM logical  volume to solve my /usr disk space problem, I created a 
30 gig Linux LVM partition (type 8E) on free space on my new drive using 
cfdisk , initialised it as a physical volume (pvcreate /dev/hdc1), 
created a volume group 'main' (vgcreate main /dev/hdc1) and a 6 gig 
logical volume 'lv_usr' (lvcreate -L6G -nlv_usr main) with reiserfs 
filesystem (mkreiserfs /dev/main lv_usr) on it. I decided to deal with 
/usr first - might be less confusing to do them one at a time and deal 
with /var later.
I created a new directory /mnt/newusr and mounted /dev/main/lv_usr 
there. and all data from /usr was copied to it          (cp -avx /usr/* 
/mnt/newusr).

 "cd /" followed by "mv usr usr.old" in order to have a backup if 
anything goes wrong which is what Daniel Robbins (drobbins at gentoo.org 
whose instruction I'd been following "Learning linux LVM, Part 2") says, 
resulted in the message 'Cannot move usr to usr.old: Device or resource 
is busy'.

So I ignored that and went to modify fstab,  but was initially stopped 
by Mandriva's comment in fstab that 'This file is edited by fstab-sync - 
see 'man fstab-sync' for details'.  At first I wasn't sure whether 
direct editing was in order but it seemed that operation of fstab-sync 
related to recognition of new hardware and I went ahead anyway.

I created a new directory /old/usr and modified fstab to:
     (a)     mount /dev/hdb8 there. It seemed to me that this would make 
sense in that I would still have access to                            
the old /usr on hdb8, and no need to keep a backup.
    (b)      mount /dev/main/lv_usr at the now available /usr.

Success thanks to your help! - I still have to deal with /var.

There are just two points which you may be able to clear up:

1. df  returns for my new filesystem:
             /dev/mapper/main-lv_usr    6.0G  2.4G  3.7G  39% /usr
    and not as I expected:
             /dev/main-lv_usr    6.0G  2.4G  3.7G  39% /usr

2. You suggest that I "Clean up old log files (in /var/log) before you 
do anything else"
            Specifically does that mean that all files in ?var/log can 
be deleted? Even as root, they don't seem to want to go!

Thanks again

Dave Dartnall




More information about the plug mailing list