"The Linux Gazette...making Linux just a little more fun!"

(?) The Answer Guy (!)

By James T. Dennis, tag@lists.linuxgazette.net
LinuxCare, http://www.linuxcare.com/

(?) Adding a Disk

From Samuel Q Roodman on Tue, 11 Jan 2000

I recently got Mandrake 6.1 up and running on Pentium 90 with 48 mb of ram. The question I have is: The system is running with a scsi drive and I wish to add another. How do I access the drive to format it and then access the directories once its formated?

(!) Add the new drive by assigning it a unique SCSI ID for the bus/cable on which you are adding it, and resolving any termination issues that come up.
Once you've restored your system to functionality --- with the new drive physically/electronically connected then it's easy.
  1. run: fdisk /dev/sdb
    (Assuming you only have one drive now, the new drive should be /dev/sdb).
  2. create any partitions you like on the new drive. BE CAREFUL! Don't blow away partitions on your old drive. I recommend that your existing drives be assigned IDs that are numerically than the new drive(s).
  3. for each partition:
    mke2fs -c /dev/sdbX
    .... BE CAREFUL! Make sure that you use the appropriate /dev/sd? node or you'll format one of your existing filesystems.
  4. edit your /etc/fstab. I use a text editor (vi or xemacs in vi emulation mode), but there are several user interfaces (GUIs and text/curses menuing systems) that can help you with that.
Typical new entries might look something like:
/dev/sdb1       /u1	ext2	defaults	1  0
/dev/sdb2       /u2	ext2	defaults	2  0
... The device names should match the ones you used for those mke2fs commands. The second column lists "mount points" which should be empty directories that you create wherever it suits your needs. You can name them anything you like (pretty much).
Read the fstab(5) man page using the command:
man fstab
... the (5) is a UNIX convention for referring to a keyword or man page reference by specifying which chapter or section of the man pages is appropriate.
(That convention arose because many system calls, library functions, and commands and some commands and their configuration files have the same names).
That's basically all there is to it. Once you've physically connected the new drives, you can do all of this (including mounting the new filesystems and using them) without rebooting.
Note that the example as given would automatically mount these new filesystems on reboot. To use these filesystems after editing the fstab and WITHOUT rebooting simply issue a series of commands like:
mount /u1; mount /dev/sdb2
... where you refer to the unique value in either of the first two columns/fields of the fstab entries (the device or the mount point). The mount command will search the fstab for a matching entry and supply the rest of its arguments therefrom.
(Of course you can read the mount(8) man page for info on mounting filesystems without editing the fstab file. To do a temporary mount you simply provide all of the details on the mount command line, and leave your fstab alone).
Note: if you mount a filesystem over a non-empty directory there will be no harm done. However the underlying contents will be inaccessible (hidden) until you umount the overlaid fs. This is NOT recommended practice, so you should consider it a mistake if you do this.

Copyright © 2000, James T. Dennis
Published in The Linux Gazette Issue 50 February 2000
HTML transformation by Heather Stern of Starshine Technical Services, http://www.starshine.org/

[ Answer Guy Current Index ] [ Index of Past Answers ] greetings 1 2 3 5
5 6 7 8 9
10 11   13 14 15 16 17
18 19 20 21 22 23 24  
26 27 28 29 30 31 32 33
34   36 37 38 39 42 41
42 43 44 45 46 47 48

[ Table Of Contents ] [ Front Page ] [ Previous Section ] [ Linux Gazette FAQ ] [ Next Section ]