

  UFS Journaling   Desktop 


 

<manolis@FreeBSD.org>
$FreeBSD: doc/el_GR.ISO8859-7/articles/gjournal-desktop/article.sgml,v 1.6
2009/07/31 06:48:50 manolis Exp $
   2008  
 FreeBSD       FreeBSD Foundation.
          
           
 .           
      FreeBSD     
 ,      : [TM]  .
      journaling,   
 (journal  )       
    .      
         
    .    journaling  
    ,      
           
     .    journaling  
          
   .    UFS   
 FreeBSD      journaling. ,  
 GEOM  FreeBSD 7.X    journal class   
  ,        
.         
journaling    desktop    .
-------------------------------------------------------------------------------

1 

        
     - , 
       desktop     
   .       ,
             
    (    reset ..). 
    ,  Soft Updates   
  UFS      ,    
       , 
      ,   .  
,           
    ,      
.
    journaling     GEOM   
   ,     
           
     .
          UFS journaling 
  desktop PC (       
      ).      
        FreeBSD.   
       .
    ,  :

*          journaling   
      FreeBSD.
*         (module) geom_journal (
           ).
*           
  journaling,         /etc/fstab   
  .
*     journaling   () .
*         journaling.

    ,  :

*      UNIX   FreeBSD.
*         FreeBSD  
    sysinstall.


     :    ,  
        ,     
      .        
              
      ,       
            .
              
        ,        
          .

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

2   Journaling  FreeBSD

 journaling     GEOM  FreeBSD 7.X  
      (  
     ext3  Linux)    
block.          
 ,   FreeBSD 7.0-RELEASE,      
 UFS2.
  journaling     geom_journal.ko
  (        )
    gjournal      .
   journaling       , 
  /usr.          
  .
    journaling    ,  
         
(journal).         
    (data provider),     
      (journal provider).
    journaling        
,         . 
  journaling   ,    
           . 
 ,      gjournal,    
         journaling. 
:

*    journaling    /usr,  
    /dev/ad0s1f (     ).
*       ,     /dev/ad0s1g.
*      gjournal,     ,  /dev/
  ad0s1f.journal,   /dev/ad0s1f        /
  dev/ad0s1g     .     
            
  .

             
 ,        . 
,     ,     
1 GB        /usr,   
           
      (..  video)  
 .           
          ,
     kernel panic.

     :        ,
             
     (  ,  , 
     ).         
        ,     
          :    RAM 
           30%    .
      ,      1 GB RAM,   
         3.3 GB. ( 
       RAM   3.3       .)

      journaling,   
 manual  gjournal(8).
-------------------------------------------------------------------------------

3      FreeBSD


3.1       Journaling

  desktop ,       
         . , 
      sysinstall  
:  desktop      /var,  
       /usr,  
          
  .
    (   
 Disklabel    A),     .
        journaling,
       .    /usr
  ,          
       journaling.
  ,     80 GB.  
        
 Disklabel   :
           , 
           journaling. 
           
  /usr    D    .
,            
 ,   C         /usr. 
         1 GB (   
 journaling   /usr),   2 GB (   
 journaling   /usr    /var).    
,      (file system)  
/usr     (mount point).

     :    journaling   /var
     partition; ,  journaling     
      .      
        journaling  /var.    
          (    
        dekstop )     
             .
       ,    journaling   /usr
        /var.       
         .

  ,   ,  ,   
sysinstall         
journaling. ,     ,  sysinstall 
         . 
 ,        ,  
    .     
 ,   .
        sysinstall,   
    swap.  swap    ,   
sysinstall         
.    ,      
 /etc/fstab       swap 
   .
     swap,      
            
 Disklabel,         
. ,  N,     (1024M),  
swap space     .     
  .   ,   
       /usr  /var.  
    :
     ,    
              
 .           
   .       
   :
 1.   
 _______________________________________
||_||
|ad0s1d___|/var______________|ad0s1h____|
|ad0s1f___|/usr______________|ad0s1g____|

    .     
  ()      
journaling.
-------------------------------------------------------------------------------

3.2  

     ,      
/etc/fstab         swap  
  . ,     
 swap     b (.. ad0s1b   ).
       swap    
,     FreeBSD   .
    ,      
journaling.
-------------------------------------------------------------------------------

4   Journaling


4.1    gjournal

     ,    
  journaling.        , 
       root  :

  # shutdown now

 Enter      .   
        journaling, 
   /usr  /var:

  # umount /usr /var

         journaling:

  # gjournal load

         
   .   ,  /usr  
ad0s1f        ad0s1g,   /var   ad0s1d
       ad0s1h.     :

  # gjournal label ad0s1f ad0s1g

  GEOM_JOURNAL: Journal 2948326772: ad0s1f contains data.
  GEOM_JOURNAL: Journal 2948326772: ad0s1g contains journal.

  # gjournal label ad0s1d ad0s1h

  GEOM_JOURNAL: Journal 3193218002: ad0s1d contains data.
  GEOM_JOURNAL: Journal 3193218002: ad0s1h contains journal.


     :         
     ,   gjournal      . 
             -f 
            , ..:

       # gjournal label -f ad0s1d ad0s1h

          ,    
       .

      ,  ad0s1d.journal 
