22.4 Convert Ext2 to Ext3

Converting from a standard ext2 disk format to a journalled ext3 format is easy, since it simply involves adding a journal file. It can be done while the system is running with:

  # tune2fs -j /dev/hda1

Then change ext2 to ext3 in /etc/fstab and unmount/mount for it to take effect. If /dev/hda1 is your root partition, then you’ll need to reboot for it to take effect.

22.4.1 Disk Performance

Various parameters of a hard disk can be set using hdparm. This is required sometimes when you notice your system becoming sluggish everytime the hard disks are accessed (see Section 22.4.1). The same process can help with access to CDs and DVDs when, for example, you find that watching a DVD is very choppy (stop-and-start) (see Section 22.2).

After installing Debian on bach a serious performance hit was noticed every time the disks were busy. With the use of hdparm the hard disk parameters could be set. We ensure the parameters were set on each reboot by adding them to /etc/hdparm.conf.

Running hdparm with /dev/hda showed the current parameters:

  # hdparm /dev/hda

  /dev/hda:
   multcount    =  0 (off)
   I/O support  =  0 (default 16-bit)
   unmaskirq    =  0 (off)
   using_dma    =  0 (off)
   keepsettings =  0 (off)
   nowerr       =  0 (off)
   readonly     =  0 (off)
   readahead    =  8 (on)
   geometry     = 7297/255/63, sectors = 117231408, start = 0
   busstate     =  1 (on)

To test the current performance of a disk use the -Tt option:

  # hdparm -Tt /dev/hda

  /dev/hda:
   Timing buffer-cache reads:   128 MB in  0.55 seconds =232.73 MB/sec
   Timing buffered disk reads:  64 MB in 49.39 seconds =  1.30 MB/sec

For Bach the problem was fixed by turning on DMA (-d1), 16 multiple sectors (-m16), and 32 bit I/O support (-c1):

  # hdparm -d1 -m16 -c1 /dev/hda

The performance was then quite a bit better:

  # hdparm -Tt /dev/hda

  /dev/hda:
   Timing buffer-cache reads:   128 MB in  0.56 seconds =228.57 MB/sec
   Timing buffered disk reads:  64 MB in  1.60 seconds = 40.00 MB/sec

To get extra information about a disk drive use:

  # hdparm -i /dev/hda
  /dev/hda:

   Model=ST360021A, FwRev=3.19, SerialNo=3HR0VNYY
   Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs RotSpdTol>.5% }
   RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=4
   BuffType=unknown, BuffSize=2048kB, MaxMultSect=16, MultSect=16
   CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=117231408
   IORDY=on/off, tPIO={min:240,w/IORDY:120}, tDMA={min:120,rec:120}
   PIO modes: pio0 pio1 pio2 pio3 pio4 
   DMA modes: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 *udma5 
   AdvancedPM=no WriteCache=enabled
   Drive Supports : Reserved : ATA-1 ATA-2 ATA-3 ATA-4 ATA-5 

Be careful in changing the parameters of your disks as some settings may cause the disk to stop responding! This may require a hard reboot after which the default settings are returned. For example, on Bach an additional IDE controller (a CMD680 from Silicon Image) with 2 ST360021A disks was installed. These disks were identical to the disk on the PIIX4 IDE controller, but setting the parameter -d1 resulted in a hung shell on a test with -Tt.

To ensure new settings are saved for each reboot add the appropriate device entry to /etc/hdparm.conf.

Here are some timings for a number of disks — these have not needed hdparm tuning with current kernels:

Also see http://linux.oreillynet.com/pub/a/linux/2000/06/29/hdparm.html for further introductory explanations.



Your donation will support ongoing development and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2021 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0.