HP Visualize J210XC IRIX to HP-UX Migration Guide - Page 35

vgdisplay, PE Size, Free PE, pvcreate, vgextend, vgcreate, lvcreate, newfs, etc/fstab, etc/default/

Page 35 highlights

Disks and File Systems You can create a file system within either a logical volume or on a non-LVM disk. However, using a logical volume is strongly encouraged. If you decide not to use a logical volume when creating a file system, skip tasks 1 through 4 (which deal with logical volumes only) below. 1. Estimate the size required for the logical volume. 2. Determine if sufficient disk space is available for the logical volume within its volume group. Use the vgdisplay command to calculate this information. vgdisplay will output data on one or more volume groups, including the physical extent size (under PE Size [Mbytes]) and the number of available physical extents (under Free PE). By multiplying these two figures together, you will get the number of megabytes available within the volume group. 3. Add a disk to a volume group if necessary. If there is not enough space within a volume group, you will need to add a disk to a volume group. To add a disk to an existing volume group, use pvcreate and vgextend. You can also add a disk by creating a new volume group with pvcreate and vgcreate. 4. Create the logical volume. Use lvcreate to create a logical volume of a certain size in the above volume group. Create the new file system using the newfs command. Note the use of the character device file. For example: # newfs -F hfs /dev/vg02/rlvol1 If you do not use the -F (for file system type) option, by default, newfs creates a file system based on the content of your /etc/fstab file. If there is no entry for the file system in /etc/fstab, then the file system type is determined from the file /etc/default/fs. For HFS, you can explicitly specify that newfs create a file system that allows short file names or long file names by using either the -S or the -L option. When creating a VxFS file system, file names will automatically be long. 5. Once you have created a file system, you will need to mount it in order for users to access it. Mounting file systems You can use either SAM or HP-UX commands to mount file systems. If you use SAM, proceed from SAM's Disks and File Systems area menu. You can perform the necessary tasks as part of creating your file system, as already described. For help in mounting files using SAM, see SAM's online help. This section concentrates on using HP-UX commands to mount file systems. To mount a local file system: 1. Choose an empty directory to serve as the mount point for the file system. Use the mkdir command to create the directory if it does not currently exist. For example, enter: # mkdir /joe 2. Mount the file system using the mount command. Use the block device file name that contains the file system. You will need to enter this name as an argument to the mount command. For example, enter: # mount /dev/vg01/lvol1 /joe NOTE: If you are not using logical volumes, you may need to enter ioscan -fn to determine which block device file name to use. If the block device file does not exist, you will need to create it using insf or mksf. 30

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125

Disks and File Systems
30
You can create a file system within either a logical volume or on a non-LVM disk. However, using a
logical volume is strongly encouraged. If you decide not to use a logical volume when creating a file
system, skip tasks 1 through 4 (which deal with logical volumes only) below.
1.
Estimate the size required for the logical volume.
2.
Determine if sufficient disk space is available for the logical volume within its volume group.
Use the
vgdisplay
command to calculate this information.
vgdisplay
will output data on one or more
volume groups, including the physical extent size (under
PE Size
[Mbytes]) and the number of
available physical extents (under
Free PE
). By multiplying
these two figures together, you will get the
number of megabytes available within the volume group.
3.
Add a disk to a volume group if necessary. If there is not enough space within a volume group, you
will need to add a disk to a volume group. To add a disk to an existing volume group, use
pvcreate
and
vgextend
. You can also add a disk by creating a new volume group with
pvcreate
and
vgcreate
.
4.
Create the logical volume.
Use
lvcreate
to create a logical volume of a certain size in the above volume group.
Create the new file system using the
newfs
command. Note the use of the character device file. For
example:
# newfs -F hfs /dev/vg02/rlvol1
If you do not use the
-F
(for file system type) option, by default,
newfs
creates a file system based on
the content of your
/etc/fstab
file. If there is no entry for the file system in
/etc/fstab
, then the file
system type is determined from the file
/etc/default/fs
.
For HFS, you can explicitly specify that
newfs
create a file system that allows short file names or long
file names by using either the
-S
or the
-L
option. When creating a VxFS file system, file names will
automatically be long.
5.
Once you have created a file system, you will need to mount it in order for users to access it.
Mounting file systems
You can use either
SAM or HP-UX commands to mount file systems. If you use SAM, proceed from
SAM±s
Disks and File Systems
area menu. You can perform the necessary tasks as part of creating your
file system, as already described. For help in mounting files using SAM, see SAM±s online help. This
section concentrates on using HP-UX commands to mount file systems.
To mount a local file system:
1.
Choose an empty directory to serve as the mount point for the file system. Use the
mkdir
command to
create the directory if it does not currently exist. For example, enter:
# mkdir /joe
2.
Mount the file system using the
mount
command. Use the block device file name that contains the file
system. You will need to enter this name as an argument to the
mount
command. For example, enter:
# mount /dev/vg01/lvol1 /joe
NOTE: If you are not using logical volumes, you may need to enter
ioscan -fn
to determine which block
device file name to use. If the block device file does not exist, you will need to create it using
insf
or
mksf
.