Solved

fdisk lvcreate vgcreate mount fstab exports nfs in Centos Linux

Posted on 2011-09-23
3
766 Views
Last Modified: 2012-05-12

I have the following Centos Linux server & would like to use it to act as NFS server
to server ext3 filesystem to a HP-Ux DB server (to host Oracle db).

lvm> lvdisplay
  --- Logical volume ---
  LV Name                /dev/VolGroup01/nfs1
  VG Name                VolGroup01
  LV UUID                59NMoq-pxE3-IIu0-jWAv-8aAM-0RL5-nedWty
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                273.45 GB
  Current LE             70003
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:2

  --- Logical volume ---
  LV Name                /dev/VolGroup00/LogVol00
  VG Name                VolGroup00
  LV UUID                dXoGq7-azl1-EQYH-2Htn-YrzY-Wljs-3KDGFq
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                30.00 GB
  Current LE             960
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0

  --- Logical volume ---
  LV Name                /dev/VolGroup00/LogVol01
  VG Name                VolGroup00
  LV UUID                sSIq0I-35D0-lBkq-KzSf-T8aG-ZqlU-8ZD2dU
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                2.00 GB
  Current LE             64
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:1

lvm>

# fdisk -l

Disk /dev/cciss/c0d0: 293.6 GB, 293617820160 bytes
255 heads, 63 sectors/track, 35697 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

           Device Boot      Start         End      Blocks   Id  System
/dev/cciss/c0d0p1   *           1          13      104391   83  Linux
/dev/cciss/c0d0p2              14       35697   286631730   8e  Linux LVM

Disk /dev/cciss/c0d1: 293.6 GB, 293617820160 bytes
255 heads, 63 sectors/track, 35697 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

           Device Boot      Start         End      Blocks   Id  System
/dev/cciss/c0d1p1               1       35697   286736121   8e  Linux LVM


# vgdisplay
  --- Volume group ---
  VG Name               VolGroup01
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  8
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               273.45 GB
  PE Size               4.00 MB
  Total PE              70003
  Alloc PE / Size       70003 / 273.45 GB
  Free  PE / Size       0 / 0
  VG UUID               zJqZAn-fxMf-G6F0-9ird-1b1z-1tcn-ee8fMf

  --- Volume group ---
  VG Name               VolGroup00
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  3
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               273.34 GB
  PE Size               32.00 MB
  Total PE              8747
  Alloc PE / Size       1024 / 32.00 GB
  Free  PE / Size       7723 / 241.34 GB
  VG UUID               QCeebm-BhWL-ENfK-Jvd8-pZwS-yB7w-ms6w9j


Q1:
Pls provide step by step instruction to use fdisk, lvcreate, vgcreate etc
to create/merge whatever unused space (shown above) & updating
of fstab / exports so that whenever I reboot, the partition is mounted
(as ext3 fs).  Currently they're created as RAID5 by HP RAID config
utitlity : would like one big contiguous space where possible.

Q2::
NFS to be started & shared out
To start up nfs & shared out those partition
0
Comment
Question by:sunhux
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Author Comment

by:sunhux
ID: 36585928
I would like the Volume group & the logical volume names
to be VolGroup01, nfsX as follows :

# mkfs.ext3 /dev/VolGroup01/nfs2
# mkfs.ext3 /dev/VolGroup01/nfs3
   . . . . .
0
 
LVL 7

Accepted Solution

by:
jackiechen858 earned 500 total points
ID: 36589642
I guess you want to merge all the unused space 241G+273G together to create a 500G shared partition?

VolGroup00 is on your /dev/cciss/c0d0p2  pv;
VolGroup01 is on your /dev/cciss/c0d1p1  pv.

You need to have a big vg to include all the free space for the two pv.


If there is nothing import in   /dev/VolGroup01/nfs1 , you can delete it,

umount   /dev/VolGroup01/nfs1 # unmount it first
lvremove   /dev/VolGroup01/nfs1 ## remove lv
vgremove VolGroup01

pvdisplay  /dev/cciss/c0d1p1  ## it should show this pv is free now.
vgextent VolGroup00  /dev/cciss/c0d1p1 ### add second pv to VolGroup00  

lvcreate -n nfs1 -l 100%FREE VolGroup00  

Now you have a big  /dev/VolGroup00/nfs1.

mkfs.ext3  /dev/VolGroup01/nfs1 # make the file system.

mkdir /nfs1 # create mount point
mount  /dev/VolGroup01/nfs1 /nfs1 # mount it

Edit /etc/fstab, add :

/dev/VolGroup00/nfs1 /nfs1             ext3    defaults        1 3

So next time when you reboot the machine, this partition will be mounted in /nfs1

edit /etc/exports :
/nfs1 hp.server.ip. (rw,insecure,no_root_squash)

/etc/init.d/nfs start  # start nfs server
chkconfig nfs on # turn on the nfs service, so next time reboot it will start automatically

netstat -nap | grep LIST | grep rpc  ## find out which port is used by rpc, plus port 2049

modify /etc/sysconfig/iptables, add those ports, and restart iptables service.


Then you can test it from the HP-UX machine.



























0
 

Author Closing Comment

by:sunhux
ID: 36938614
ok thanks
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question