[mythtv-users] RAID 1

Hika van den Hoven hikavdh at gmail.com
Fri Aug 29 15:33:02 UTC 2014


Hoi Daryl,

Friday, August 29, 2014, 4:46:23 PM, you wrote:

> Greetings Mythizens, I have a 250 (sda) with the OS on it and two
> terrabytes (sdc) with /var/lib/mythtv on it and (sdb) mount / ext 4.
> I found a ubuntu thread and I'm wondering if this is a good way for me to go:
>  


> Create the raid: (if your raid drives are sdb and sdc, and you've partitioned them)
>  mdadm --create /dev/md0 --level=mirror --raid-devices=2 /dev/sdb1 /dev/sdc1
>  
>  Append array details to mdadm.conf:
>  mdadm -Es | grep md0 >> /etc/mdadm/mdadm.conf
>  
>  After which the boot ramdisk should be updated:
>  update-initramfs -u
>  
>  Create the filesystem:
>  mkfs.ext4 /dev/md0
>  
>  Add it to /etc/fstab:
>  /dev/md0 /store ext4 defaults,nobootwait 0 2
>  
>  "/store", or whatever you use, must already exist as a directory.
> The  nobootwait is to prevent startup from halting if it can't mount
> it for  some reason. I also add "barrier=1,nodelalloc" to reduce
> risk of loss in  a crash at the cost of performance, and "noatime" to gain a small bit  back.
>  
>  Mount with "mount -a"
>  
>  Another option is to use LVM, which has some mirroring support on
> its  own, and it makes growing and moving volumes much easier, or
> you can use  it in combination with mdadm.

> I want to preserve the recordings on sdc and mirror them to sdb. 
> Instead of /store, I think mine is /storage.
>                         
If you want to preserve the recordings on /dev/sdc, you either have to
copy that first to a third drive or you have to follow a more
complicated route.

To start I always use --level=raid1 but I think it is the same as
mirror.
If you want to be able to boot from the raid array you have to make
sure to use the old metadata format 0.90 else you can use the current
default 1.2

To preserve the data on the sdc volume you have to create at first a
degraded array. This means a raid1 array with only a single volume.
You will get all kinds of warnings if you do this.
Then you can copy the data from sdc1 to md0, after wich you hot add the
second volume to the array.

 mdadm --create /dev/md0 --level=raid1 --raid-devices=2 /dev/sdb1
to create the degraded array

 mdadm /dev/md0 --add /dev/sdc1
to add the second volume

 cat /proc/mdstat shows you the state of all active arrays

Be sure when you partition the disks to set the ID to 'fd' instead of
the default '83'

LVM2 you can then use on top of the raid1 volume to flexible assign
space to several logical volumes or to combine more raid1 volumes to
one big one. I wouldn't use it for the mirroring.


Tot mails,
  Hika                            mailto:hikavdh at gmail.com

"Zonder hoop kun je niet leven
Zonder leven is er geen hoop
Het eeuwige dilemma
Zeker als je hoop moet vernietigen om te kunnen overleven!"

De lerende Mens



More information about the mythtv-users mailing list