Operating System - HP-UX
1833323 Members
2886 Online
110051 Solutions
New Discussion

/opt is mounting as a read option.

 
SOLVED
Go to solution
bazigardu
Advisor

/opt is mounting as a read option.

Hi all,

In one server /opt is not mounted properly,it is only having read option not the write,user can see whatever is there but can't write or execute.so now customer wants to take the /opt backup and restore /opt.Isit possibe?? I think /opt backup restoration is not possible,I already check in single user mode also,i can't find any solution.kindly provide me the solution.


Regards
Suman
7 REPLIES 7
Dennis Handly
Acclaimed Contributor
Solution

Re: /opt is mounting as a read option.

The file system /opt is intended to be mounted readonly. Except on the machine where the software is installed.
Of course you may want to do something differently, you need to see how the file system was exported.
Oops, you're not talking about NFS are you??

>but can't write or execute.

Has someone changed the permissions of the files and directories, removed execute permission?

You may be able to fix it with:
# swverify -F \*

>I think /opt backup restoration is not possible

I'm not sure why it wouldn't work. You may have to do it if that swverify doesn't work.
Bill Hassell
Honored Contributor

Re: /opt is mounting as a read option.

/opt must be mounted with 755 permissions. This is set at bootup with the /etc/fstab file which for /opt should read:

/dev/vg00/lvol6 /opt vxfs delaylog 0 2

This assumes you are using lvol6 for /opt. The default options are rw (read+write). If /opt is mounted read-only, then a number of programs will fail to run properly. There is no reason to restore /opt if the permissions are wrong. Change fstab if necessary, then reboot. You probably cannot unmount /opt so a reboot is the easiest way to fix the problem.

Now if a much more serious error was made such as chmod -R 444 then you do indeed have a big job ahead to restore /opt. I would also look at any other root commands that may have been run that might have adversely affected your system.


Bill Hassell, sysadmin
bazigardu
Advisor

Re: /opt is mounting as a read option.



Hi

Its not Nfs..what this command will do?
#swverify -F \* it will verify the permission right.After that what I will do??In /etc/fstab what is the other entry like /var,same thing i w'll do for /opt also,but file permission it will not show in the /etc/fstab right..then umount /opt then mount all.it will work??what u think?

Regards
Suman
Bill Hassell
Honored Contributor

Re: /opt is mounting as a read option.

If you do not have the option "ro" in fstab for /opt, then verify that /opt is truly read-only:

ll -d /opt

If ll reports dr-xr-xr-x then /opt is mounted correctly and your problem is with the directories underneath /opt. If it is dr--r--r-- then you must unmount /opt and remount it. Note that it may be shown as busy so check with fuser:

fuser -cu /opt

You will have to kill any processes listed, or let fuser kill them for you:

fuser -cuk /opt

Once there are no processes using /opt, you can unmount and mount /opt.

If the mountpoint permissions are correct, please post the output of this command:

ll /opt


Bill Hassell, sysadmin
Dennis Handly
Acclaimed Contributor

Re: /opt is mounting as a read option.

>what this command will do?
#swverify -F \* it will verify the permission right. After that what I will do??

It will verify and -F will "fix" the permissions on everything. You may want to subset to only do the products that install on /opt?

>Bill: If it is dr--r--r-- then you must unmount /opt and remount it. Note that it may be shown as busy so check with fuser

If it is busy, you can export the underlying FS and if you allowed root as root, then you can change the permissions on another machine.
bazigardu
Advisor

Re: /opt is mounting as a read option.

Hi,

In my case, because of some block level corruption, /opt is not getting mounted as rw, but i can mount it as ro.

I want to know how can i restore /opt by delete present lv for /opt and recreating it again, then restoring.

Thanks.
Bill Hassell
Honored Contributor

Re: /opt is mounting as a read option.

> block level corruption...

Is that filesystem corruption? If so, what did fsck report? Or is it I/O error 5 problems? In that case, there is nothing to do except replace the disk and reinstall from your Ignite backup tape. I/O errors cannot be fixed and they always get worse.


Bill Hassell, sysadmin