1

I have server and there is one 1TB drive in it and I guess it's not running any raid, I'm thinking if it's possible to add another 1TB HDD and setup RAID1 somehow?(software raid1)

Server is running CentOS 6.4

Is it possible to do that? Would it occur any downtime, perhaps data loss? How simple is it?

  • You have one HDD in your server and it is running a RAID0? – Sven Jun 26 '13 at 12:27
  • It's difficult to comment on that without even knowing your partition table and partition usage. – Hauke Laging Jun 26 '13 at 13:34
  • @HaukeLaging That's actually irrelevant: making a RAID1 volume that covers the whole disk is independent of any partitioning. – Gilles 'SO- stop being evil' Jun 26 '13 at 23:30
  • [My answer](http://unix.stackexchange.com/questions/54960/how-to-set-up-disk-mirroring-in-ubuntu/55044#55044) on the duplicate question is tried and tested. Beware that as I write, the highest-scoring [answer](http://unix.stackexchange.com/questions/54960/how-to-set-up-disk-mirroring-in-ubuntu/54961#54961) has serious flaws and puts you at risk of losing data. – Gilles 'SO- stop being evil' Jun 26 '13 at 23:31
  • @Gilles That is correct but creates an ambiguous situation not easily understood by most people so that should not be recommended to everyone. Read: Not to somebody who asks such a question. – Hauke Laging Jun 26 '13 at 23:49

2 Answers2

1

If you are on a lvm install, it's more or less feasible and even easy, with the lvm tools suite. May be possible something mdadm if you use the classic partitioning scheme, but don't take that for granted.

Refer to this superuser and even this superuser question.

41754
  • 85
  • 1
  • 7
  • 19
0

In the simplest case where you have a separate physical device for booting (i.e. where kernel and initrd are loaded from), it is certainly possible with mdadm. If you need to just mirror an existing drive, and don't have a space there for mdadm's superblock, you have to use array which is rebuilt on every boot, and you'll have to take extra care to ensure data integrity and avoid unnecessary reimaging on every boot (see the --assume-clean option for mdadm). If you can create a RAID with superblock things get much easier down the road.

If you are booting from the very device you want to mirror, one of the options muight actually be adding one extra device (preferably a small SSD or even CompactFlash card attached via an ATA adapter), boot from that and use the 1TB drive for data solely (or for data and rootfs).

peterph
  • 30,520
  • 2
  • 69
  • 75