User Tools

Site Tools


computing:raid

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
computing:raid [2018/11/25 01:32] – external edit 127.0.0.1computing:raid [2019/04/10 08:55] oemb1905
Line 94: Line 94:
   mdadm --readwrite /dev/mdx [restart]   mdadm --readwrite /dev/mdx [restart]
      
-If a drive failsyou need to deactivate itactivate the replacement and then allow enough time for syncing.  That tutorial is next and will go below.  It centers around mdadm commands to deactivate the old driveand with sfdisk to create an identical partition table on the new device.  More later on that ...+Okaythe point of this is to combine RAID with pam_mount handlind the mounting of the crypt, and we also need ssh pubkey authentication.  But, without some tweaks, we would never be able to access the public keywhich is in the crypt on the server.  So, we need to move a copy of the public keys outside the crypt.  Here is how: 
 + 
 +  cp -a ~/.ssh/authorized_keys /opt/authorizedkeys 
 +  sudo nano /etc/ssh/sshd_config 
 + 
 +Add the following parameter in the section that pertains to it: 
 + 
 +  AuthorizedKeysFile      /opt/authorized_keys 
 + 
 +Now, when you reboot, even if PasswordAuthentication and ChallengeResponse are set to "no," as long as PubKeyAuthentication is set to "yes" you will be able to do the following to mount the crypt.  This is because pam_mount is handling log in, and PAM is therefore allowing the password to be entered through the ssh tunnel because sshd_config also has Use PAM yes. 
 +   
 +  ssh user@xx.xx.xx.xx 
 +  screen 
 +  su - user 
 +  <authenticate> 
 + 
 +Nowpress ctrl-a-d to detach from the screen.   
 + 
 +  exit 
 + 
 +Okay, now you have survived reboot with a RAID array, with pam doing its magic for you on the crypt ... hardly a pain if it saves you       
 +a trip
  
 ------------------------------------------- -------------------------------------------
Line 105: Line 126:
   (draft) mdadm --readwrite /dev/mdx   (draft) mdadm --readwrite /dev/mdx
  
-AS you can see, still working on the tutorial for how to replace a drive on the RAID1 array once it does in fact fail, and additionally, how to create a RAID1 array on a running host.  For now, here are some good resources I found while gathering my thoughts and preparing my solutions and steps above for a good initial RAID1 set up for intermediate workstation needs.  Thanks to these guys who had great ideas:+When a hard drive failsfollow these steps with the machine still on (with failed drive as per SMART inside): 
 + 
 +  mdadm --manage /dev/md0 --fail /dev/sdi1 
 +  mdadm --manage /dev/md1 --fail /dev/sdi2 
 +  mdadm --manage /dev/md2 --fail /dev/sdi3 
 +  mdadm --manage /dev/md0 --remove /dev/sdi1 
 +  mdadm --manage /dev/md1 --remove /dev/sdi2 
 +  mdadm --manage /dev/md2 --remove /dev/sdi3 
 +  sudo poweroff 
 +  sfdisk -d /dev/sdj | sfdisk /dev/sdi 
 +  mdadm --manage /dev/md0 --add /dev/sdi1 
 +  mdadm --manage /dev/md1 --add /dev/sdi2 
 +  mdadm --manage /dev/md2 --add /dev/sdi3 
 +  dpkg-reconfigure -plow grub-pc 
 +  cat /proc/mdstat 
 + 
 +Let syncing finishthen reboot and run: 
 + 
 +  sudo grub-install /dev/sdX 
 +  sudo update-grub 
 +  sudo update-grub2 
 + 
 +Next up, how to create a RAID1 array on a running host 
 + 
 +-- -- -- -- -- 
  
-[[https://blog.sleeplessbeastie.eu/2013/10/04/how-to-configure-software-raid1-during-installation-process/]] +This tutorial is a designated "Invariant Section" of the "Technotronic" section of Haack's Wiki as described on the [[https://jonathanhaack.com/dokuwiki/doku.php?id=start|Start Page]].
-[[https://www.howtoforge.com/replacing_hard_disks_in_a_raid1_array]] +
-[[https://linuxgazette.net/140/pfeiffer.html]] +
-[[http://jasonwryan.com/blog/2012/02/11/lvm/]]+
  
- --- //[[netcmnd@jonathanhaack.com|oemb1905]] 2018/11/23 21:20//+ --- //[[netcmnd@jonathanhaack.com|oemb1905]] 2019/01/13 12:25//
  
computing/raid.txt · Last modified: 2021/04/03 02:40 by oemb1905