Installera hårddiskar på server
Revision:2020-09-04

Identifiering av disk

  1. fdisk -l

  2. /dev/sdb
  3. Formatera disken i GUI
  4. Du kan även i GUI monter diskten(lättast)
  5. Visa UUID för partition på skivminne:
  6. blkid /dev/sdb1
  7. /dev/sdb1: LABEL="/disk41" UUID="afff8c93-9bf9-490c-8ae9-c9f60de82014" SEC_TYPE="ext2" TYPE="ext3"

Monteringspunkt

  1. mkdir /disk2
  2. mount /dev/sdb1 /disk2

Permanent montering vid uppstart

  1. vi /etc/fstab
    • Första fältet: UUID=8547f099-f72c-4468-834a-f762d6ccff42
    • Andra fältet: Monteringspunkt
    • Tredje fältet: Typ av filsystem

      Visa vilka filsystem som finns:

      cat /proc/filesystems

      ext3 ext2 ext4

      ext4 kan hantera större filer än ext3

    • Fjärde fältet: Mount options, kommaseparerade fält

      defaults: use default options: rw, suid, dev, exec, auto, nouser, and async

    • Femte fältet:

      This field is used for these filesystems by the dump(8) command to determine which filesystems need to be dumped. If the fifth field is not present, a value of zero is returned and dump will assume that the filesystem does not need to be dumped.

      Ange värde 1

    • Sjätte fältet:

      This field is used by the fsck(8) program to determine the order in which filesystem checks are done at reboot time. The root filesystem should be specified with a fs_passno of 1, and other filesystems should have a fs_passno of 2. Filesystems within a drive will be checked sequentially, but filesystems on different drives will be checked at the same time to utilize parallelism available in the hardware. If the sixth field is not present or zero, a value of zero is returned and fsck will assume that the filesystem does not need to be checked.

      Ange värde 2

    Exempel:
    												#
    # /etc/fstab
    # Created by anaconda on Wed Mar  2 18:29:26 2011
    #
    # Accessible filesystems, by reference, are maintained under '/dev/disk'
    # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
    #
    UUID=f10baa36-8b5a-45c6-b322-abce2d2926bd /                       ext4    defaults        1 1
    UUID=13f1510b-7c2b-40b0-b9ac-ba996e599caf /disk2                  ext4    defaults        1 2
    UUID=b695f4e2-484a-49c5-a885-0bbfa619d233 /disk3                  ext4    defaults        1 2
    UUID=ad0ccd7c-c6e7-4c55-b7f7-bd6a6ca58a96 /disk4                  ext4    defaults        1 2
    UUID=c2339e45-f1b0-4d77-b4ed-d47a1d097e96 /home                   ext4    defaults        1 2
    UUID=df8df047-cb7c-4ab5-90c3-4af4d0896a76 /tmp                    ext4    defaults        1 2
    UUID=db8b189e-f9ab-46d6-ac56-53bc90016b69 swap                    swap    defaults        0 0
    tmpfs                   /dev/shm                tmpfs   defaults        0 0
    devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
    sysfs                   /sys                    sysfs   defaults        0 0
    proc                    /proc                   proc    defaults        0 0
    
                                                   

      Kommandon

      yum install iotop

      iotop

      yum install sysstat

      iostat -xd