ad0s1f.journal.     /var  /usr  
  .    ,    
  journal      Soft Updates:

  # tunefs -J enable -n disable ad0s1d.journal

  tunefs: gjournal set
  tunefs: soft updates cleared

  # tunefs -J enable -n disable ad0s1f.journal

  tunefs: gjournal set
  tunefs: soft updates cleared

        
 (        async
  ):

  # mount -o async /dev/ad0s1d.journal /var
  # mount -o async /dev/ad0s1f.journal /usr

   /etc/fstab      
 /usr  /var:

  /dev/ad0s1f.journal     /usr            ufs     rw,async      2       2
  /dev/ad0s1d.journal     /var            ufs     rw,async      2       2


     :      ,
             
        .

,    /boot/loader.conf    
      gjournal(8)   :

  geom_journal_load="YES"

!        journaling.  
 exit       ( ) 
     ()     
.   ,      :

  ad0: 76293MB XEC XE800JD-00HBC0 08.02D08 at ata0-master SATA150
  GEOM_JOURNAL: Journal 2948326772: ad0s1g contains journal.
  GEOM_JOURNAL: Journal 3193218002: ad0s1h contains journal.
  GEOM_JOURNAL: Journal 3193218002: ad0s1d contains data.
  GEOM_JOURNAL: Journal ad0s1d clean.
  GEOM_JOURNAL: Journal 2948326772: ad0s1f contains data.
  GEOM_JOURNAL: Journal ad0s1f clean.

          :

  GEOM_JOURNAL: Journal ad0s1d consistent.

     gjournal(8)    
         .
-------------------------------------------------------------------------------

4.2   Journaling   

          journaling
     ,     
   .   ,    
          .  ,
           
/dev/ad1s1d.         
:

  # gjournal label ad1s1d

      1 GB.    
    -s.      bytes, 
         K, M  G    Kilobytes,
Megabytes  Gigabytes .     gjournal,   
         
.
 ,       2 GB,  
   :

  # gjournal label -s 2G ad1s1d

          , 
    journaling,    -J:

  # newfs -J /dev/ad1s1d.journal

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

4.3   Journaling   

      geom_journal  ,   
      .   
  ,       
:

  options UFS_GJOURNAL # :      GENERIC

  options GEOM_JOURNAL #       

        
____FreeBSD.
       load    /
boot/loader.conf     .
-------------------------------------------------------------------------------

5  

          
     jounaling.


  5.1. ______,_____
  kernel_panic.________journaling;

  5.2. ____,______
  ___._____;

  5.3. ____journaling______
  ___Soft_Updates;

5.1.      ,     
kernel panic.        journaling;
          
     .        
        ,   
  .        , 
       .  
    __Journaling.
5.2.    ,       
  .     ;
    (   )    /boot/
loader.conf,       /etc/fstab.    
 .  Enter      
  .      :

  # cat /boot/loader.conf

       geom_journal_load,  
   .      ,
    ,      
:

  # gjournal load

  GEOM_JOURNAL: Journal 2948326772: ad0s1g contains journal.
  GEOM_JOURNAL: Journal 3193218002: ad0s1h contains journal.
  GEOM_JOURNAL: Journal 3193218002: ad0s1d contains data.
  GEOM_JOURNAL: Journal ad0s1d clean.
  GEOM_JOURNAL: Journal 2948326772: ad0s1f contains data.
  GEOM_JOURNAL: Journal ad0s1f clean.

  # mount -a
  # exit
  (  )

      ,      /etc/fstab.
         ,   . 
 ,        
 .
5.3.    journaling      
   Soft Updates;
.         .
         
,   .
  root      :

  # shutdown now

     journaling:

  # umount /usr /var

  :

  # gjournal sync

   :

  # gjournal stop ad0s1d.journal
  # gjournal stop ad0s1f.journal

  metadata  journaling      :

  # gjournal clear ad0s1d
  # gjournal clear ad0s1f
  # gjournal clear ad0s1g
  # gjournal clear ad0s1h

    journaling,       Soft
Updates:

  # tunefs -J disable -n enable ad0s1d

  tunefs: gjournal cleared
  tunefs: soft updates set

  # tunefs-J disable -n enable ad0s1f

  tunefs: gjournal cleared
  tunefs: soft updates set

    :

  # mount -o rw /dev/ad0s1d  /var
  # mount -o rw /dev/ad0s1f  /usr

  /etc/fstab     :

  /dev/ad0s1f     /usr            ufs     rw      2       2
  /dev/ad0s1d     /var            ufs     rw      2       2

,    /boot/loader.conf,    
   geom_journal     .
-------------------------------------------------------------------------------

6  

 journaling       FreeBSD,    
  .        
:

*   ____journaling    FreeBSD.
* __   freebsd-current     gjournal
  (8), Pawel Jakub Dawidek <pjd@FreeBSD.org>.
* __   freebsd-questions   Ivan Voras
  <ivoras@FreeBSD.org>.
*   manual  gjournal(8)  geom(8).

-------------------------------------------------------------------------------
  ,   ,     ftp://ftp.FreeBSD.org/
                               pub/FreeBSD/doc/.
          FreeBSD,     
                   <questions@FreeBSD.org>.
             ,  e-mail 
                              <doc@FreeBSD.org>.
