Online Book Reader

Home Category

UNIX System Administration Handbook - Evi Nemeth [101]

By Root 2755 0

disk: SEAGATE

sectors/track: 63

tracks/cylinder: 255

sectors/cylinder: 16065

cylinders: 261

sectors/unit: 4194995

...

8 partitions:

# size offset fstype [fsize bsize bps/cpg]

a: 2097153 0 4.2BSD 1024 8192 16

b: 2097841 2097154 swap

c: 4194995 0 4.2BSD 1024 8192 16

Filesystems are created with the newfs command. Remember to specify the raw device name of the partition on which to create the new filesystem.

# newfs /dev/rda0a

/dev/rda0a:

2097152 sectors in 512 cylinders of 1 tracks, 4096 sectors

1024.0MB in 32 cyl groups (16 c/g, 32.00MB/g, 7744 i/g)

super-block backups (for fsck -b #) at:

32, 65568, 131104, 196640, 262176, 327712, 393248,

458784, 524320, 589856, 655392, 720928, 786464, 852000,

...

Once the filesystem is created, we run a quick fsck to make sure that newfs produced a usable filesystem. fsck requires the raw device, too.

# fsck /dev/rda0a

** /dev/rda0a

** Last Mounted on /bkroot

** Phase 1 - Check Blocks and Sizes

** Phase 2 - Check Pathnames

** Phase 3 - Check Connectivity

** Phase 4 - Check Reference Counts

** Phase 5 - Check Cyl groups

1 files, 1 used, 1017070 free (14 frags, 127132 blocks, 0.0% fragmentation)

The swapon command enables swapping on a partition. The partition type must be swap in the disk label. The swapinfo command, which is identical to pstat -s, reports on the devices that are currently being used for swapping. In our example:

# swapon /dev/da0b

# swapinfo

Device 1K-blocks Used Avail Capacity Type

/dev/wd0s1b 70784 0 70656 0% Interleaved

/dev/da0b 1048920 0 1048792 0% Interleaved

Total 1119448 0 1119448 0%

To have the new partitions automatically mounted and swapped on at startup, we add the appropriate lines to the /etc/fstab file:

# Device Mountpoint FStype Options Dump Pass#

...

/dev/da0a /new ufs rw 2 2

/dev/da0b none swap sw 0 0

Test the fstab configuration by unmounting the filesystem and running mount -a to mount all the filesystems it lists. If the new filesystem is mounted correctly, reboot to make sure that the configuration really works.

1. 32-bit SCSI buses are not very common. Some may require multiple cables, referred to as the A cable and the B cable.

2. Crosstalk is most significant on a parallel electrical bus. It is not a concern for serial and fiber optic transports such as Fibre Channel, which have a much longer maximum cable length.

3. Pin 1 on a ribbon cable is usually marked with a red stripe.

4. SCSI supports overlapping commands, command queuing, scatter-gather I/O, and higher transfer rates. These features allow it to perform better than IDE in a multiuser environment such as UNIX.

5. Moore’s Law states that technology (CPU speed, disk sizes, etc.) will double about every 18 months.

6. Of course, the prefix “mega” really does mean “million,” so the practice is not entirely indefensible.

7. However, any bad blocks that appear after a disk has been formatted will not be “handled”; they can manifest themselves in the form of read and write errors and lost data.

8. This example is from FreeBSD. All but Solaris will be similar.

9. Swapping and paging are technically distinct. For now, we will group them together and call the combination “swapping,” as the UNIX manuals do. For a more detailed description of virtual memory under UNIX, see page 760.

10. From FreeBSD; other systems will vary.

11. Although it is still sometimes possible to adjust geometry specifications to improve the performance of your disk, that topic is beyond the scope of this book.

12. If your PROM monitor does not seem to understand probe-scsi, try typing n to get to the new-style monitor. The new-style monitor’s prompt is “ok”.

13. HP-UX limitations require swap space to reside in the first 2GB of the physical disk and the boot volume to be the first logical volume. The 1GB root and 1GB swap were chosen carefully to work around this constraint. See the man page for lvlnboot for more details on this subject.

14. Note that this letter refers to the order of the target numbers of the SCSI devices,

Return Main Page Previous Page Next Page

®Online Book Reader