UNIX System Administration Handbook - Evi Nemeth [96]
first allocation unit starts at block 0
overhead per allocation unit is 0 blocks
# newfs -F vxfs /dev/vg01/rlvol3
version 3 layout
43843584 sectors, 5480448 blocks of size 8192, log size 256 blocks
...
Since VXFS is a journaled filesystem (similar to Solaris with its -o logging mount option), fsck is always quick and usually has little to do.
# fsck /dev/vg01/rlvol1
file system is clean - log replay is not required
We are now ready to mount our new filesystems. As always, mount requires a block device. To verify that the mount operation worked correctly, we run the bdf command (the Berkeley version of df, which some folks find easier to understand):
# mkdir /new
# mount /dev/vg01/lvol3 /new
# bdf /new
Filesystem kbytes used avail %used Mounted on
/dev/vg01/lvol3 43843584 3616 43497480 0% /new
Next, we add entries for the disk to the /etc/fstab file, formerly called /etc/checklist on HP-UX 10 and earlier. The /etc/fstab file lists the block device, mount point, filesystem type, options, backup frequency, and fsck pass for each filesystem; you can also add an optional comment. The delaylog option used below sacrifices some reliability for speed. See the mount_vxfs man page for more information about this and other VXFS mount options. Our two new filesystems are entered like this:
/dev/vg01/lvol1 /bkroot vxfs delaylog 0 2
/dev/vg01/lvol3 /new vxfs delaylog 0 2
See Chapter 12 for more information about kernel parameters.
All that’s left to do is to enable swapping on our second logical volume. The swapon command specifies a device for swapping and should be given the block device name. You may have to modify the kernel parameter called maxswapchunks if you are trying to add a lot of swap areas; the swapon command will warn you if there is a problem. After running swapon, it’s a good idea to run swapinfo, as we do here, to make sure the new swap area was added properly.
# swapon /dev/vg01/lvol2
# swapinfo
Kb Kb Kb START/ Kb
TYPE AVAIL USED FREE LIMIT RESERVE PRI NAME
dev 262144 0 262144 0 - 1 /dev/vg00/lvol2
dev 1048576 0 1048576 0 - 1 /dev/vg01/lvol2
reserve - 50876 -50876
Everything looks good. Don’t forget to add an entry for the swap device to /etc/fstab, or the system will forget you have the extra space the next time you reboot. A swap entry looks like this:
/dev/vg01/lvol2 / swap defaults 0 0 # swap device
That’s all there is to it! We’d now reboot the system to verify that the entries added to /etc/fstab are correct and that everything comes up as expected. If you omit this step, the system will doubtless break several weeks later when the reboot occurs for some other reason. Check things out now to save someone else a big headache.
Adding a disk to Red Hat Linux
After installing your new disk, it’s a good idea to make sure the system can see the new device before booting up the kernel. If it’s an IDE disk, check to be sure the disk is recognized in the BIOS setup display, which you usually access by typing a magic key sequence before the system boots. Consult the manuals that came with your computer or motherboard for specific information on BIOS configuration for IDE devices. In most cases, no special configuration is necessary.
Many SCSI cards also have a BIOS setup screen that you can invoke before the system boots. If this option is available, you scan the SCSI bus to make sure the new device appears. If this procedure hangs or produces a warning message, it’s possible that you picked a SCSI ID that was already in use or that you did not install terminators in the right places.
You can also use the SCSI BIOS to low-level format a disk. This operation takes a long time on some disks and cannot be interrupted, so plan ahead.
If your SCSI card does not provide its own user interface, you can always just try to boot the system and note the messages displayed by the kernel. If you do not see any messages from a SCSI driver, it is possible that you need to install the driver before the disk can be recognized by the kernel.