We partitioned the disk with fdisk and formatted it:
# fdisk /dev/hdc |
|
|
|
|
|
n |
|
| (fdisk option to add a partition) | ||
Command action: p |
|
| (a primary partition) | ||
Partition number: 1 |
|
|
|
| |
First cylinder | (default = 1) |
| |||
Last cylinder | (this makes a partition of about 2 GB) | ||||
n |
|
| (fdisk option to add a partition) | ||
Command action: p |
|
| (another primary partition) | ||
First cylinder |
|
|
| ||
Last cylinder |
|
|
| ||
p |
|
| (print the partition table) | ||
Device Boot | Start | End | Blocks | ID | System |
/dev/hdc1 | 1 | 4140 | 1956118+ | 83 | Linux native |
/dev/hdc2 | 1414 | 66144 | 29296880 | 83 | Linux native |
(if the ID is not 83 = Linux native, use the t option to change it) | |||||
t |
|
| (fdisk option to change partition ID) | ||
Partition number: 1 |
|
|
|
| |
Hex code: 83 |
|
| (83 is Linux native) | ||
t |
|
|
|
|
|
Partition number: 2 |
|
|
|
| |
Hex code: 83 |
|
|
|
|
|
p |
|
| (fdisk option to list partitions) | ||
w |
|
| (fdisk option to write partition table and end) | ||
# mkdir /s391 |
|
| (create a mount point, if not already done) | ||
# mkdir /holding |
|
|
|
|
|
# mke2fs /dev/hdc1 |
|
| (format a file system) | ||
# mke2fs /dev/hdc2 |
|
| (format the other file system) | ||
# mount /dev/hdc1 /holding |
| (mount it for Linux use) |
#mount /dev/hdc2 /s391
#chown flexes:flexes /holding (change owner and group identities)
#chown flexes:flexes /s391
We used the new disk space to confirm that it worked, and then edited /etc/fstab to cause the new file systems to be automatically mounted at boot time. (There are no unwanted effects if the second hard disk is not present when Linux is booted; the file systems on that disk are simply not mounted.) We added two lines at the end of fstab:
LABEL=/ | / | ext2 | defaults | 1 | 1 |
LABEL=/boot | /boot | ext2 | defaults | 1 | 2 |
/dev/fd0 | /mnt/floppy | auto | noauto,owner | 0 | 0 |
LABEL=/s390 | /s390 | ext2 | defaults | 0 | 0 |
none | /proc | proc | defaults | 0 | 0 |
none | /dev/pts | devpts gid=5,mode=620 | 0 | 0 | |
/dev/hda7 | swap | swap | defaults | 0 | 0 |
/dev/hdc1 | /holding | ext2 | defaults | 0 | 0 |
/dev/hdc2 | /s391 | ext2 | defaults | 0 | 0 |
5.5.2 Second disk planning
It is unlikely that the second hard drive will always be installed when
Chapter 5. Additional Topics | 43 |