Changes

From SME Server
Jump to navigationJump to search
Line 8: Line 8:  
See also: [[Hard Disk Partitioning]] and [[Raid#Resynchronising_a_Failed_RAID]]
 
See also: [[Hard Disk Partitioning]] and [[Raid#Resynchronising_a_Failed_RAID]]
   −
== HowTo: Manage/Check a RAID1 Array from the command Line ==
+
==HowTo: Manage/Check a RAID1 Array from the command Line==
=== What is the Status of the Array ===
+
===What is the Status of the Array===
    
  [root@ ~]# '''cat /proc/mdstat'''
 
  [root@ ~]# '''cat /proc/mdstat'''
Line 21: Line 21:  
  unused devices: <none>
 
  unused devices: <none>
   −
== HowTo: Reinstate a disk from the RAID1 Array with the command Line ==
+
==HowTo: Reinstate a disk from the RAID1 Array with the command Line==
   −
=== Look at the mdstat ===
+
===Look at the mdstat===
    
First we must determine which drive is in default.
 
First we must determine which drive is in default.
Line 44: Line 44:  
{{note box|As we can see the partition sdb2 is in default, we can see the flag: sdb2 [2] (F). We need to resynchronize the disk sdb to the existing array md2.}}
 
{{note box|As we can see the partition sdb2 is in default, we can see the flag: sdb2 [2] (F). We need to resynchronize the disk sdb to the existing array md2.}}
   −
=== Fail and remove the disk, '''sdb''' in this case ===
+
===Fail and remove the disk, '''sdb''' in this case===
    
mdadm: set /dev/sdb2 faulty in /dev/md2
 
mdadm: set /dev/sdb2 faulty in /dev/md2
Line 58: Line 58:  
  [root@ ~]# '''mdadm --manage /dev/md1 --remove /dev/sdb1'''
 
  [root@ ~]# '''mdadm --manage /dev/md1 --remove /dev/sdb1'''
   −
=== Do your Disk Maintenance here ===
+
===Do your Disk Maintenance here===
    
At this point the disk is idle.
 
At this point the disk is idle.
Line 89: Line 89:  
You can refer to this page for more information how activate or understand the Analysis and Reporting Technology (SMART) [[Monitor_Disk_Health]]
 
You can refer to this page for more information how activate or understand the Analysis and Reporting Technology (SMART) [[Monitor_Disk_Health]]
   −
{{Note box|if you need to change the disk due to physical failure found by the smartctl command, install a new disk of the same capacity (or more) and enter the following commands to recreate new partitions by copying them from healthy disk sda.}}
+
{{Note box|if you need to change the disk due to physical failure found by the smartctl command, install a new disk of the same capacity (or more) and enter the following commands to recreate new partitions by copying them from healthy disk sda.}}<!-- Do NOT try to use sfdisk on disks llarger than 2 TiB, use gdisk or similar, see below. -->
    
  [root@ ~]# '''sfdisk -d /dev/sda > sfdisk_sda.output'''
 
  [root@ ~]# '''sfdisk -d /dev/sda > sfdisk_sda.output'''
Line 109: Line 109:  
If you want to reinstate the same disk without replacing it, go to the next step.
 
If you want to reinstate the same disk without replacing it, go to the next step.
   −
=== Add the partitions back ===
+
===Add the partitions back===
    
mdadm: hot added /dev/sdb1
 
mdadm: hot added /dev/sdb1
Line 117: Line 117:  
  [root@ ~]# '''mdadm --manage /dev/md2 --add /dev/sdb2'''
 
  [root@ ~]# '''mdadm --manage /dev/md2 --add /dev/sdb2'''
   −
=== Another Look at the mdstat ===
+
===Another Look at the mdstat===
    
  [root@sme8-64-dev ~]# cat /proc/mdstat
 
  [root@sme8-64-dev ~]# cat /proc/mdstat
Line 132: Line 132:  
{{note box|with a new disk it may be worthwhile to reinstall grub to avoid problems on startup error. The grub is the program that allows you to launch the operating systems. Please enter the following commands. }}
 
{{note box|with a new disk it may be worthwhile to reinstall grub to avoid problems on startup error. The grub is the program that allows you to launch the operating systems. Please enter the following commands. }}
   −
== HowTo: Write the GRUB boot sector ==
+
==HowTo: Write the GRUB boot sector==
    
{{Warning box|as the dd command is named "data destroyer" you need to be extremely prudent and sure of the name of source partition and/or destination. At first you should skip the dd command, Step 1 below, and attempt to install grub without it, see Step 2 below. If grub can be installed without using dd, then Step 1 can be discarded. }}
 
{{Warning box|as the dd command is named "data destroyer" you need to be extremely prudent and sure of the name of source partition and/or destination. At first you should skip the dd command, Step 1 below, and attempt to install grub without it, see Step 2 below. If grub can be installed without using dd, then Step 1 can be discarded. }}
    
*1.dd
 
*1.dd
 +
 
  [root@ ~]# '''dd if=/dev/sda1 of=/dev/sdb1'''
 
  [root@ ~]# '''dd if=/dev/sda1 of=/dev/sdb1'''
 +
 
*2.grub
 
*2.grub
 +
 
  [root@ ~]# '''grub'''
 
  [root@ ~]# '''grub'''
 
   
 
   

Navigation menu