HARD DISK UPGRADE MINI HOW-TO



Yves Bellefeuille,

yan@ottawa.com



 1.0,

31  1998



--------------------------------------------------

Translated by Ilgiz Kalmetev (2:5011/36.6@fidonet)

--------------------------------------------------

_________________________________________________________________



   Linux       

_________________________________________________________________



1.      

2.  -Linux 

3.      

4.   

5.   

6.        

7.  /etc/fstab 

8.  LILO     

9.   

10.  ,  LILO   



_________________________________________________________________



,        249     .

      Linux,  LILO,     

 .     .



  ,   "/dev/hda"   "" 

  "/dev/hda1" -    Linux. "/dev/hdb"  "" ,

 "/dev/hdb1"    Linux.



,  ,  Linux      

.       .



      , Red Hat 4.2,   

  ,     .     

 Debian 1.3.1  Slackware 3.3,        

    .



      ,    

,   ,   Linux  .



_________________________________________________________________



1.      



     "EIDE"     

,              

,       EIDE .    

CD-ROM -  EIDE .       

        , 

 ,    .



 SCSI -        .   

  ( ),    SCSI,     

 ,    ,     -  SCSI! 

    SCSI Howto.



           

 ,    -      

. ,      ,    

    (,       ,  

CD-ROM),       ,   

        .



     "master"  "slave",  

  .      

   ;  ,    

   .



    BIOS      "". ,  

    BIOS,       

.        BIOS   



American Megatrends (AMI):  Del   POST



Award: Ctrl-Alt-Esc



Compaq:  F10  ,        

    



Dell: Ctrl-Alt-Enter



DTK:  Esc  POST



IBM PS/2: Ctrl-Alt-Del,  Ctrl-Alt-Ins,      

 



Phoenix: Ctrl-Alt-Esc,  Ctrl-Alt-S,  Ctrl-Alt-Enter



      Reference .



(      BIOS,      .)



       root.

_________________________________________________________________





2.  -Linux 



       

(DOS, Windows, OS/2  ..) ,       Linux.  

          

,          Linux. 

,     DOS,   /dos,    

   :



umount /dos



 ,   - "umount",     "n"  

 "unmount".



_________________________________________________________________





3.   



  ,     :



fdisk /dev/hdb



       . Installation How-To  

Partitioning Mini How-To.



      1024 , . Partitioning Mini How-To.

 ,     ,    Linux, 

   1024 .        , 

    (1   2 )    /boot

  . (_  Slackware:_  -  /vmlinuz ,  

/boot/vmlinuz,     ,  / ,  /boot  

  .)



  ,   Linux,     

 fdisk   ,  fdisk  Linux.



_________________________________________________________________





4.   



  ,    :



mkfs.ext2 /dev/hdb1



       ( ),  

 -c  "/dev/hdb1".



( :  ,    man,  

"mkfs -t ext2 -c /dev/hdb1 "       Red Hat, 

Debian  Slackware.)



_________________________________________________________________



5.   



 ,     ,  /new-disk,  

    :



mkdir /new-disk mount -t ext2 /dev/hdb1 /new-disk

_________________________________________________________________





6.        



     ,  .



, , __    /new-disk,     , 

       !



 ,     /proc   ,     

 : /proc - ""       

 ,      ,   

.



        .   

  , ,        . 

      10   ,    

 .



     ,   "df"   

.     ,   ,  "watch df"  

"watch ls -l /new-disk",       ; 

 Ctrl-C,   . ,   

 "watch"   .



1. cp -ax / /new-disk



 -  ,    ,    

 Linux     .  -a  

     .  -x  

cp   ;  ,    

/new-disk  /proc .



2. cd / && cp -a `/bin/ls -1A | egrep -v "^new-disk$|^proc$"` /new-disk



(     .)



            

 /new-disk  /proc  /new-disk.  ,    

 ls -  1,   L!



      .



3. (cd / && tar cpf - . --exclude new-disk --exclude proc) | (cd /new-disk && 

tar xpf -)



