LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Unable to resize the filesystem ? Device or resource busy ? (https://www.linuxquestions.org/questions/linux-newbie-8/unable-to-resize-the-filesystem-device-or-resource-busy-4175504951/)

smilemukul 05-14-2014 04:27 AM

Unable to resize the filesystem ? Device or resource busy ?
 
Hi,

I tried to resize2fs after shrinking a lv & reduced it, then umounted the lv (with -l) but resize2fs still gives the same error.Also can't fsck after umounting the filesystem.

I am able to umount the filesystem but while executing resize2fs or fsck, its giving error as,

# resize2fs /dev/vg/lv1
resize2fs 1.41.12
resize2fs: Device or resource busy while trying to open /dev/vg/lv1
Couldn't find valid filesystem superblock.

# e2fsck -f /dev/vg/lv1
e2fsck 1.41.12
/dev/vg/lv1 is in use.
e2fsck: Cannot continue, aborting.

Troubleshooting done :

I found nothing in
1. lsof
2. fuser
3. nothing in netstat holding 2049 (this filesystem is exported via nfs)
4. Tried exportfs -ufv <host>:/test to unmount the shares but when tring to fsck or resize2fs, this gives the same error message.
5. No entry of share in /etc/mtab & /proc/mounts

Any help or pointers ?

syg00 05-14-2014 06:48 AM

Quote:

Originally Posted by smilemukul (Post 5170557)
I tried to resize2fs after shrinking a lv
...
Any help or pointers ?

Great way to corrupt a filesystem. You have effectively chopped off the end of the filesystem - hence fsck complains.
You must reduce the filesystem first before shrinking a lv (or real partition).

If you are lucky you can simply resize the lv to be the same size as it was (or larger), then run fsck to see if the filesystem is still ok. Then resize the filesystem smaller, then the lv - being careful to make sure it is at least as large as the filesystem.

rknichols 05-14-2014 10:08 AM

I would advise using vgcfgrestore with the appropriate config file in /etc/lvm/archive/ to put that LV back in its previous state. That way you are assured that it gets the same extents that it was previously using. Depending on the history of that VG, just resizing the LV back to its old size might assign different extents, and that would not give you a working filesystem.

smilemukul 05-16-2014 08:38 AM

no, I had reduced the filesytem but my issue is as I am unable to execute the resize2f as some process might be using but did find any process.

resize2fs: Device or resource busy while trying to open /dev/vg/lv1
Couldn't find valid filesystem superblock.

grim76 05-16-2014 09:10 AM

What they are telling you is that you did your steps in the wrong order. You should have reduced your file system first then the LV. Not in the order that you told us you have done.


All times are GMT -5. The time now is 12:07 PM.