[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RE: RAID b/w GPT and NON GPT partition.



Hi,

> Date: Mon, 29 Jun 2015 14:52:32 +0500 
> From: sirtcp@gmail.com 
>  
> I have been using RAID1 b/w  two 1.5 TB  drives which worked great with  
> fdisk. now one of the drive is failed and there is no more 1.5 TB  
> available in the market. the least available drive is 2TB. Which means  
> "fdisk 2TB issue". 

Not necessarily, the MBR partition format can handle addresses up to
2TiB. A new 2TB disk is almost certainly 2TB, so you should be fine
with MBR partitioning.


> in old times i could use sfdisk command to copy partition table now  
> since the new drive is 2TB my question is can i use sfdisk on 2TB  
> drive.? i think this will not work since old drive is non GPT which  
> means copying non GPT partition to a drive supports only GPT will not  
> work. 

Just to be sure: MBR and GPT are on-disk layouts, there is no such
thing as a non-GPT drive. You can use MBR partitioning on a drive
larger than 2TiB (though not recommended for obvious reasons), and you
can use GPT partitioning on a small drive as well. Even my 128GB ssd
uses GPT partitioning.

If you really want to use GPT partitioning, you can either use sfdisk
to duplicate the partition table and then use any gpt-aware partitioner
to convert the layout to GPT, or you can use gdisk which can do both.


> - i want to copy my old drive (1.5TB) partition table (non GPT)  to new  
> 2TB partition table (GPT)? 

# gdisk /dev/sdOLD
menu options x, u to replicate (GPT) partition table to /dev/sdNEW
# gdisk /dev/sdNEW
review/resize/add partitions where needed


> - and then further want to replace the bad drive from mdadam?

NOTE: completely untested, please wait for others to correct me:

# mdadm --add /dev/mdX $new_partition

If the failed drive is already removed from the array, you can stop 
here. It should rebuild automatically. But if your drive is still
usable but on its way out (e.g. it just started creating bad sectors),
it may be safer to temporarily grow the array:

# mdadm --grow --raid-devices=3 /dev/mdX

This should start a resync from your old disk to the new. Let it
complete, and then remove the old disk:

# mdadm /dev/mdX --fail $old_partition --remove $old_partition
# mdadm --grow --raid-devices=2 /dev/mdX


Regards,
Arno

 		 	   		  

Reply to: