Unable to resize the filesystem ? Device or resource busy ?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.