Online Book Reader

Home Category

UNIX System Administration Handbook - Evi Nemeth [99]

By Root 2805 0
4: Checking reference counts

Pass 5: Checking group summary information

/dev/sda1: 11/514000 files (0.0% non-contiguous), 67014/2048001 blocks

New filesystems can be mounted as soon as their mount points are created:

# mkdir /bkroot

# mount /dev/sda1 /bkroot

# df -k /bkroot

Filesystem 1k-blocks Used Available Use% Mounted on

/dev/sda1 1981000 13 1878575 0% /bkroot

To ensure that the system mounts the new filesystems at boot time, we add a line for each one to the /etc/fstab file. Each line should list the name of the device, the mount point, the filesystem type, the mount options, the backup frequency, and the pass number for fsck:

/dev/sda1 /bkroot ext2 defaults 0 2

/dev/sda3 /new ext2 defaults 0 2

The Linux boot loader, LILO, must be written to the disk device to make it bootable. The lilo command does the actual installation. It takes its configuration (what the kernel is called, which other OSes exist on the machine, etc.) from the /etc/lilo.conf file. See page 18 for more information about configuring and installing LILO.

The final step is to create the swap space and add it to the system. Swap partitions must be initialized with mkswap, which takes as arguments the device name and the size of the swap partition in sectors. The size can be obtained from fdisk, as shown above. You can also pass mkswap the -c flag, which tells it to clear the sectors before using them. This takes a long time, however, and it isn’t really necessary.

With the swap area created, we enable it with the swapon command. swapon also verifies that the swap area was properly added.

# mkswap -c /dev/sda2 2056320

Setting up swapspace version 1, size = 2105667584 bytes

# swapon /dev/sda2

# swapon -s

Filename Type Size Used Priority

/dev/hda5 partition 133020 688 -1

/dev/sda2 partition 2056316 0 -2

As with regular filesystems, you must add the new swap partition to the /etc/fstab file if you want the system to remember it the next time you reboot. The following entry would be appropriate for our example disk:

/dev/sda2 swap swap defaults 0 0

Make sure you reboot to test the changes that were made to the /etc/fstab file and to make sure that the new filesystems and swap space come on-line correctly.

Adding a disk to FreeBSD

Getting our 47GB example disk to work on a FreeBSD system proved to be a challenge. The disklabel partitioning tool repeatedly gave us a confusing “no space left on device” message. After spending quite a bit of time checking for off-by-one errors, trying different parameters, and taking blind shots in the dark, we gave up and used a much smaller disk for our example (a Seagate ST32550W, which is a 2GB wide SCSI-2 disk). The underlying problem will probably be fixed by the time you read this, but if you run into similar issues, you might try to make use of the installation utility /stand/sysinstall.

As on other systems, you should try to verify the installation of the new disk at as low a level as possible. Modern SCSI controllers have a BIOS setup screen that you can access by hitting a magic key sequence during the power-on self-test before booting. The BIOS may let you scan the SCSI bus for devices and warn you of possible conflicts or problems. The SCSI BIOS often lets you low-level format the disk as well.

When you boot the system, look for messages that indicate that the kernel has seen the new drive:

da0 at bt0 bus 0 target 3 lun 0

da0: Fixed Direct Access SCSI-2 device

da0: 3.300MB/s transfers, Tagged Queueing Enabled

da0: 2048MB (4194995 512 byte sectors: 255H 63S/T 261C)

Partitioning in FreeBSD is typically a two-stage process: first you create a slice to contain the FreeBSD data, then you partition it by placing a BSD label on that slice. A FreeBSD slice is identical to what other operating systems call a partition, and it is stored in the same fdisk partition table used by Red Hat, Windows, and other PC operating systems. Just try to remember that in FreeBSD a slice is really an fdisk partition, and a partition is really

Return Main Page Previous Page Next Page

®Online Book Reader