Operating System - HP-UX
1833873 Members
2013 Online
110063 Solutions
New Discussion

Re: create new logical volume not appear at fstab

 
Fauziah Mahdan
Super Advisor

create new logical volume not appear at fstab

Hi all,
I manage to create new logical volume under vg00/lvol9 online .
When I go to single user mode to run another diff command and go back to multiuser mode, the new directory under this lvol was missing in bdf command.
Run lvdisplay -v /dev/vg00/lvol9 it was exist.

Go back tu single user mode to run again lvextend command to the same lvol9 sucessfull.
Bdf also exist.
But when vi /etc/fstab this lvol9 not exist.
Check from vgdisplay and lvdisplay -v comamnd it was exist.
Hope you guys understand. Pls advice

Fauziah Mahdan
9 REPLIES 9
Pete Randall
Outstanding Contributor

Re: create new logical volume not appear at fstab

Did you create a file system in this logical volume? Without a file system, bdf is not going to display anything about the LV.


Pete

Pete
Mridul Shrivastava
Honored Contributor

Re: create new logical volume not appear at fstab

Create a logical volume lvoldata of size 150 MB in volume group /dev/vg02 so that all physical extents are on /dev/dsk/c1t1d0:


# lvcreate -n lvoldata vg02
# lvextend -L 150 /dev/vg02/lvoldata /dev/dsk/c1t1d0

If you need a filesystem construct it according to


# newfs -F vxfs /dev/vg02/rlvoldata
You may use specific options, e.g. to support largefiles:


# newfs -F vxfs -o largefiles /dev/vg02/rlvoldata
See also newfs(1M) and newfs_vxfs(1M) .

Mount it at the desired directory:


# mount /dev/vg02/lvoldata /mountdirectory
For specific mount option examples look into the /etc/fstab, fstab(4) or consult mount_vxfs(1M).

Check:


# bdf


NOTE: Do not forget to add an appropriate entry in the /etc/fstab, fstab(4), if you want the logical volume automatically mounted on system start-up.

Time has a wonderful way of weeding out the trivial
Mridul Shrivastava
Honored Contributor

Re: create new logical volume not appear at fstab

Hi,

I guess u r missing something while doing this activity. Please follow the example below and do the needful.

Example:

Create a logical volume lvoldata of size 150 MB in volume group /dev/vg02 so that all physical extents are on /dev/dsk/c1t1d0:


# lvcreate -n lvoldata vg02
# lvextend -L 150 /dev/vg02/lvoldata /dev/dsk/c1t1d0

If you need a filesystem construct it according to


# newfs -F vxfs /dev/vg02/rlvoldata
You may use specific options, e.g. to support largefiles:


# newfs -F vxfs -o largefiles /dev/vg02/rlvoldata
See also newfs(1M) and newfs_vxfs(1M) .

Mount it at the desired directory:


# mount /dev/vg02/lvoldata /mountdirectory
For specific mount option examples look into the /etc/fstab, fstab(4) or consult mount_vxfs(1M).

Check:


# bdf


NOTE: Do not forget to add an appropriate entry in the /etc/fstab, fstab(4), if you want the logical volume automatically mounted on system start-up.

Time has a wonderful way of weeding out the trivial
Robert-Jan Goossens
Honored Contributor

Re: create new logical volume not appear at fstab

Hi Fauziah,

If you create a new logical volume from the command line, you should add an entry in the /etc/fstab yourself. If you use SAM, sam will add the entry in the fstab for you.

# lvcreate -n lvol9 /dev/vg00
# lvextend -L 1000 /dev/vg00/lvol9
# newfs -F vxfs /dev/vg00/rlvol9
# mkdir new_mount_point
# mount /dev/vg00/lvol9 /new_mount_point

add an entry in the /etc/fstab for lvol9

Regards,
Robert-Jan
Fauziah Mahdan
Super Advisor

Re: create new logical volume not appear at fstab

HI all done...I did not missed the filesystem create...I did all the steps that you all gave.

1) lvcreate -n lvol9 /dev/vg00
2)lvextend -L 15360 /dev/vg00/lvol9
3)newfs -F vxfs /dev/vg00/rlvol9
4) mkdir /oracle
5)mount /dev/vg00/lvol9 /oracle

The problem is 1st time did it was not in single user mode. Everything was perfect until I need to go to single user mode to run another extend at existing filesystem.
Then when I go back to user mode the directory that I create new one was missing.

Go back to single user mode rerun the step start at no 2 till the end then reboot the server. Teh new directory /oracle was there.
But vi fstab no exist.
Pls guide
I am afraid loosing the content in oracle directory again.

fauziah
John McWilliams_1
Frequent Advisor

Re: create new logical volume not appear at fstab

Hello

After you create the filesystem manually (Not using SAM) you need to edit /etc/fstab and put the entry in there.
If you reboot and come up in single user mode the filesystem probably will not mount. You need to manually mount it
eg mount /oracle.

Cheers John
Mridul Shrivastava
Honored Contributor

Re: create new logical volume not appear at fstab

entry in fstab is required and fstab is under etc so please use vi /etc/fstab and make changes.
Time has a wonderful way of weeding out the trivial
Fauziah Mahdan
Super Advisor

Re: create new logical volume not appear at fstab

HI All,
Everybody keep inform me the last step that I missed.

add an appropriate entry in the /etc/fstab.

ok friends I will follow the advice. Tomorrow will add the entry. Am I will loosing the content of /oracle directory if I need to reboot the server without adding any entry at fstab file?

Bill Hassell
Honored Contributor

Re: create new logical volume not appear at fstab

fstab is the file which automatically mounts all the filesystems during bootup. Any new logical volumes with filesystems will not be added to fstab automatically -- you must add the volume and mountpoint to fstab. The best practice is to edit fstab BEFORE you mount the new filesystem. Once fstab is updated, mount the filesystem with just the mounpoint name. This verifies that fstab is correct and will be ready for a reboot.


Bill Hassell, sysadmin