home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / os / linux / 9508 < prev    next >
Encoding:
Internet Message Format  |  1992-08-31  |  3.5 KB

  1. Path: sparky!uunet!mcsun!news.funet.fi!hydra!klaava!torvalds
  2. From: torvalds@klaava.Helsinki.FI (Linus Benedict Torvalds)
  3. Newsgroups: comp.os.linux
  4. Subject: Re: .97 kernel and root disk/probs with swapping
  5. Message-ID: <1992Aug31.194716.16232@klaava.Helsinki.FI>
  6. Date: 31 Aug 92 19:47:16 GMT
  7. References: <6026@pdxgate.UUCP> <1992Aug31.024052.12351@cc.umontreal.ca>
  8. Organization: University of Helsinki
  9. Lines: 76
  10.  
  11. In article <1992Aug31.024052.12351@cc.umontreal.ca> duperval@ERE.UMontreal.CA (Duperval Laurent) writes:
  12. >In article <6026@pdxgate.UUCP> moyerg@rigel.cs.pdx.edu (gary a moyer) writes:
  13. >>I am now in the process of getting the kernel to compile however I am getting
  14. >>some strange results.  I am using a 2M swap file (NOT partition).  I get
  15. >>some errors during swaps like:
  16. >>rw_swap: bad swapfile
  17. >>
  18. >>This occurs during compilation using gcc 2.2.2d with 4M RAM and 2M swap.
  19. >>Any ideas?  Thanks.
  20. >
  21. >I have similar problems with kernel compilation.  I have 4M of memory and 8M
  22. >swap space.  When compiling I get an out of memory, out of swap space error.
  23. >I'm running all the stuff that was on mcc-interim 0.96c (gcc 2.2.2, kernel
  24. >0.96c).
  25.  
  26. The "bad swapfile" problem is most usually due to (wait for it) a bad
  27. swapfile.  Hmm.  Maybe I should use cryptic numbers and give something
  28. like "ERR192SWP" instead - but that would also mean I'd have to write
  29. some documentation on the thing.  Not good. 
  30.  
  31. Anyway, to make a swapfile, it's not enough to just run "mkswap" -
  32. mkswap just writes the swap signature and some bad-page info. You
  33. actually have to create the swapfile with the correct size and without
  34. holes first. How you create the swapfile is totally up to you, but the
  35. normal thing to do is:
  36.  
  37.     # dd if=/dev/zero of=swapfile bs=1024 count=XXXX
  38.  
  39. where XXXX is the size of the file in kilobytes. You now have an empty
  40. file which is exactly XXXX blocks long. To mark it swappable, you then
  41. run mkswap on it and sync:
  42.  
  43.     # mkswap swapfile XXXX
  44.     # sync
  45.  
  46. You now have a swapfile that is ready to be used: swapping is then
  47. enabled with
  48.  
  49.     # swapon swapfile
  50.  
  51. It's normal to put the 'swapon' command in your /etc/rc.local or
  52. whatever - but you can do it by hand at each reboot if you want to.
  53.  
  54. Note that if you use a swap-paritition, you obviosuly don't have to
  55. create it first with "dd" or whetever: just make sure you have a good
  56. partition free, and run "mkswap" on it.  With swap partitions, it's
  57. generally a good idea to map out bad spots (or you'll get all sorts of
  58. nasty errors), so use the "-c" switch for this: 
  59.  
  60.     # mkswap -c /dev/hdXX XXXX
  61.     # sync
  62.  
  63. and
  64.  
  65.     # swapon /dev/hdXX
  66.  
  67. Swapping from a partition is a lot faster than swapping from a file, but
  68. creating a file is easier, and it's easier to remove or resize.
  69.  
  70. >I never encountered this prblem before and I thought I had plenty of room.
  71. >BTW, if anyone is interested, my make fails on chr_drv/tty_io.c when I have 
  72. >one console open and on chr_drv/console.c when two consoles are open.
  73. >
  74. >Also, what are these 'put_tty_queue' declarations disagree about 'inline'
  75. >errors I get.  What do they mean and could they be a hint as to what is going
  76. >wrong?
  77.  
  78. the "disagree about inline" message is arguably a gcc bug: it's an
  79. uncommonly stupid warning, and I don't know why gcc prints it.  It's
  80. probably easy to get rid of by just putting a "inline" before the
  81. prototype in include/linux/tty.h, but I'm too lazy to even test it out. 
  82. The way gcc inline (nonstatic, nonexternal) functions work, it's totally
  83. illogical to ask it to be prototyped that way.  I don't mind too much:
  84. as long as my only gripes with gcc are of this type, I'm happy. 
  85.  
  86.         Linus
  87.