Skip to contentSkip to conversation

lvextend problem

linux-lvm Guilio Iannazzo 2 participants 2 messages Feb 27, 2007

lore
Share & tools
lore
#0 lore raw

Hi,
about the *environment* :
[root@priscilla var]# cat /proc/version
Linux version 2.4.21-20.ELsmp ([email protected]) (gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-42)) #1 SMP Wed Aug 18 20:46:40 EDT 2004

The *problem* :
I extended a logical volume following the procedure

umount -l /dev/Volume00/var

lvextend -L+5G /dev/Volume00/var
e2fsck -f /dev/Volume00/var
mount -l /dev/Volume00/var

The ouput of e2fsck was as following :

[root@priscilla var]# e2fsck -f /dev/Volume00/var e2fsck 1.32 (09-Nov-2002)
Pass 1: Checking inodes, blocks, and sizes Duplicate blocks found... invoking duplicate block passes. Pass 1B: Rescan for duplicate/bad blocks Duplicate/bad block(s) in inode 40962: 164114 164115 164117 Duplicate/bad block(s) in inode 122885: 491781 Pass 1C: Scan directories for inodes with dup blocks. Pass 1D: Reconciling duplicate blocks
(There are 2 inodes containing duplicate/bad blocks.)

File /run/utmp (inode #40962, mod time Tue Feb 27 10:20:28 2007)
has 3 duplicate block(s), shared with 1 file(s):
<filesystem metadata>
Clone duplicate/bad blocks<y>? yes

File /log/audit.d/bin.1 (inode #122885, mod time Tue Feb 27 14:01:00 2007)
has 1 duplicate block(s), shared with 1 file(s):
<filesystem metadata>
Clone duplicate/bad blocks<y>? yes

Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information

/dev/Volume00/var: ***** FILE SYSTEM WAS MODIFIED ***** /dev/Volume00/var: 553/1572864 files (14.8% non-contiguous), 706071/6291456 blocks

Now, once the filesystem mounted, I've lost all the data I had on /var (which I didn't back up, I know I know it's extremely stupid, luckily enough this is not a production machine). For example

[root@priscilla var]# ll /var/
total 0

however

[root@priscilla var]# mkdir /var/log
mkdir: cannot create directory `/var/log': File exists

??
What happened ? How to get all the data back ?
Thank you

Giulio

#1 lore raw
Quoted 9 lines · Guilio Iannazzo

Hi,
about the *environment* :
[root@priscilla var]# cat /proc/version
Linux version 2.4.21-20.ELsmp ([email protected]) (gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-42)) #1 SMP Wed Aug 18 20:46:40 EDT 2004

The *problem* :
I extended a logical volume following the procedure

umount -l /dev/Volume00/var

from umount man page:
-l Lazy unmount. Detach the filesystem from the filesystem hierar-
chy now, and cleanup all references to the filesystem as soon as it is not busy anymore. (Requires kernel 2.4.11 or later.)

the key phrase here is: "as soon as it is not busy anymore"

Quoted 1 line

lvextend -L+5G /dev/Volume00/var

harmless

Quoted 1 line

e2fsck -f /dev/Volume00/var

so you fscked an active filesystem, bad bad bad...

--- i think you wanted to resize2fs here ---

Quoted 1 line

mount -l /dev/Volume00/var

'mount -l' is _not_ the opposite of 'umount -l'

....

Quoted 7 lines

Now, once the filesystem mounted, I've lost all the data I had on /var (which I didn't back up, I know I know it's extremely stupid, luckily enough this is not a production machine). For example

[root@priscilla var]# ll /var/
total 0

Quoted 7 lines

however

[root@priscilla var]# mkdir /var/log
mkdir: cannot create directory `/var/log': File exists

??
What happened ? How to get all the data back ?

is the filesystem really mounted now?

- reboot the machine into single user
- fsck the filesystem again
- and try mounting it and check all data is still here. if it is:
- backup your data
- umount the filesystem (really, not using -l)
- fsck -f - resize2fs
- mount again
- return to multi-user

Signature · 6 lines
Luca Berra -- [email protected]
       Communication Media & Services S.r.l.
/"\
\ /     ASCII RIBBON CAMPAIGN
 X        AGAINST HTML MAIL
/ \