home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / doc / HOWTO / mini / Linux+OS2+DOS < prev    next >
Text File  |  1996-06-01  |  13KB  |  317 lines

  1. Linux + OS/2 (+ DOS) mini-HOWTO, version 0.2. May 20, 1996.
  2. by Hamish Moffatt, moffatt@yallara.cs.rmit.edu.au.
  3. Please send all corrections, suggestions, etc to this address.
  4.  
  5. Thanks go to Matthieu Willm <mwillm@vnet.ibm.com> for his post
  6. on this subject in comp.os.linux.setup, which prompted me to
  7. write this mini-HOWTO.
  8.  
  9. Table of Contents
  10. 0.  Legal things
  11. 1.  Introduction
  12. 2.  Before you read this document
  13. 3.  The actual installation
  14. 3.1   Some background
  15. 3.2   Install Linux
  16. 3.3   Install LILO
  17. 3.4   Add Linux to OS/2's Boot Manager menu
  18. 3.5   If you get LILO rather than OS/2 Boot Manager when you reboot
  19. 3.6   Advanced options
  20. 4.  If you've already installed Linux, but not OS/2 ...
  21. 4.1   Installing OS/2
  22. 4.2   Troubleshooting
  23. 5.  If you've already installed both Linux and OS/2 ...
  24. 5.1   If you can boot OS/2 but not Linux
  25. 5.2   If you can boot Linux but not OS/2
  26. 6.  Getting LILO to boot OS/2 ...
  27. 7.  The end.
  28.  
  29. 0. Legal things
  30.  
  31. The instructions in this HOWTO will change the boot loader on your
  32. computer. During the course of these instructions some mistakes
  33. may make your system unable to boot either Linux or OS/2 or DOS,
  34. or perhaps none of the above. Make sure you have your Linux boot
  35. and root disks, your OS/2 Installation and Disk 1 diskettes,
  36. and your DOS Setup disks if relevant handy before you begin.
  37. The writer takes no responsibility for any damage incurred during
  38. the process of these instructions; there is no warranty, guarantee
  39. etc whatsoever.
  40.  
  41. 1. Introduction
  42.  
  43. When I first got interested in Linux, in about August 95, I was told
  44. that while it should be possible to have OS/2 Boot Manager and Linux
  45. coexist, it "just didn't work." When I actually got around to installing
  46. OS/2 and Linux together on a new PC, it turned out that it works perfectly
  47. and isn't actually too hard. This mini-HOWTO should help you get these
  48. two working together.
  49.  
  50. Note: in this document, I will describe how to have OS/2 Boot Manager
  51. boot Linux (via LILO). There is a short section later on on having
  52. LILO (Linux's loader and boot manager) boot OS/2.
  53.  
  54. 2. Before you read this document
  55.  
  56. In this mini-HOWTO I assume you have already installed OS/2 (and also
  57. DOS if you wish) on your system. If you've already installed Linux
  58. but not OS/2, or both OS/2 and Linux, see section 4 or 5 respectively.
  59.  
  60. Note that you need to have OS/2 Boot Manager installed. If you have OS/2
  61. and DOS on the same partition (and you switch between them with BOOT /DOS
  62. and BOOT /OS2), then you're using Dual Boot, not Boot Manager. You need
  63. to read the LILO documentation or mini-HOWTO on booting another (non-Linux)
  64. operating system. This HOWTO is for Boot Manager only.
  65.  
  66. 3. The actual installation
  67. 3.1 Some background
  68.  
  69. So, you have OS/2 and maybe DOS already installed. (In this HOWTO my
  70. examples will have DOS also installed). Your partition table might
  71. look something like this;
  72.  
  73.    Device Boot  Begin   Start     End  Blocks   Id  System
  74. /dev/hda1           1       1     254  512032+   6  DOS 16-bit >=32M
  75. /dev/hda2         256     256     786 1070496    5  Extended
  76. /dev/hda3   *     255     255     255    2016    a  OS/2 Boot Manager
  77. /dev/hda5   *     256     256     509  512032+   7  OS/2 HPFS
  78. /dev/hda6   *     510     510     763  512032+  83  Linux native
  79. /dev/hda7   *     764     764     786   46336+  82  Linux swap
  80.  
  81. Here hda1 contains DOS, hda3 is Boot Manager, hda5 is the OS/2 (boot)
  82. partition, and hda6 is the Linux (boot) partition. If your OS/2 partition
  83. is FAT rather than HPFS, that's fine -- these instructions apply just
  84. the same. Also, while OS/2 Boot Manager must be on /dev/hda somewhere,
  85. OS/2 and Linux could be on /dev/hdb, hdc, or hdd, etc. (OS/2 BootMan has
  86. no problems booting OS/2 from a second disk, so it should have no problems
  87. booting Linux from a second disk. I haven't been able to get DOS to boot
  88. from a second disk, though.)
  89.  
  90. 3.2 Install Linux
  91.  
  92. At this point, you should install Linux. You are best to create your
  93. DOS and OS/2 (and extended, if necessary) partitions using OS/2's FDISK,
  94. then creating your Linux partitions with Linux's fdisk. Some people have
  95. reported that sometimes OS/2 thinks the partition table is corrupt and
  96. won't let you add Linux to the Boot Manager menu later, so you might have
  97. to try creating ALL your partitions with OS/2's FDISK, and using Linux's
  98. fdisk later to change the partitions to the right types. See the fdisk
  99. documentaton for further information on changing partition types.
  100. (Thanks to bubeck@informatik.uni-tuebingen.de (Till Bubeck).)
  101.  
  102. Your distribution's installation program should ask you about installing
  103. LILO; Slackware's does. You do want LILO installed (OS/2 Boot Manager cannot
  104. boot Linux directly, since it's doesn't understand Linux's file system format.
  105. Also, adding LILO gives you a chance to choose between different versions
  106. of Linux, add boot parameters so Linux can find all your hardware, etc.)
  107.  
  108. 3.3 Install LILO
  109.  
  110. Slackware will ask you WHERE you want to install LILO; the SuperBlock
  111. (partition table, master boot record etc), the Linux partition's boot
  112. sector, etc. The boot manager that lives in the SuperBlock is your master
  113. boot manager - you want this to be OS/2's Boot Manager, so you need to install
  114. LILO (Linux's boot manager) in the boot sector of your Linux partition.
  115. In the partition table example above, this would be on /dev/hda6.
  116. (NOT /dev/hda, which would be the master boot record, where OS/2 BootMan
  117. lives.)
  118.  
  119. Finish your Linux installation. If the installation hasn't run it for you,
  120. run /sbin/lilo. You MAY need to create your own /etc/lilo.conf, which is
  121. the LILO configuration file; it tells LILO where it can find the Linux
  122. kernel (the operating system itself) on your hard drive, etc. A very
  123. simple one might be
  124.  
  125.   boot = /dev/hda6
  126.   delay = 50
  127.   vga = normal
  128.   ramdisk = 0
  129.  
  130.   image = /vmlinuz
  131.     root = /dev/hda6
  132.     label = linux
  133.     read-only
  134.  
  135. boot specifies the partition where LILO will install itself; this should be
  136. /dev/hdax, not /dev/hda (or hdb, as appropriate).
  137.  
  138. 3.4 Add Linux to OS/2's Boot Manager menu
  139.  
  140. Now you have Linux installed and ready to go, but after you reboot, you won't
  141. be able to boot it. All that's left now is to tell OS/2 Boot Manager about it.
  142. Reboot, and select OS/2 from the Boot Manager menu. (If you get a "LILO"
  143. prompt instead of Boot Manager, read section 3.5 below).
  144.  
  145. Boot up OS/2, and run FDISK. Move to your Linux partition (listed as
  146. "Type 83" -- OS/2 doesn't seem to know Linux's partition types). Press Enter,
  147. and from the menu select "Add to Boot Manager menu." Enter an appropriate
  148. name (eg Linux), then press F3, save and exit. 
  149.  
  150. When you reboot, your OS/2 Boot Manager menu should include Linux. When you
  151. select it, you should see "LILO " for about five seconds, then Linux should
  152. boot. If it does, you're all finished. Enjoy!
  153.  
  154. 3.5 If you get LILO rather than OS/2 Boot Manager when you reboot
  155.  
  156. If when you reboot, you get "LILO ", rather than OS/2 Boot Manager, then
  157. you've installed LILO in the superblock (/dev/hda), rather than on a
  158. partition (/dev/hda6 or whatever). To fix this isn't too hard, luckily.
  159. Boot up your OS/2 Installation floppy, and exit to the command prompt.
  160. Run FDISK, then save and exit. Boot Manager should be back when you reboot.
  161. However, now you can't boot Linux again. Get out your Linux boot and root
  162. disks, and mount your Linux partition. You can either boot completely from
  163. diskettes, then type
  164.  
  165.   mount /dev/hda6 /mnt
  166.  
  167. once you can log in, or (depending on your distribution), you can mount
  168. your hard drive instead of the root floppy. On Slackware, you can do this
  169. by typing
  170.  
  171.   mount root=/dev/hda6
  172.  
  173. at the LILO prompt you get as soon as you've booted the boot disk.
  174.  
  175. Now, edit your LILO config (either /mnt/etc/lilo.conf or /etc/lilo.conf,
  176. depending on which of the above methods you used), and change the
  177. "boot = " line to say /dev/hda6 (or whatever) instead of /dev/hda.
  178. Then run
  179.  
  180.   /mnt/sbin/lilo -C /mnt/etc/lilo.conf
  181.  
  182. or
  183.  
  184.   /sbin/lilo
  185.  
  186. depending on which method you used before. Reboot again, and OS/2 Boot
  187. Manager should be back. See section 3.4 on adding Linux to the OS/2
  188. Boot Manager menu.
  189.  
  190. 3.6 Advanced options
  191.  
  192. If you want to save a few seconds during booting, you can get "delay = 0"
  193. instead of 50 in your /etc/lilo.conf. Using the delay gives you a chance
  194. to boot another operating system, but you're using OS/2 Boot Manager for that,
  195. so you may not need it. (However, LILO also gives you the chance to boot
  196. different Linux kernel versions, and you may want that).
  197.  
  198. Actually, if you press shift immediately after you select Linux from the
  199. Boot Manager menu, you get the "LILO: " prompt anyway. LILO loads very
  200. quickly though, so this can be harder than it sounds.
  201.  
  202.  
  203. 4. If you've already installed Linux, but not OS/2 ...
  204. 4.1 Installing OS/2
  205.  
  206. You have Linux installed, and when you boot your PC you get the LILO
  207. prompt. You want to install OS/2. This might actually be easier than installing
  208. OS/2 before Linux, actually.
  209.  
  210. Boot Linux, and edit your /etc/lilo.conf file. Change the "boot = " line to
  211. the name of your linux partition, eg /dev/hda6, instead of the name of
  212. your boot drive, eg /dev/hda. Then run /sbin/lilo to install LILO again.
  213. This will install LILO in the boot sector of your Linux partition, so that
  214. OS/2 can boot it later.
  215.  
  216. Now, install OS/2. When you create your OS/2 partitions in OS/2's FDISK,
  217. *do* install Boot Manager, and make sure you add your OS/2 (and DOS)
  218. partition to it. Also, add your Linux ("Type 83" in OS/2 FDISK) partition
  219. to the menu too. (Press Enter on the Linux partition, and select
  220. "Add to Boot Manager menu", and enter a suitable description). You should
  221. now be all set to boot Linux and OS/2 from the Boot Manager menu.
  222.  
  223. 4.2 Troubleshooting
  224.  
  225. If, when you select Linux from the Boot Manager menu, you get Missing
  226. Operating System, Non-system disk or disk error, etc, then you didn't
  227. get LILO installed properly in your Linux partition's boot sector.
  228. Use your Linux boot (and maybe also root) disk to edit your lilo.conf
  229. file again as in section 4.1, and make sure you run /sbin/lilo.
  230. (Section 3.5 gives some information on how you can boot Linux from
  231. floppies and get access to your Linux partition on hard drive).
  232.  
  233. If you get LILO when you reboot, instead of OS/2 Boot Manager, then
  234. BootMan wasn't installed properly. Boot the OS/2 Installation disks
  235. again, quit to the command prompt (F3), and run FDISK. Make sure
  236. Boot Manager is installed, and that the BootMan partition is marked
  237. Bootable.
  238.  
  239. 5. You've already installed both OS/2 and Linux ...
  240.  
  241. Both LILO (Linux's boot manager and loader) and OS/2 BootMan like to
  242. be the master boot manager on your system. If you've already installed
  243. both of these using default options, then you probably can't boot
  244. one of these two at the moment (the one you installed first won't
  245. be bootable).
  246.  
  247. OS/2 BootMan HAS to be the master boot manager, but LILO can be moved
  248. so it only boots Linux. 
  249.  
  250. 5.1 If you can boot OS/2 but not Linux
  251.  
  252. You need to boot Linux (using your boot and root floppies if need be;
  253. see section 3.5 on how to get to your Linux hard disk partition from
  254. the boot/root disks).
  255.  
  256. Edit your /etc/lilo.conf and change "boot = " to the name of your Linux
  257. partition (eg /dev/hda6) rather than your boot drive (eg /dev/hda).
  258. Run /sbin/lilo. (Section 3.5 gives more details about getting to
  259. these files).
  260.  
  261. Now, boot OS/2 and run FDISK. Select your Linux partition ("Type 83"),
  262. and select "Add to Boot Manager menu" from the pop-up menu. You should
  263. now be all set.
  264.  
  265. If you reboot and Linux still isn't listed, check that you added it
  266. properly in the last step. If Linux is listed but you get missing system
  267. or non-system disk errors when you select it, you might not have
  268. got LILO installed correctly in the first part of 5.1.
  269.  
  270. 5.2 If you can boot Linux but not OS/2
  271.  
  272. See the instructions in 5.1. To boot Linux, just boot from your hard
  273. drive as normal; to boot OS/2, use the Installation diskette, and
  274. exit to the command prompt (F3) to run FDISK.
  275.  
  276.  
  277. 6. Getting LILO to boot OS/2 ...
  278.  
  279. Theoretically, LILO could boot OS/2; that is, at the LILO prompt you
  280. could hit Shift and enter OS2 or whatever. I have tried this, and it
  281. didn't work. However, my OS/2 is on /dev/hdb6, which may complicate
  282. things.
  283.  
  284. In /etc/lilo.conf, you need to add
  285.  
  286.   other = /dev/hda5
  287.     label = os2
  288.  
  289. (if your OS/2 partition is /dev/hda5). You should also add
  290.  
  291.     table = /dev/hda
  292.  
  293. (or hdb) so that Linux can check for the partition, but I got
  294. missing partition errors when running /sbin/lilo.
  295.  
  296. If your OS/2 is on your second hard drive, you also need to add
  297.  
  298.     loader = /boot/os2_d.b
  299.  
  300. else /sbin/lilo won't run successfully (it requires a special loader
  301. to boot OS/2 from a second hard drive, and os2_d.b is it).
  302.  
  303. If you've been able to get this working, please let me know.
  304.  
  305.  
  306. 7. The end.
  307.  
  308. Please send your comments, suggestions, questions (as a last resort, please)
  309. to me at
  310.  
  311.   moffatt@yallara.cs.rmit.edu.au
  312.  
  313. The latest version of this mini-HOWTO should be at
  314.  
  315.   http://yallara.cs.rmit.edu.au/~moffatt/linux-os2/
  316.  
  317.