forked from ungleich-public/cdist
		
	first remove lvm, then mdadm
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
		
					parent
					
						
							
								c1141453fe
							
						
					
				
			
			
				commit
				
					
						49dfcf4885
					
				
			
		
					 1 changed files with 6 additions and 6 deletions
				
			
		| 
						 | 
					@ -31,6 +31,12 @@ if find /sys/class/block/$disk_name*/holders/ -mindepth 1 | grep -q holders/dm;
 | 
				
			||||||
   fi
 | 
					   fi
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if command -v pvremove >/dev/null; then
 | 
				
			||||||
 | 
					   pvremove --force --force --yes "$disk" || true
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
					   echo "WARNING: pvremove command not found" >&2
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# stop mdadm raids if any
 | 
					# stop mdadm raids if any
 | 
				
			||||||
if [ -r /proc/mdstat ]; then
 | 
					if [ -r /proc/mdstat ]; then
 | 
				
			||||||
   md_name="\$(awk '/$disk_name/ {print \$1}' /proc/mdstat)"
 | 
					   md_name="\$(awk '/$disk_name/ {print \$1}' /proc/mdstat)"
 | 
				
			||||||
| 
						 | 
					@ -43,12 +49,6 @@ if [ -r /proc/mdstat ]; then
 | 
				
			||||||
      fi
 | 
					      fi
 | 
				
			||||||
   fi
 | 
					   fi
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					 | 
				
			||||||
if command -v pvremove >/dev/null; then
 | 
					 | 
				
			||||||
   pvremove --force --force --yes "$disk" || true
 | 
					 | 
				
			||||||
else
 | 
					 | 
				
			||||||
   echo "WARNING: pvremove command not found" >&2
 | 
					 | 
				
			||||||
fi
 | 
					 | 
				
			||||||
if command -v mdadm >/dev/null; then
 | 
					if command -v mdadm >/dev/null; then
 | 
				
			||||||
   mdadm --zero-superblock --force "$disk" || true
 | 
					   mdadm --zero-superblock --force "$disk" || true
 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue