Date: Thu, 25 Apr 1996 15:43:15 -0700 (MST) From: Terry Lambert <terry@lambert.org> To: matt@xanadu2.net (Matthew Z. Stout) Cc: questions@FreeBSD.ORG Subject: A: Installing a second disk drive Message-ID: <199604252243.PAA25630@phaeton.artisoft.com> In-Reply-To: <317FC95A.200F@xanadu2.net> from "Matthew Z. Stout" at Apr 25, 96 12:50:02 pm
next in thread | previous in thread | raw e-mail | index | archive | help
> I have sent several pieces of e-mail in the past few days, and am in > desperate need of a reply. I need to know the exact procedure for > preparing a new hard drive for use in a FreeBSD 2.1 machine. I have a > 2.2 gig SCSI-2 hard drive, and have been struggling with fdisk and > newfs for a week now. I simply need someone to outline the proper > steps for use of fdisk, newfs and mount in the installation of this > hard drive. This is covered both in the handbook and in the -questions archive. Undoubtedly, a search didn't find it because someone used the subject "Need Help!!!" or something similar instead of using something like "Q: Installing a second disk drive". Here are the long and short versions. If you are not running -current or a recent snap, you will need to use the long version. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. =========================================================================== This should be the handbook entry: ] Hmm.. I have a feeling this is 'unsupported' to say the least, but ] after mucking around with fdisk and disklabel, and still getting ] errors from newfs, I wound up doing ] ] <change to console 0> ] login as root ] cd /stand ] ./sysinstall ] ] now do "partition" (or whatever the first selection is) ] After defining everything on the right disk, hit "w" to go into wizard ] mode. From here, do "write". ] Then repeat with "label" (or whatever the second selection is). ] Exit, and newfs ] ] No warranties, but this worked for me when adding the 4th SCSI disk. ] ] -Terje ] ____________________________________________________________________ ] Terje Thoegersen, Systems Consultant | terje.thogersen@hda.hydro.com ] Norsk Hydro a.s, Hydro Data | Tel : +47 2273 9298 ] P.O.Box 200, | Fax : +47 2273 9614 ] 1321 Stabekk, Norway | Pager : 966 32801 Here is the "long form": ] Again, ] ] Here is Seppo Kalio's excellent documentation on how to add a second ] disk. ] ] ] Thanks for everyone who did help me! I hope we did all learn ] something. ] ] I have now done this about 10 times and now I feel I know something ] about it. ] ] I agree with John Capo <jc@irbs.com> that it is trivial after you ] know how ] to do it ;-). And I agree that the biggest problem is fdisk. It is ] not ] trivial what parameters you have change and how! The disklabel -e -r ] sd1 is ] not so hard to use. Nor newfs or mount ;-) ] ] ] ----------------------------------------------------------------------- ] Here final (?) text how to do it. Or how I have done it. ] ] In an example here I have 80MB SCSI disk (in a AHA 2940 controller), ] FreeBSD 2.0.5R. ] ] You have to start with fdisk (# -lines written by me): ] ] # fdisk -i -u /dev/rsd1 ] ******* Working on device /dev/rsd1 ******* ] parameters extracted from in-core disklabel are: ] cylinders=1923 heads=64 sectors/track=32 (2048 blks/cyl) ] ] Figures below won't work with BIOS for partitions not in cyl 1 ] parameters to be used for BIOS calculations are: ] cylinders=1923 heads=64 sectors/track=32 (2048 blks/cyl) ] ] # The cylinder count is nonsence, the disk is 80-81 MB, ] # so it should be 80 or 81. Head and sector count OK. ] # On all Adaptec controlled disks heads=64 and sectors=32 ] # The head count has nothing to do with the disk drive hardware ] # head count. Same with cylinder and sector count. ] ] Do you want to change our idea of what BIOS thinks ? [n] n ] ] # Wrong cylinder count does not matter, forward! ] ] Warning: BIOS sector numbering starts with sector 1 ] ] # This should be: "First sector must be 1" ] ] Information from DOS bootblock is: ] The data for partition 0 is: ] sysid 165,(FreeBSD/NetBSD/386BSD) ] ] # Sysid you must know it is 165, it is zero when you have empty disk ] # Where are the docs about this? ] ] start 32, size 163840 (80 Meg), flag 80 ] beg: cyl 0/ sector 1/ head 0; ] end: cyl 79/ sector 32/ head 63 ] Do you want to change it? [n] y ] Supply a decimal value for "sysid" [0] 165 # FreeBSD = 165 ] Supply a decimal value for "start" [0] 0 # 0 (32 on bootdisk?) ] Supply a decimal value for "size" [0] 163840 # This comes from ] 80*32*64 ] # If bootdisk, you must substract 2048 (=32*64) ????????? ] Explicitly specifiy beg/end address ? [n] y ] Supply a decimal value for "beginning cylinder" [0] # (* ] Supply a decimal value for "beginning head" [0] # (* ] Supply a decimal value for "beginning sector" [0] 1 # Must be 1 (* ] Supply a decimal value for "ending cylinder" [0] 79 # Cylinders 0 to ] 79=80 ] Supply a decimal value for "ending head" [0] 63 # (* ] Supply a decimal value for "ending sector" [0] 32 # (* ] sysid 165,(FreeBSD/NetBSD/386BSD) ] start 0, size 163840 (80 Meg), flag 0 ] beg: cyl 0/ sector 1/ head 0; ] end: cyl 79/ sector 32/ head 63 ] Are we happy with this entry? [n] ] ] # (* are same to all disks in Adaptec SCSI controllers. ] # Ending cylinder is same number as the MB count minus one (here ] 80-1) ] ] The data for partition 1 is: ] <UNUSED> ] Do you want to change it? [n] n ] The data for partition 2 is: ] <UNUSED> ] Do you want to change it? [n] n ] The data for partition 3 is: ] <UNUSED> ] Do you want to change it? [n] n ] Do you want to change the active partition? [n] n ] ] We haven't changed the partition table yet. This is your last ] chance. ] parameters extracted from in-core disklabel are: ] cylinders=1923 heads=64 sectors/track=32 (2048 blks/cyl) ] ] Figures below won't work with BIOS for partitions not in cyl 1 ] parameters to be used for BIOS calculations are: ] cylinders=1923 heads=64 sectors/track=32 (2048 blks/cyl) ] ] Information from DOS bootblock is: ] 0: sysid 165,(FreeBSD/NetBSD/386BSD) ] start 0, size 163840 (80 Meg), flag 0 ] beg: cyl 0/ sector 1/ head 0; ] end: cyl 79/ sector 32/ head 63 ] 1: <UNUSED> ] 2: <UNUSED> ] 3: <UNUSED> ] Should we write new partition table? [n] y # if all is correct ] ] # you will get following error message, forget it. ] ] ioctl DIOCWLABEL: Operation not supported by device ] ] # Then start disklabel -e -r sd1 ] ] # You will get a screen something like: ] ] ] ------------------------------------------------------------------------ ] # /dev/rsd1c: ] type: SCSI ] disk: d80mb ] label: ] flags: ] bytes/sector: 512 ] sectors/track: 32 ] tracks/cylinder: 64 ] sectors/cylinder: 2048 ] cylinders: 80 ] sectors/unit: 165888 ] rpm: 3600 # If this is zero, put here 3600 ] interleave: 1 # If this is zero, put here 1 ] trackskew: 0 ] cylinderskew: 0 ] headswitch: 0 # milliseconds ] track-to-track seek: 0 # milliseconds ] drivedata: 0 ] ] 3 partitions: # Uh? ] # size offset fstype [fsize bsize bps/cpg] ] c: 163840 0 unused 0 0 # (Cyl. 0 ] - 79) ] ] -------------------------------------------------------------------------- ] ] # c: is the whole disk, do not touch it! ] ] # I want to add one 10MB swap to this disk, rest space for files. ] # So I write to extra lines (before the c: -line): ] ] a: 143840 20000 4.2BSD 0 0 ] b: 20000 0 swap ] ] # Note: the sum of size fields is a+b=c. The offset is the starting ] # block number of the partition. When swap starts from 0 and is ] # 20000 blocks then next partition starts from 20000. ] # The extra zeroes on a: line mus be there! ] ] # There it is. Exit from editor, if errors try to correct. ] ] # Next make filesystem: ] ] # newfs /dev/rsd1a ] Warning: calculated sectors per cylinder (4096) disagrees with disk ] label (2048) ] Warning: 3136 sector(s) in last cylinder unallocated ] /dev/rsd1a: 123840 sectors in 31 cylinders of 1 tracks, 4096 ] sectors ] 60.5MB in 2 cyl groups (16 c/g, 32.00MB/g, 7680 i/g) ] super-block backups (for fsck -b #) at: ] 32, 65568, ] ] # So some sectors could be defined more .. this terminology is ] awfull: ] # Here newfs is speaking about 3136 sectors. In fdisk we define that ] # the disk has 32 sectors! ] # These must be blocks of 512 bytes, or what are they???? 3136 blocks ] # is 1605632 bytes that is 1.6MB. The actual size of my disk is more ] # than 80MB, it is about 81 MB. ] ] # And mount it: ] ] # mount /dev/sd1a /mnt ] # df ] Filesystem 1K-blocks Used Avail Capacity Mounted on ] /dev/sd0a 96143 30253 58198 34% / ] /dev/sd0s1f 1404471 741255 550858 57% /home ] /dev/sd0s1e 387503 273317 83185 77% /usr ] procfs 4 4 0 100% /proc ] kaarna:/home/www 1518207 1310531 86219 94% /opt/www ] /dev/sd1a 59951 1 55153 0% /mnt ] ] # If you get to this point, you are lucky. It is not easy. The ] # fdisk is the hardest part. ] ] Seppo ] ] ] ] ----------------------------------------------------------------------- ] Andrew Webster Network Manager / Special Projects ] Dataradio Inc. 200-5500 Royalmount Ave. TEL: +1 514 737 0020 ] Town of Mount Royal, QC, CANADA H4P 1H7 FAX: +1 514 737 7883 ] http://www.dataradio.com Email: awebster@dataradio.com ===========================================================================
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199604252243.PAA25630>