Tài liệu Chapter-4-Shared OS Installation docx

7 231 0
Tài liệu Chapter-4-Shared OS Installation docx

Đang tải... (xem toàn văn)

Thông tin tài liệu

2Apr il 2003, 17:00:47 The Complete FreeBSD (shareinstall.mm), page 51 4 Shared OS Installation In this chapter: • Separate disks • Shar ing adisk • Shar ing with Linux or another BSD • Repar titioning with FIPS In this chapter: • Separate disks • Shar ing adisk • Shar ing with Linux or another BSD • Repar titioning with FIPS In manycases, you won’twant to install FreeBSD on the system by itself: you may need to use other operating systems as well. In this chapter,we’ll look at what you need to do to prepare for such an installation. If you’re only running FreeBSD on the machine, you don’tneed to read this chapter,and you can move ontoChapter 5, Installing FreeBSD. Before you start the installation, read this chapter carefully. It’seasy to makeamistake, and one of the most frequent results of mistakes is the total loss of all data on the hard disk. Currently,only the ia32 (Intel) port of FreeBSD is capable of sharing with other operating systems. We’llconcentrate on howtoshare your system with Microsoft, because that’sboth the most difficult and the most common, but most of this chapter applies to other operating systems as well. Youmay want to refer to the discussion of Microsoft and FreeBSD disk layouts on page 34. Separate disks The first question is: do you need to share a disk between FreeBSD and the other operating system? It’s much easier if you don’thav e to. In this section, we’ll look at what you need to do. Manyoperating systems will only boot from the first disk identified by the BIOS, usually called the C: disk in deference to Microsoft. FreeBSD doesn’thav e this problem, so the shareinstall.mm,v v4.11 (2003/04/02 06:38:41) 51 Separate disks 52 2April 2003, 17:00:47 The Complete FreeBSD ( /tools/tmac.Mn), page 52 easiest thing is to install FreeBSD on the entire second disk. BIOS restrictions usually makeitdifficult to boot from anybut the first twodisks. In this case, you don’treally need to do anything special, although it’salways a good idea to back up your data first. Install FreeBSD on the second disk, and choose the Boot Manager option in the partition editor (page 64). This will then give you the choice of booting from the first or second disk. Note that you should not change the order of disks after such an installation; if you do, the system will not be able to find its file systems after boot. Sharing a disk If you intend to share a disk between FreeBSD and another operating system, the first question is: is there enough space on the disk for FreeBSD? Howmuch you need depends on what you want to do with FreeBSD, of course, but for the sakeofexample we’ll take120 MB as an absolute minimum. In the following section, we’ll consider what to do if you need to change your partitions. If you already have enough space for a FreeBSD partition (for example, if you have just installed Microsoft specifically for sharing with FreeBSD, and thus have not filled up the disk), continue reading on page 66. Sharing with Linux or another BSD Sharing with other free operating systems is relatively simple. Youstill need to have space for FreeBSD, of course, and unlikeMicrosoft, there are no tools for shrinking Linux or BSD file systems: you’ll have toremove them or recreate them. Youcan find some information about sharing with Linux in the mini-Howto at http://www.linux.org/docs/ldp/howto/mini/Linux+FreeBSD.html. NetBSD and OpenBSD file systems and slices are very similar to their FreeBSD counterparts. They’re not identical, however, and you may find that one of the systems recognizes the partition of another system and complains about it because it’snot quite right. For example, NetBSD has a d partition that can go outside the boundary of the slice. FreeBSD does not allowthis, so you get a harmless error message. Repar titioning with FIPS Typically,ifyou’ve been running Microsoft on your machine, it will occupythe entire disk. If you need all this space, of course, there’snoway to install another operating system as well. Frequently,though, you’ll find that you have enough free space in the partition. Unfortunately,that’snot where you want it: you want the space in a new partition. There are a number of ways to do so: shareinstall.mm,v v4.11 (2003/04/02 06:38:41) 53 Chapter 4: Shared OS Installation 2April 2003, 17:00:47 The Complete FreeBSD ( /tools/tmac.Mn), page 53 • Youcan reinstall the software. This approach is common in the Microsoft world, but FreeBSD users try to avoid it. • Youcan use FIPS to shrink a Microsoft partition, leaving space for FreeBSD. FIPS is a public domain utility,and it is included on the FreeBSD CD-ROM. • If you can’tuse FIPS,use a commercial utility like PartitionMagic.This is not included on the CD-ROMs, and we won’tdiscuss it further. In the rest of the section, we’ll look at howtoshrink a partition with FIPS.Ifyou do it with PartitionMagic, the details are different, but the principles are the same. In particular: Before repartitioning your disk, makeabackup. You can shoot yourself in the foot with this method, and the result will almost invariably be loss of data. If you’ve been running Microsoft on your system for anylength of time, the data in the partition will be spread all around the partition. If you just truncate the partition, you’ll lose a lot of data, so you first need to move all the data to the beginning of the partition. Do this with the Microsoft defragmentation utility.Before proceeding, consider a few gotchas: • The newMicrosoft partition needs to be big enough to hold not only the current data, butalso anything you will want to put in it in the future. If you makeitexactly the current size of the data, it will effectively be full, and you won’tbeable to write anything to it. • The second partition is also a Microsoft partition. To install FreeBSD on it, you need to convert it into a FreeBSD partition. • FIPS may result in configuration problems with your Microsoft machine. Since it adds a partition, anyautomatically assigned partitions that followwill have a different drive letter.Inparticular,this could mean that your CD-ROM drive will ‘‘move.’’ After you delete the second Microsoft partition and change it into a FreeBSD partition, it will ‘‘move’’ back again. Forfurther information, read the FIPS documentation in /cdrom/tools/fips.doc.In particular,note these limitations: • FIPS works only with Hard Disk BIOSes that use interrupt 0x13 for low-levelhard disk access. This is generally not a problem. • FIPS does not split partitions with 12 bit FATs, which were used by older versions of Microsoft. These are less than 10 MB in size and thus too small to be worth splitting. • FIPS splits only Microsoft partitions. The partition table and boot sector must conform to the MS-DOS 3.0+ or Windows 95 conventions. This is marked by the system indicator byte in the partition table, which must have the value 4 (16 bit sector number) or 6 (32 bit sector number). In particular,itwill not split Linux or Windows 2000 and later partitions. shareinstall.mm,v v4.11 (2003/04/02 06:38:41) Repar titioning with FIPS 54 2April 2003, 17:00:47 The Complete FreeBSD ( /tools/tmac.Mn), page 54 • FIPS does not yet work on extended Microsoft partitions. • FIPS needs a free partition entry.Itwill not work if you already have four partitions. • FIPS will not reduce the original partition to a size of less than 4085 clusters, because this would involverewriting the 16 bit FAT toa12bit FAT . Repar titioning—an example In this section, we’ll go through the mechanics of repartitioning a disk. We’llstart with a disk containing a single, complete Microsoft system. First, run the Microsoft error check utility on the partition you want to split. Makesure no ‘‘dead’’clusters remain on the disk. Next, prepare a bootable floppy. When you start FIPS,you will be giventhe opportunity to write backup copies of your root and boot sector to a file on drive A:.These will be called ROOTBOOT.00x,where x represents a digit from 0 to 9.Ifanything goes wrong while using FIPS,you can restore the original configuration by booting from the floppy and running RESTORRB. If you use FIPS more than once (this is normally not necessary,but it might happen), your floppy will contain more than one ROOTBOOT file. RESTORRB lets you choose which configuration file to restore. The file RESTORRB.000 contains your original configuration. Trynot to confuse the versions. Before starting FIPS you must defragment your disk to ensure that the space to be used for the newpartition is free. If you’re using programs like IMAGE or MIRROR,note that theystore a hidden system file with a pointer to your mirror files in the last sector of the hard disk. You must delete this file before using FIPS.Itwill be recreated the next time you run MIRROR.Todelete it, in the root directory enter: C\:> attrib -r -s -h image.idx for IMAGE C\:> attrib -r -s -h mirorsav.fil for MIRROR Then delete the file. If FIPS does not offer as much disk space for creation of the newpartition as you expect, this may mean that: • Youstill have too much data in the remaining partition. Consider making the new partition smaller or deleting some of the data. If you delete data, you must defragment and run FIPS again. • There are hidden files in the space of the newpartition that have not been movedby the defragmentation program. Makesure which program theybelong to. If a file is a swap file of some program (for example NDOS) it is possible that it can be safely deleted (and will be recreated automatically later when the need arises). See your manual for details. shareinstall.mm,v v4.11 (2003/04/02 06:38:41) 55 Chapter 4: Shared OS Installation 2April 2003, 17:00:47 The Complete FreeBSD ( /tools/tmac.Mn), page 55 If the file belongs to some sort of copyprotection, you must uninstall the program to which it belongs and reinstall it after repartitioning. If you are running early versions of MS-DOS (before 5.0), or another operating system, suchOS/2, or you are using pro- grams likeStacker, SuperStor,orDoublespace, read the FIPS documentation for other possible problems. Running FIPS After defragmenting your Microsoft partition, you can run FIPS: C:\> D: changetoCD-ROM D:\> cd \tools makesureyou’re inthe tools directory D:\tools\> fips and start the FIPS program a lot of copyright information omitted Press any key do what the computer says Which Drive (1=0x80/2=0x81)? The message WhichDrive may seem confusing. It refers to BIOS internal numbering. Don’tworry about it: if you want to partition the first physical drive inthe system, (C:), enter 1,otherwise enter 2.Likethe BIOS, FIPS handles only twohard disks. If you start FIPS under Windows, it will complain and tell you to boot from a floppy disk. It won’tstop you from continuing, but it is a Bad Idea to do so. Next, FIPS reads the root sector of the hard disk and displays the partition table: ||Start | | End |Start |Number of| Part.|bootable|Head Cyl. Sector|System|Head Cyl. Sector| Sector |Sectors |MB + + + + + + + 1|yes | 10 1|0ch| 239 2047 63| 63| 40083057|19571 2| no| 0 00|00h| 0 00|0|0|0 3| no| 0 00|00h| 0 00|0|0|0 4| no| 0 00|00h| 0 00|0|0|0 This shows that only the first partition is occupied, that it is bootable, and that it occupies the whole disk (19571 MB, from Cylinder 0, Head 1, Sector 1 to Cylinder 2047, Head 238, Sector 63). It also claims that this makes 40083057 sectors. It doesn’t: the cylinder number has been truncated, and FIPS complains about a partition table inconsistency, which it fixes. After this, we have: ||Start | | End |Start |Number of| Part.|bootable|Head Cyl. Sector|System|Head Cyl. Sector| Sector |Sectors |MB + + + + + + + 1|yes | 10 1|0ch| 239 2650 63| 63| 40083057|19571 2| no| 0 00|00h| 0 00|0|0|0 3| no| 0 00|00h| 0 00|0|0|0 4| no| 0 00|00h| 0 00|0|0|0 Don’tworry about the ‘‘bootable’’flag here—we’ll deal with that in the FreeBSD installation. First, FIPS does some error checking and then reads and displays the boot sector of the partition: shareinstall.mm,v v4.11 (2003/04/02 06:38:41) Repar titioning with FIPS 56 2April 2003, 17:00:47 The Complete FreeBSD ( /tools/tmac.Mn), page 56 Checking boot sector OK Press any Key do what it says Bytes per sector: 512 Sectors per cluster: 32 Reserved sectors: 32 Number of FATs: 2 Number of rootdirectory entries: 0 Number of sectors (short): 0 Media descriptor byte: f8h Sectors per FAT: 9784 Sectors per track: 63 Drive heads: 240 Hidden sectors: 63 Number of sectors (long): 40083057 Physical drive number: 80h Signature: 29h After further checking, FIPS asks you if you want to makeabackup floppy. Enter your formatted floppyindrive A: and makethe backup. Next, you see: Enter start cylinder for new partition (35 - 2650): Use the cursor keys to choose the cylinder, <enter> to continue Old partition Cylinder New Partition 258.4 MB 35 19313.4 MB Use the Cursor Left and Cursor Right keys to adjust the cylinder number at which the newpartition starts. Youcan also use the keys Cursor Up and Cursor Down to change in steps of ten cylinders. FIPS updates the bottom line of the display to showthe new values selected. Initially, FIPS chooses the smallest possible Microsoft partition, so initially you can only increase the size of the old partition (with the Cursor Right key). When you’re happywith the sizes, press Enter to move ontothe next step. Be very sure you’re happy before you continue. If you makethe first partition too small, there is no way to makeitlarger again. On the other hand, if you makeittoo large, you can split it again and then use fdisk or MS-DOS FDISK to remove the superfluous partitions. In this example, we choose equal-sized partitions: Old partition Cylinder New Partition 251.5 MB 511 251.5 MB (pressed Enter) ||Start | | End |Start |Number of| Part.|bootable|Head Cyl. Sector|System|Head Cyl. Sector| Sector |Sectors |MB + + + + + + + 1|yes | 00 1|06h| 15 511 63| 0| 515088| 251 2| no| 0 512 1| 06h| 15 1023 63| 0| 515088| 251 3| no| 0 00|00h| 0 00|0|0|0 4| no| 0 00|00h| 0 00|0|0|0 Do you want to continue or reedit the partition table (c/r)? c To ensure that the partition is recognized, reboot immediately.Makesure to disable all programs that write to your disk in CONFIG.SYS and AUTOEXEC.BAT before rebooting. It might be easier to to rename the files or to boot from floppy. Beparticularly careful to disable programs like MIRROR and IMAGE,which might get confused if the shareinstall.mm,v v4.11 (2003/04/02 06:38:41) 57 Chapter 4: Shared OS Installation 2April 2003, 17:00:47 The Complete FreeBSD ( /tools/tmac.Mn), page 57 partitioning is not to their liking. After rebooting, use CHKDSK or Norton Disk Doctor to makesure the first partition is OK. If you don’tfind anyerrors, you may nowreboot with your normal CONFIG.SYS and AUTOEXEC.BAT.Start some programs and make sure you can still read your data. After that, you have two valid Microsoft partitions on your disk. We’lllook at what to do with them in the next chapter.The specific differences from a dedicated install are on page 66, but you’ll need to start from the beginning of the chapter to do the install. shareinstall.mm,v v4.11 (2003/04/02 06:38:41) . systems. We’llconcentrate on howtoshare your system with Microsoft, because that’sboth the most difficult and the most common, but most of this chapter applies. start the installation, read this chapter carefully. It’seasy to makeamistake, and one of the most frequent results of mistakes is the total loss of all

Ngày đăng: 24/01/2014, 14:20

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan