Operating System - HP-UX
1827404 Members
5825 Online
109965 Solutions
New Discussion

Re: New logical volume for an existing directory

 
SOLVED
Go to solution
Anant
Occasional Contributor

New logical volume for an existing directory

Hello,
I already have '/var/adm' directory. '/var' is mounted on '/dev/vg00/lvol8'. For a specific (strange) reason, I wanted to created a new LV 'var_adm' and mount '/var/adm' on it. To do that, I did following steps:
1) lvcreate -L 1000 -n var_adm /dev/vg00
2) newfs -F vxfs /dev/vg00/rvar_adm
3) mount /dev/vg00/var_adm /var/adm
4) lvextend -m 1 /dev/vg00/var_adm /dev/dsk/c1t0d0
5) Added a line into /etc/fstab

Problems:
1) 'bdf' shows 0% used on /var/adm on LV /dev/vg00/var_adm
2) I do not have a prior bdf snap shot to compare '/var' on lvol8.
3) /var/adm/syslog directory does not exist.
4) I get error '/var/adm/syslog/syslog.log - No such file or directory' when rebooting
5) 'lpshut' and 'lpsched' commands are acting up. Sometimes they work and sometimes I get error message 'scheduler could not be started/stopped'. Print jobs are not coming out of the printers.

Questions:
1) What would have been the right steps to create a new LV for an existing directory?
2) How can I rectify the LV problem now?
3) Is 'lp' problem anyway related to wrong LV creation?

Thanks in advance
4 REPLIES 4
TTr
Honored Contributor
Solution

Re: New logical volume for an existing directory

You did not copy the contents of the old /var/adm in the new filesystem. Your old steps 1,2,4 are correct.
Put everything back to normal by taking the new line out of fstab and reboot the server.

Then you also have to do,

1) mkdir /var-adm-tmp
2) mount /dev/vg00/var_adm /var-adm-tmp
3) Copy contens of /var/adm into the new mount point /var-adm-tmp
5) unmount /var-adm-tmp
6) Add line to /etc/fstab for /var/adm
7) reboot

The reboot (step 7) is optional but you need to either shutdown to single user mode or turn off all services that use /var/adm. I think syslogd, sendmail, nfsd, nettl are using it, maybe more.
Anant
Occasional Contributor

Re: New logical volume for an existing directory

Thanks.
For the step number 3, I ended up using 'cp -r /var/adm /var-adm-tmp'. Then I followed the rest of the steps. With that done, what happens to the content of '/var/adm' that is mounted on lvol8?
TTr
Honored Contributor

Re: New logical volume for an existing directory

> what happens to the content of '/var/adm' that is mounted on lvol8?

They are covered by the mount point. They are still under /var as a folder. You should unmount the new /var/adm (probably have to go down to single user) and delete the contents of the /var/adm/ folder. The mount the /var/adm volume.
Marcel Burggraeve
Trusted Contributor

Re: New logical volume for an existing directory

If you really did a cp -r and not something like cp -rp you messed up most of the permissions on your new /var/adm and everything underneath it.
Personally I would do the following :

1) Reboot the system and start in single user mode
2) Bring it up to runlevel 1
3) mkdir /var-adm-tmp
4) mount /dev/vg00/var_adm /var-adm-tmp
3) Copy contens of /var/adm into the new mount point /var-adm-tmp :
a] cd /var
b] find adm -print | cpio -dumpx /var-adm-tmp
5) unmount /var-adm-tmp
6) Add line to /etc/fstab for /var/adm
7) reboot