Changes

Jump to navigation Jump to search
866 bytes added ,  21:04, 11 February 2019
spello
Line 6: Line 6:  
But with the best laid plans things don't always go according to plan, these are the processes required to do it manually.
 
But with the best laid plans things don't always go according to plan, these are the processes required to do it manually.
   −
See also: [[Hard Disk Partitioning]]  
+
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 ==
Line 84: Line 84:  
  [root@ ~]# '''smartctl -l selftest /dev/sdb'''
 
  [root@ ~]# '''smartctl -l selftest /dev/sdb'''
   −
You can refer to this page for more information to activate or to 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.}}
Line 90: Line 90:  
  [root@ ~]# '''sfdisk -d /dev/sda > sfdisk_sda.output'''
 
  [root@ ~]# '''sfdisk -d /dev/sda > sfdisk_sda.output'''
 
  [root@ ~]# '''sfdisk /dev/sdb < sfdisk_sda.output'''
 
  [root@ ~]# '''sfdisk /dev/sdb < sfdisk_sda.output'''
 +
 +
GPT Disks
 +
 +
Larger disks will be GPT Disks, sfdisk will not work - you will need to use gdisk and partx (parted)
 +
[root@ ~]# '''yum install gdisk'''
 +
 +
The copy the partition table from a good disk to the new disk, the first line will copy the partition table from disk sda to sdd, the second will randomize the GUID
 +
[root@ ~]# '''sgdisk /dev/sda -R /dev/sdd'''
 +
[root@ ~]# '''sgdisk -G /dev/sdd'''
 +
 +
To view the partitions use partx
 +
[root@ ~]# '''partx -l /dev/sdd'''
 +
    
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.
Line 117: Line 130:  
== 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. }}
 +
 +
*1.dd
 
  [root@ ~]# '''dd if=/dev/sda1 of=/dev/sdb1'''
 
  [root@ ~]# '''dd if=/dev/sda1 of=/dev/sdb1'''
 
+
*2.grub
 
  [root@ ~]# '''grub'''
 
  [root@ ~]# '''grub'''
 
   
 
   
Line 127: Line 143:  
     completions of a device/filename.]
 
     completions of a device/filename.]
 
   
 
   
  grub> '''device (hd1) /dev/sdb'''
+
  grub> '''device (hd0) /dev/sdb'''
 
   
 
   
  grub> '''root (hd1,0)'''
+
  grub> '''root (hd0,0)'''
 
   Filesystem type is ext2fs, partition type 0xfd
 
   Filesystem type is ext2fs, partition type 0xfd
 
   
 
   
  grub> '''setup (hd1)'''
+
  grub> '''setup (hd0)'''
 
   Checking if "/boot/grub/stage1" exists... no
 
   Checking if "/boot/grub/stage1" exists... no
 
   Checking if "/grub/stage1" exists... yes
 
   Checking if "/grub/stage1" exists... yes
Line 139: Line 155:  
   Running "embed /grub/e2fs_stage1_5 (hd0)"...  16 sectors are embedded.
 
   Running "embed /grub/e2fs_stage1_5 (hd0)"...  16 sectors are embedded.
 
  succeeded
 
  succeeded
   Running "install /grub/stage1 (hd1) (hd1)1+16 p (hd1,0)/grub/stage2 /grub/grub.conf"... succeeded
+
   Running "install /grub/stage1 (hd0) (hd1)1+16 p (hd0,0)/grub/stage2 /grub/grub.conf"... succeeded
 
  Done.
 
  Done.
 
   
 
   
 
  grub> '''quit'''
 
  grub> '''quit'''
   −
 
+
<noinclude>
<noinclude>[[Category:Howto]][[Category:Administration:Storage]]</noinclude>
+
[[Category:Howto]]
 +
[[Category:Administration:Storage]]
 +
</noinclude>
88

edits

Navigation menu