LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 05-14-2014, 04:27 AM   #1
smilemukul
Member
 
Registered: Jun 2009
Distribution: Redhat,CentOS,Ubuntu,Puppet
Posts: 292

Rep: Reputation: 34
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 ?
 
Old 05-14-2014, 06:48 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Quote:
Originally Posted by smilemukul View Post
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.
 
Old 05-14-2014, 10:08 AM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
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.
 
Old 05-16-2014, 08:38 AM   #4
smilemukul
Member
 
Registered: Jun 2009
Distribution: Redhat,CentOS,Ubuntu,Puppet
Posts: 292

Original Poster
Rep: Reputation: 34
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.
 
Old 05-16-2014, 09:10 AM   #5
grim76
Member
 
Registered: Jun 2007
Distribution: Debian, SLES, Ubuntu
Posts: 308

Rep: Reputation: 50
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mkfs cannot open <device>: Device or resource busy maccas17 Fedora 3 11-14-2013 01:38 PM
[SOLVED] device-mapper: remove ioctl on failed: Device or resource busy jheengut Linux - Kernel 1 10-23-2013 08:38 AM
Error opening PCM device Device or resource busy Herbivore Linux - Newbie 2 08-23-2008 01:45 AM
Can't open audio device. Device or resource busy. deepumnit Linux - Software 2 06-16-2008 09:36 AM
Unable to nfs umount:Device or resource busy nabil Linux - General 3 05-05-2002 07:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration