Operating System - HP-UX
1833846 Members
2036 Online
110063 Solutions
New Discussion

Re: How to check mounted filesystem

 
SKSingh_1
Frequent Advisor

How to check mounted filesystem

Hi,

I have a directory corrupted.

$ ll sks.test
sks.test/dmdata not found
total 0
drwxr-xr-x 2 root sys 96 Nov 17 2006 dmdata10
drwxr-xr-x 2 root sys 96 Mar 17 2007 dmdata11
drwxr-xr-x 2 root sys 96 Mar 17 2007 dmdata12
drwxr-xr-x 2 root sys 96 Sep 14 2007 dmdata13
drwxr-xr-x 2 root sys 96 Sep 14 2007 dmdata14
$ bdf sks.test
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 204800 54539 141300 28% /
$
$ uname -a
HP-UX sks01 B.11.00 U 9000/800 661389373 unlimited-user license
$


Do we have any option to check and fix mounted filesystem corruption. I can't reboot server now as its production.
23 REPLIES 23
Sajjad Sahir
Honored Contributor

Re: How to check mounted filesystem

Dear SKsingh
u can use mount command
or bdf
both will display mounted file system
thanks and regards

Sajjad
SKSingh_1
Frequent Advisor

Re: How to check mounted filesystem

I ma not sure how mount command will fix filesystem issue. please see there is i/o error for one directory "dmdata".
Jeeshan
Honored Contributor

Re: How to check mounted filesystem

Hi SKS

File system repair you can use fsck command

#fsck /dev/vg/lv
a warrior never quits
Sajjad Sahir
Honored Contributor

Re: How to check mounted filesystem


what type of file system it is
fstyp /dev/vg03/logicalvolme
give me out put

sajjad
SKSingh_1
Frequent Advisor

Re: How to check mounted filesystem

#fsck -F vxfs -o full,nolog /dev/vg00/lvol3
vxfs fsck: /dev/vg00/lvol3 is currently mounted
#fsck -F vxfs -o full,nolog /dev/vg00/rlvol3
vxfs fsck: /dev/vg00/rlvol3 is currently mounted
#
Sajjad Sahir
Honored Contributor

Re: How to check mounted filesystem


fsck never work on mounted file system
u have ot umount it

sajjad
Sajjad Sahir
Honored Contributor

Re: How to check mounted filesystem

Dear

u have to umount
umount /umountpoint

then do fsck
ok
SKSingh_1
Frequent Advisor

Re: How to check mounted filesystem

You know this is root FS....can't Unmount!!
any solution without reboot?
SKSingh_1
Frequent Advisor

Re: How to check mounted filesystem

Even removal didn't work.

#rm -r /sks.test
rm: cannot stat /sks.test/dmdata: I/O error
rm: directory /sks.test not removed. Directory not empty
#
Jeeshan
Honored Contributor

Re: How to check mounted filesystem

Hi again

did you try the command

#fsck -o full /dev/vg/lvol
a warrior never quits
Jeeshan
Honored Contributor

Re: How to check mounted filesystem

Hi again

did you try the command?

#fsck -o full /dev/vg/lvol
a warrior never quits
Sajjad Sahir
Honored Contributor

Re: How to check mounted filesystem

dear pls give me out put of this
i have to confirm it which type of file ystem it is

fstup /dev/vg00/lvol3

pls revert back soon

sajjad
Sajjad Sahir
Honored Contributor

Re: How to check mounted filesystem

dear Sikh sorry there is mistake i have written above fstyp no need to use that one
I think i typed wrongly. if u root file sytem is corrupted, u have to boot in single usermod and do fsck i don't know any other option

thanks and regards

sajjad
Sajjad Sahir
Honored Contributor

Re: How to check mounted filesystem

dear brohter you have Online-JFS?

sajjad
SKSingh_1
Frequent Advisor

Re: How to check mounted filesystem

yes I have online JFS. fstype is vxfs.
SKSingh_1
Frequent Advisor

Re: How to check mounted filesystem

Hi ahsan,

same error.

#fsck -o full /dev/vg00/lvol3
vxfs fsck: /dev/vg00/lvol3 is currently mounted
#
Sajjad Sahir
Honored Contributor

Re: How to check mounted filesystem

dear friend

I told u u can't do fsck on mounted file system u should umount it first then only u can do fsck, but in u case it is root file system, so that u have to take system in single user mode then do fsck

thanks and regards

sajjad
Sajjad Sahir
Honored Contributor

Re: How to check mounted filesystem


dear friend

u can't take system in single user mode

why u want to remove that directory?

if u want to remove that directory

u can use rm -rf command. ok but remember

it will remove u directory and all contents including subdirectories under that directoires of in it without any warning. so u should careful about use of that command
rm -r never remove only an empty directory
thanks and regards

Sajjad Sahir
Yogeeraj_1
Honored Contributor

Re: How to check mounted filesystem

hi,

Try the following:
Step 1.

$ du -sk /sks.test

Step 2.
Find a directory which resides on a file system other than / and has enough space to contain the directory size as retrived in step 1.


Step .3
Move /sks.test //

post the output of all commands executed above.

revert!
kind regards
yogeeraj

No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Dennis Handly
Acclaimed Contributor

Re: How to check mounted filesystem

How much space is in sks.test/dmdata? Do you care if you lose the space and/or the files?

If you can't unmount the file system and you don't want to shut the system down, you can just use a hammer on that directory and delete it:
# /sbin/unlink sks.test/dmdata

Make sure you read the WARNINGS on unlink(1m).
Rasheed Tamton
Honored Contributor

Re: How to check mounted filesystem

Hi,

>#rm -r /sks.test
rm: cannot stat /sks.test/dmdata: I/O error
rm: directory /sks.test not removed. Directory not empty
#

Is this /sks.test/dmdata a local file system or NFS mounted, etc.

Can you post the output of the below:

fuser -u /sks.test/dmdata

find /sks.test|grep dmdata
bdf /sks.test/dmdata
cd /sks.test/dmdata
ll
bdf .


If you do not use unlink as above and if you are sure that you do not want the data, try doing a rm from inside the dir and you must have the correct permissions for doing that - no ACL ,etc.

cd /sks.test/dmdata
pwd
rm -rf * (make sure you are inside the /sks.test/dmdata dir, before you do a rm -rf)

or
cd /sks.test
pwd
rm -rf dmdata

Did you check the syslog.log for any disk related errors, etc.

Let us see the result.

Rgds.
SKSingh_1
Frequent Advisor

Re: How to check mounted filesystem

I have given details that this is on / filesystem. Its a empty directory with filesystem I/O error and causing backup to fail.

Atlast server rebooted and problem fixed.
Thanks everyone for help.
SKSingh_1
Frequent Advisor

Re: How to check mounted filesystem

Thanks Everybody.