Guest User

Untitled

a guest
Oct 29th, 2018
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.95 KB | None | 0 0
  1. sudo aptitude install mdadm install lvm2 xfsprogs gsmartcontrol ssmtp
  2.  
  3. sudo gdisk /dev/sdb ( n 1 <Enter> <Enter> fd00 w )
  4.  
  5. # -p f2 means use far stripe locations to optimize for sequential read (multi GB sequence data)
  6. # missing here indicates that I intend to grow the array when the other two disks arrive
  7. sudo mdadm --create /dev/md0 --level=10 --name=ilmatar --raid-devices=4 -p f2 /dev/sdb1 missing /dev/sdc1 missing
  8.  
  9. sudo mdadm --detail --scan
  10.  
  11. #echo DEVICE /dev/sdb1 /dev/sdc1 /dev/sde1 /dev/sdf1 | sudo tee /etc/mdadm/mdadm.conf
  12. #sudo mdadm --detail --scan | sudo tee -a /etc/mdadm/mdadm.conf
  13. #lets do this manually:
  14. sudo nano /etc/mdadm/mdadm.conf
  15. -------------------------------------------------------------------------------
  16. # mdadm.conf
  17. #
  18. # Please refer to mdadm.conf(5) for information about this file.
  19. #
  20.  
  21. # by default (built-in), scan all partitions (/proc/partitions) and all
  22. # containers for MD superblocks. alternatively, specify devices to scan, using
  23. # wildcards if desired.
  24. #DEVICE partitions containers
  25. DEVICE /dev/sd[bcef]1
  26.  
  27. # auto-create devices with Debian standard permissions
  28. CREATE owner=root group=disk mode=0660 auto=yes
  29.  
  30. # automatically tag new arrays as belonging to the local system
  31. HOMEHOST <system>
  32.  
  33. # instruct the monitoring daemon where to send mail alerts
  34. MAILADDR root
  35.  
  36. # definitions of existing MD arrays
  37.  
  38. ARRAY /dev/md0 name=ilmatar:0 UUID=a341fae4:bd10b7b3:8f2fa2a3:b754fb39 metadata=1.2 level=10 num-devices=4 devices=/dev/sdb1,missing,/dev/sdc1,missing
  39.  
  40.  
  41. # This file was auto-generated on Tue, 25 Sep 2018 12:30:53 +0300
  42. # by mkconf $Id$
  43. -------------------------------------------------------------------------------
  44. # reboot to test auto-regeneration
  45. sudo mdadm --detail /dev/md0
  46.  
  47. # with a single large XFS device these don't really help us and really just complicate management
  48. #sudo pvcreate /dev/md0
  49. #sudo vgcreate mongodb /dev/md0
  50. #sudo lvcreate -L 100G -n data mongodb
  51. #sudo lvcreate -l 100%FREE -n log mongodb
  52.  
  53. sudo mkfs.xfs /dev/md0
  54. sudo mkdir /media/ilmatar
  55. sudo mount /dev/md0 /media/ilmatar
  56. sudo usermod -aG staff aubreybailey
  57. sudo chown -R root:staff /media/ilmatar/NGSRawData/
  58. sudo chmod 775 /media/ilmatar/NGSRawData/
  59.  
  60. sudo blkid /dev/md0
  61. sudo nano /etc/fstab
  62. -------------------------------------------------------------------------------
  63. UUID=dcab9074-ba55-4917-a488-6edccb7730a3 /media/ilmatar xfs errors=remount-ro 0 1
  64. -------------------------------------------------------------------------------
  65. #test before rebooting or you will be sorry!
  66. sudo mount -a
  67.  
  68.  
  69. -------Bonus "sleep well at night" security------------
  70. gsmartmoncontrol
  71.  
  72. sudo nano /etc/ssmtp/ssmtp.conf
  73. -------------------------------------------------------------------------------
  74. # Config file for sSMTP sendmail
  75. #
  76. # The person who gets all mail for userids < 1000
  77. # Make this empty to disable rewriting.
  78. root=postmaster
  79.  
  80. # The place where the mail goes. The actual machine name is required no
  81. # MX records are consulted. Commonly mailhosts are named mail.domain.com
  82. mailhub=smtp.gmail.com:587
  83.  
  84. AuthUser=aubrey.bailey@kct.fi
  85. AuthPass=TheGmailPassword
  86. UseSTARTTLS=YES
  87.  
  88. # Where will the mail seem to come from?
  89. #rewriteDomain=
  90.  
  91. # The full hostname
  92. hostname=ikuturso.kct.fi
  93.  
  94. # Are users allowed to set their own From: address?
  95. # YES - Allow the user to specify their own From: address
  96. # NO - Use the system generated From: address
  97. FromLineOverride=YES
  98. -------------------------------------------------------------------------------
  99.  
  100. sudo nano /etc/ssmtp/revaliases
  101. -------------------------------------------------------------------------------
  102. # sSMTP aliases
  103. #
  104. # Format: local_account:outgoing_address:mailhub
  105. #
  106. # Example: root:your_login@your.domain:mailhub.your.domain[:port]
  107. # where [:port] is an optional port number that defaults to 25.
  108. root:aubreybailey@kct.fi
  109. aubreybailey:aubreybailey@kct.fi
  110. postmaster:aubreybailey@kct.fi
  111.  
  112. -------------------------------------------------------------------------------
  113. revaliases: root aubrey.bailey@kct.fi
  114.  
  115. sudo mdadm --monitor --scan --test --oneshot
Add Comment
Please, Sign In to add comment