How to set up RAID 1 (software, hardware or fake) on Ubuntu 12.04 desktop?
Ubuntu – How to set up RAID 1
diskdisk-managementraid
Related Solutions
Here are the steps needed to setup fakeraid and get relevant partitions auto-mounted:
Install the dmraid package:
sudo apt-get install dmraid
Reboot (this is because dmraid adds itself into initramfs)
The fakeraid device should appear e.g.:
$ ls /dev/mapper/* brw-rw---- 1 root disk 252, 0 Dec 6 16:21 /dev/mapper/isw_dhdhchcbaf_Dima brw------- 1 root root 252, 1 Dec 6 16:21 /dev/mapper/isw_dhdhchcbaf_Dima1 crw------- 1 root root 10, 236 Dec 6 16:22 /dev/mapper/control
Above,
*Dima
is the fakeraid device, while*Dima1
is the partition. If you don't have *N, you need to create a partition table, create a partition, format ot with a filesystem and reboot again.In Ubuntu, all partitions are mounted by UUID by default. Let's find out UUID:
$ sudo blkid [sudo] password for xnox: /dev/sda: TYPE="isw_raid_member" /dev/sdb: TYPE="isw_raid_member" /dev/mapper/isw_dhdhchcbaf_Dima1: UUID="92edd1fd-94c5-4617-b829-fa4a8378b7ae" TYPE="ext4" /dev/sdc1: UUID="A904-D2E7" TYPE="vfat" /dev/sdc2: UUID="6669d411-80c3-41cc-a629-ad84e1ee6854" TYPE="ext4" /dev/sdc3: UUID="2bf263f1-753f-4b2e-92a6-b00381515e0c" TYPE="swap" /dev/sdd1: UUID="C499-1A68" TYPE="vfat"
See that the wanted one is
UUID="92edd1fd-94c5-4617-b829-fa4a8378b7ae"
Therefore the
/etc/fstab
entry would be:UUID="92edd1fd-94c5-4617-b829-fa4a8378b7ae" /srv/dima ext4 defaults 0 0
So, run installation of Ubuntu 12.04.1 x64 LTS using alternate CD.
During the installation I selected manual partitioning and to:
- Use and Format / (root)
- Use and Format SWAP
- Use and Keep data on /home
- Use and Keep data on /data
After I clicked "Continue" I get error creating and formatting SWAP partition.
I go to terminal with Alt + F2 (?) and hit enter.
I discovered that there was visible RAID as only disk with NO partitions.
Something like this:arek@domek:/var/log/installer$ ls -l /dev/mapper/ lrwxrwxrwx 1 root root 7 Oct 7 20:17 /dev/mapper/pdc_jhjbcaha -> ../dm-0
arek@domek:/var/log/installer$ ls -l /dev/dm* brw-rw---- 1 root disk 252, 0 Oct 7 20:17 /dev/dm-0
So I switched to log console Alt+F3 (?) and saw errors like below:Oct 7 14:02:45 check-missing-firmware: /dev/.udev/firmware-missing does not exist, skipping Oct 7 14:02:45 check-missing-firmware: /run/udev/firmware-missing does not exist, skipping Oct 7 14:02:45 check-missing-firmware: no missing firmware in /dev/.udev/firmware-missing /run/udev/firmware-missing Oct 7 14:02:45 anna-install: Installing dmraid-udeb Oct 7 14:02:45 anna[12599]: DEBUG: retrieving dmraid-udeb 1.0.0.rc16-4.1ubuntu8 Oct 7 14:02:49 anna[12599]: DEBUG: retrieving libdmraid1.0.0.rc16-udeb 1.0.0.rc16-4.1ubuntu8 Oct 7 14:02:49 anna[12599]: DEBUG: retrieving kpartx-udeb 0.4.9-3ubuntu5 Oct 7 14:02:49 disk-detect: Serial ATA RAID disk(s) detected. Oct 7 14:02:55 disk-detect: Enabling dmraid support. Oct 7 14:02:55 disk-detect: RAID set "pdc_jhjbcaha" was activated Oct 7 14:02:55 HERE --> dmraid-activate: ERROR: Cannot retrieve RAID set information for pdc_jhjbcaha Oct 7 14:02:56 check-missing-firmware: /dev/.udev/firmware-missing does not exist, skipping Oct 7 14:02:56 check-missing-firmware: /run/udev/firmware-missing does not exist, skipping Oct 7 14:02:56 check-missing-firmware: no missing firmware in /dev/.udev/firmware-missing /run/udev/firmware-missing Oct 7 14:02:57 main-menu[428]: DEBUG: resolver (libnewt0.52): package doesn't exist (ignored) Oct 7 14:02:57 main-menu[428]: DEBUG: resolver (ext2-modules): package doesn't exist (ignored) Oct 7 14:02:57 main-menu[428]: INFO: Menu item 'partman-base' selected Oct 7 14:02:57 kernel: [ 316.512999] NTFS driver 2.1.30 [Flags: R/O MODULE]. Oct 7 14:02:57 kernel: [ 316.523221] Btrfs loaded Oct 7 14:02:57 kernel: [ 316.534781] JFS: nTxBlock = 8192, nTxLock = 65536 Oct 7 14:02:57 kernel: [ 316.554749] SGI XFS with ACLs, security attributes, realtime, large block/inode numbers, no debug enabled Oct 7 14:02:57 kernel: [ 316.555336] SGI XFS Quota Management subsystem Oct 7 14:02:58 md-devices: mdadm: No arrays found in config file or automatically Oct 7 14:02:58 partman: No matching physical volumes found Oct 7 14:02:58 partman: No volume groups found Oct 7 14:02:58 partman: Reading all physical volumes. This may take a while... Oct 7 14:02:58 partman-lvm: No volume groups found Oct 7 14:02:58 partman: Error running 'tune2fs -l /dev/mapper/pdc_jhjbcaha' Oct 7 14:02:58 partman: Error running 'tune2fs -l /dev/mapper/pdc_jhjbcaha' Oct 7 14:02:58 partman: Error running 'tune2fs -l /dev/mapper/pdc_jhjbcaha' Oct 7 14:06:11 HERE --> partman: mkswap: can't open '/dev/mapper/pdc_jhjbcaha2': No such file or directory Oct 7 14:07:28 init: starting pid 401, tty '/dev/tty2': '-/bin/sh' Oct 7 14:15:00 net/hw-detect.hotplug: Detected hotpluggable network interface eth0 Oct 7 14:15:00 net/hw-detect.hotplug: Detected hotpluggable network interface lo
As You can see there are 2 errorsOct 7 14:02:55 dmraid-activate: ERROR: Cannot retrieve RAID set information for pdc_jhjbcaha
andOct 7 14:06:11 partman: mkswap: can't open '/dev/mapper/pdc_jhjbcaha2': No such file or directory
I looked in the internet and try to run command "dmraid -ay" and get something like that:
dmraid -ay /dev/mapper/pdc_jhjbcaha -> Already activated /dev/mapper/pdc_jhjbcaha1 -> Successfully activated /dev/mapper/pdc_jhjbcaha2 -> Successfully activated /dev/mapper/pdc_jhjbcaha3 -> Successfully activated /dev/mapper/pdc_jhjbcaha4 -> Successfully activated /dev/mapper/pdc_jhjbcaha5 -> Successfully activated /dev/mapper/pdc_jhjbcaha6 -> Successfully activated
Then I returned to installer with Alt+F1 (?) and click "Return" to return to partitioning menu. I did NOT change anything just selected again "Continue" and everything goes smoothly.
I hope this will help someone.
arkadius
Best Answer
RAID 1 is mirroring; where data is duplicated on two different drives using either a hardware RAID controller or software (via the operating system). If either drive fails, the other continues to function as a single drive until the failed drive is replaced.
First thing that needs to be done is to install mdadm. To do so
Just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command below.
Or use USC
Once that is done,
Just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command below.
--create
creates a new RAID deviceand follow the instructions