(     .)



   , "tar" ,   /new-disk  /proc, 

  /new-disk  "tar"  .  , 

  --exclude          

 .



( :  -l   ,   tar   

 /new-disk  /proc   ,     . 

,  tar -l   ,   cp -x .)



   ,  .



4. cp -a /bin /boot /dev /etc /home /lib /lost+found /mnt /root /sbin /tmp /usr 

/var /new-disk



(     .)



 , /new-disk,     cp.   

 - . ,       

 /new-disk.



  ,     ,    

.      ,   /new-disk  

/proc.         - ,   

    ,   ,   

 .



  ,   -     

,     ,   .  

    Debian  Slackware,      

    :



cp -dp /* /.* /new-disk



      ,     

 /proc   :



mkdir /new-disk/proc



  ,  ,        :



umount /new-disk

fsck.ext2 -f /dev/hdb1 mount -t ext2 /dev/hdb1 /new-disk



     ,    , 

 ,     :



#!/bin/sh

cd / for file in `/bin/ls -1A | egrep -v '^new-disk$|^proc$'` do

find $file -xtype f -exec cmp \{\} /new-disk/\{\} \; done



( _  Slackware:_   Slackware    

"cmp"  "diff",        ,   

   .)



    ,       

 (  /dev),   ..,    "cmp"   

  .       ,    

"" .



_________________________________________________________________





7.  /etc/fstab 



             ,  

 ,     /etc/fstab   .  

,         /new-disk/etc/fstab.



,         

   ,     ,    

     "/"     .



_________________________________________________________________





8.  LILO     



   .  ,  LILO   Master Boot

Record   (MBR); , ,   .



   LILO   ,      

.



,  LILO   __    ; ,

 LILO ,       __ LILO 

   , ,      :



LILO         :



       -    . (  ,    

             ,    - 

           ,      

            ).



,      

LILO    ,      ,   

  ,    LILO   MBR

          .



 ,     ,   

     .



  ,  ,      

  :



fdformat /dev/fd0H1440

mkfs.ext2 /dev/fd0 

mount -t ext2 /dev/fd0 /mnt



( _ Debian:_  "fdformat"      Debian. 

     ,     ,    

.   ,        

,  "-c"   "mkfs.ext2".



( _ Debian  Slackware:_   "fdformat /dev/fd0h1440", 

   "h".)



    /boot  :



cp -dp /boot/* /mnt



( _ Slackware:_   /vmlinuz   ; 

  "cp /vmlinuz /mnt".)



   /mnt/lilo.conf  :



boot=/dev/fd0           #  LILO  .

map=/mnt/map            #  "map" .

install=/mnt/boot.b     # ,      .

prompt                  #  LILO    "LILO boot:".

timeout=50              #      5 .

                        # (   .)

image=/mnt/vmlinuz      #   Linux  .

label=linux             #    Linux.

root=/dev/hda1          #   root    .

                        #      . 

                        # ,      

                        #  ,    



( _ Debian:_   "image"     Linux. 

,  Debian 1.3.1  " /mnt/vmlinuz-2.0.29".)



 LILO   :



/sbin/lilo -C /mnt/lilo.conf



 -C  /sbin/lilo,    .



 :



umount /mnt



  .



_________________________________________________________________





9.   



   ,       

  BIOS,     .



_________________________________________________________________





10.  ,  LILO   



     ,     . 

  , , ,   

   BIOS  " A:, C: ".



      /etc/lilo.conf,   

/sbin/lilo,   LILO   .  Debian, ,  

  "boot"  "/dev/hda",   "/dev/hda1"   , 

    LILO  Master Boot Record



           

,  ,    .     

- ,      ,   

  ,    .



_________________________________________________________________









  _Dr Konrad Hinsen_  Institut de biologie 

structurale, Grenoble, ,      

   Linux.   _Frank Damgaard_, _Paul Koning_  

_Josh Rabinowitz _,   _Scott Christensen_    

  Slackware.



_________________________________________________________________



