home       inleiding       sysadmin       services       links       bash       werk       nothing      

  1. swapfile
     
    166 lsblk
    167 sudo dd if=/dev/zero of=/swapfile bsize=1M count=1000
    168 man dd
    169 sudo dd if=/dev/zero of=/swapfile bs=1M count=1000
    170 ls /
    171 sudo mkswap /swapfile
    172 sudo swapon /swapfile
    173 sudo chmod 600 /swapfile
    174 sudo swapon /swapfile
    175 swapon -s
     
  2. entire copy of disk b to disk c
     
    176 fdisk /dev/sdb
    177 sudo fdisk /dev/sdb
    178 lsblk
    179 sudo mkfs.btrfs /dev/sdb1
    180 sudo mkfs.xfs /dev/sdb6
    181 sudo mkfs.ext4 /dev/sdb5
    182 lsblk -f
    183 sudo mkdir /devsdb1
    184 sudo mkdir /devsdb5
    185 sudo mkdir /devsdb6
    186 sudo mount /dev/sdb1 /devsdb1
    187 sudo mount /dev/sdb5 /devsdb5
    188 sudo mount /dev/sdb6 /devsdb6
    189 sudo touch /devsdb6/slash-volgens-marvy
    190 sudo touch /devsdb5/noel-gaapt
    191 sudo touch /devsdb1/sam-kijkt-bedenkelijk
    192 sudo init 6
    193 lsblk
    194 df
    195 dd if=/dev/sdb of=/dev/sdc bs=1M
    196 sudo dd if=/dev/sdb of=/dev/sdc bs=1M
    197 lsblk
    198 lsblk -f
    199 sudo mount /dev/sdc5 /devsdb5
    200 sudo mount /dev/sdc6 /devsdb6
    201 sudo mount /dev/sdc1 /devsdb1
    202 ls /devsdb1
    203 ls /devsdb5
    204 ls /devsdb6
     
  3. safeguarding a bootsector
     
    205 dd if=/dev/sdc of=bootsector bs=1M count=1
    206 sudo dd if=/dev/sdc of=bootsector bs=1M count=1
    220 sudo dd if=/dev/zero of=/dev/sdc bs=1M count=1
    221 sudo hexedit /dev/sdc
    222 sudo dd if=/dev/random of=/dev/sdc bs=1M count=1
    223 lsblk
    224 sudo dd of=/dev/sdc if=bootsector bs=1M count=1
    225 lsblk
    226 dd if=/dev/random of=/dev/pts/1 bs=1 count=1M
    227 history
     
  4. copy ssd to ssd
     
    terminal 1: $ sudo dd if=/dev/sdb of=/dev/sda bs=1G
    terminal 2: $ watch -n600 sudo kill -USR1 $(pgrep ^dd$)
     
    Every 600.0s: **sudo kill -USR1 $(pgrep ^dd$)**
     
    na 15 min: (202 GB, 188 GiB) copied, 875.616 s, 231 MB/s
    na 90 min: (912 GB, 849 GiB) copied, 5181.38 s, 176 MB/s
    na 100 min: (1.0 TB, 941 GiB) copied, 5778.7 s, 175 MB/s
    enzoverder: (1.1 TB, 1.0 TiB) copied, 6382.23 s, 174 MB/s
     
    400 min voor 4TB --> nog 5 uur >> klaar om 23h45
     
    Begonnen om 17uur
     
    1 Gbyte elke 6 seconden = 166 MByte per seconde >> 1.5 Gbit/s
    10 Gbyte per minuut
    100 Gbyte elke 10 minuten
    600 Gbyte per uur
    2400 GByte per 4 uur
    4 TeraByte per 6u40min