6
Tabla de Contenidos Introduction 1. Requirements 2. Installing Partitioning the disk 1. Configuring the RAID 2. Formatting 3. Boot Loader 4. Boot from Degraded Disk 5. 3. Test your RAID now! 4. Troubleshooting Swap space doesn't come up, error message in dmesg 1. 5. 1. Using mdadm Intro 1. Important initial facts Checking the status of your RAID 1. Disk Array Operation 2. 2. Resources 3. 2. Login to Edit Ubuntu Documentation > Community Documentation > InstallationSoftwareRAID InstallationSoftwareRAID Note: This page is about Ubuntu 9.10. It may not apply to newer versions anymore. How to create RAID using Ubuntu Software RAID. Including RAID 0, 1, 5 and 6. Since 9.10, Ubuntu provides a very easy way to build RAID. You can build a RAID system using the graphical Ubuntu user interface. It does not require using the command-line anymore. Note: Be aware of the fragile state of RAID support in Ubuntu and what it takes to get a reliable raid setup (https://wiki.ubuntu.com/ReliableRaid). However most of the bugs has been fixed since Ubuntu 8.10. Introduction RAID is a method of using multiple hard drives to act as one. There are two purposes of RAID: Expand drive capacity: RAID 0. If you have 2 x 500 GB HDD then total space become 1 TB Prevent data loss in case of drive failure: RAID 1, RAID 5, and RAID 6. You can combine RAID 0 to other RAID, e.g RAID 0 + 1 become RAID 10. There are three ways to create RAID: Software-RAID: Where the RAID is created by software. 1. Hardware-RAID: A special controller used to build RAID. Hardware RAID is generally faster, and does not place load on the CPU, and hardware RAID can be used with any OS 2. FakeRAID: Since RAID hardware is very expensive, many motherboard manufacturers use multi-channel controllers with special BIOS features to perform RAID. This is a form of software RAID using special drivers, and it is not necessarily faster than true software RAID. Read FakeRaidHowto for details. 3. The RAID software included with current versions of Linux (and Ubuntu) is based on the 'mdadm' driver and works very well. Requirements If you're building a server, the server install CD includes the necessary options. If you're building a desktop then you need the "Alternate" install CD for Ubuntu. Read Getting Ubuntu Alternate Install disk and How to do a Ubuntu Alternate Install How to Burn an ISO At least 2 hard drives, preferably same size After a successful install, you should also manually fix 2 shortcomings in the default configuration: Install GRUB boot-loader on second drive (this step is not necessary if you use Ubuntu 9.10 or a newer one, which uses Grub2) Update the startup script to detect a failed drive Installing Install Ubuntu until you get to partitioning the disks Installation/SoftwareRAID - Community Ubuntu Documentation https://help.ubuntu.com/community/Installation/SoftwareRAID 1 de 6 06/02/2012 09:29 p.m.

Installation_SoftwareRAID - Community Ubuntu Documentation

  • Upload
    dtrivi

  • View
    224

  • Download
    3

Embed Size (px)

DESCRIPTION

instalacion de sistema operativo

Citation preview

Page 1: Installation_SoftwareRAID - Community Ubuntu Documentation

Tabla de Contenidos

Introduction1.Requirements2.Installing

Partitioning the disk1.Configuring the RAID2.Formatting3.Boot Loader4.Boot from Degraded Disk5.

3.

Test your RAID now!4.Troubleshooting

Swap space doesn't come up,error message in dmesg

1.5.

1.

Using mdadmIntro1.Important initial facts

Checking the status of yourRAID

1.

Disk Array Operation2.

2.

Resources3.

2.

Login to Edit

Ubuntu Documentation > Community Documentation > InstallationSoftwareRAID

InstallationSoftwareRAID

Note: This page is about Ubuntu 9.10. It may not apply to newer versions anymore.

How to create RAID using Ubuntu Software RAID. Including RAID 0, 1, 5 and 6.

Since 9.10, Ubuntu provides a very easy way to build RAID. You can build a RAID system using the graphical Ubuntu userinterface. It does not require using the command-line anymore.

Note: Be aware of the fragile state of RAID support in Ubuntu and what it takes to get a reliable raid setup(https://wiki.ubuntu.com/ReliableRaid). However most of the bugs has been fixed since Ubuntu 8.10.

Introduction

RAID is a method of using multiple hard drives to act as one. There aretwo purposes of RAID:

Expand drive capacity: RAID 0. If you have 2 x 500 GB HDD thentotal space become 1 TBPrevent data loss in case of drive failure: RAID 1, RAID 5, andRAID 6. You can combine RAID 0 to other RAID, e.g RAID 0 + 1become RAID 10.

There are three ways to create RAID:

Software-RAID: Where the RAID is created by software.1.Hardware-RAID: A special controller used to build RAID.Hardware RAID is generally faster, and does not place load on theCPU, and hardware RAID can be used with any OS

2.

FakeRAID: Since RAID hardware is very expensive, manymotherboard manufacturers use multi-channel controllers withspecial BIOS features to perform RAID. This is a form of softwareRAID using special drivers, and it is not necessarily faster than truesoftware RAID. Read FakeRaidHowto for details.

3.

The RAID software included with current versions of Linux (and Ubuntu) is based on the 'mdadm' driver and works very well.

Requirements

If you're building a server, the server install CD includes the necessary options.

If you're building a desktop then you need the "Alternate" install CD for Ubuntu. Read Getting Ubuntu Alternate Installdisk and How to do a Ubuntu Alternate Install

How to Burn an ISO

At least 2 hard drives, preferably same size

After a successful install, you should also manually fix 2 shortcomings in the default configuration:

Install GRUB boot-loader on second drive (this step is not necessary if you use Ubuntu 9.10 or a newer one, which usesGrub2)Update the startup script to detect a failed drive

Installing

Install Ubuntu until you get to partitioning the disks

Installation/SoftwareRAID - Community Ubuntu Documentation https://help.ubuntu.com/community/Installation/SoftwareRAID

1 de 6 06/02/2012 09:29 p.m.

Page 2: Installation_SoftwareRAID - Community Ubuntu Documentation

Partitioning the disk

Warning: the /boot filesystem cannot use any softRAID level other than 1 with the stock Ubuntu bootloader. If you want touse some other RAID level for most things, you'll need to create separate partitions and make a RAID1 device for /boot.

Warning: this will remove all data on hard drives.

1. Select "Manual" as your partition method

2. Select your hard drive, and agree to "Create a new empty partition table on this device ?"

3. Select the "FREE SPACE" on the 1st drive then select "automatically partition the free space

Installation/SoftwareRAID - Community Ubuntu Documentation https://help.ubuntu.com/community/Installation/SoftwareRAID

2 de 6 06/02/2012 09:29 p.m.

Page 3: Installation_SoftwareRAID - Community Ubuntu Documentation

4. Ubuntu will create 2 partitions: / and swap, as shown below:

5. On / partition select "bootable flag" and set it to "on"

6. Repeat steps 2 to 5 for the other hard drive

As you see Ubuntu 9.10 makes RAID creation very easy. No need to define partition manually anymore! Ubuntu 9.10 also usesext4, the latest Linux file system type.

Configuring the RAID

Once you have completed your partitioning in the main "Partition Disks" page select "Configure Software RAID"1.Select "Yes"2.Select "Create new MD drive"3.Select RAID type: RAID 0, RAID 1, RAID 5 or RAID 64.Number of devices. RAID 0 and 1 need 2 drives. 3 for RAID 5 and 4 for RAID 6.5.Number of spare devices. Enter 0 if you have no spare drive.6.select which partitions to use. Generally they will be sda1 and sdb1 or hda1 or hdb1. Generally the numbers will matchand the different letters are for different hard drives.

7.

At this point the installation may become unresponsive; this is because the hard drives have already started thesynchronization process. Repeat steps 3 to 7 with each pair of partitions you have created.

8.

Once done, select finish.9.

Formatting

Installation/SoftwareRAID - Community Ubuntu Documentation https://help.ubuntu.com/community/Installation/SoftwareRAID

3 de 6 06/02/2012 09:29 p.m.

Page 4: Installation_SoftwareRAID - Community Ubuntu Documentation

Ubuntu 9.10 will automatically format your partitions.

Boot Loader

There are several problems reported by previous version of Ubuntu. But Ubuntu 9.10 already fixes them. In case your next HDDwon't boot then simply install Grub to another drive. Examples ...

grub-install /dev/sdb

grub-install /dev/sdc

Boot from Degraded Disk

If the default HDD fails then RAID will ask you to boot from degraded disk. If your server is located in a remote area, the bestpractice may be to configure this to occur automatically. Since Ubuntu 8.10 there is a new feature to boot automatically ifdefault RAID disk fail. Simply:

edit /etc/initramfs-tools/conf.d/mdadm1.change "BOOT_DEGRADED=false" to "BOOT_DEGRADED=true"2.

NB:

Additionally, this can be specified on the kernel boot line with the bootdegraded=[true|false]You also can use #dpkg-reconfigure mdadm rather than CLI!

Test your RAID now!

It should go without saying that TESTING if your RAID configuration is necessary! Simply follow these step to test yourRAID:

shut-down your server1.remove the power and cable data of your first drive2.start your server and see if your server can boot from degraded disk!3.???? What's the command to switch back from degraded mode once you do this (very necessary) test? {edit} perhaps this?change "BOOT_DEGRADED=true" to "BOOT_DEGRADED=false"

4.

Troubleshooting

Swap space doesn't come up, error message in dmesg

Provided the RAID is working fine this can be fixed with

sudo update-initramfs -k all -u

Using mdadm

Intro

For those that want full control over the RAID configuration, mdadm may be a better way than using the menus.

Important initial facts

Before starting, be aware of the different metadata formats available. The default (at least on Lucid) is 0.90, which allowscompatibility with most grub versions, but won't accept > 28 drives, nor drives >2TB.

Checking the status of your RAID

Two useful commands to check the status are:

cat /proc/mdstat

This 'should' show output something similar to

Installation/SoftwareRAID - Community Ubuntu Documentation https://help.ubuntu.com/community/Installation/SoftwareRAID

4 de 6 06/02/2012 09:29 p.m.

Page 5: Installation_SoftwareRAID - Community Ubuntu Documentation

Personalities : [raid1] [raid6] [raid5] [raid4]md5 : active raid1 sda7[0] sdb7[1] 62685504 blocks [2/2] [UU]

md0 : active raid1 sda1[0] sdb1[1] 256896 blocks [2/2] [UU]

md6 : active raid5 sdc1[0] sde1[2] sdd1[1] 976767872 blocks level 5, 64k chunk, algorithm 2 [3/3] [UUU]

From this information you can see that the available personalities on this machine are "raid1, raid6, raid4, and raid5" whichmeans this machine is set-up to use raid devices configured in a raid1, raid6, raid4 and raid5 configuration.

You can also see in the three example meta devices that there are two raid 1 mirrored meta devices. These are md0 and md5.You can see that md5 is a raid1 array and made up of disk /dev/sda partition 7, and /dev/sdb partition 7, containing 62685504blocks, with 2 out of 2 disks available and both in sync.

The same can be said of md0 only it is smaller (you can see from the blocks parameter) and is made up of /dev/sda1 and/dev/sdb1.

md6 is different in that we can see it is a raid 5 array, striped across 3 disks. These are /dev/sdc1, /dev/sde1 and /dev/sdd1, with a64k "chunk" size which is basically a "write" size. Algorithm 2 shows it is a write algorithm patern 2 which is "left disk to rightdisk" writing across the array. You can see that all 3 disks are present and in sync.

sudo mdadm --query --detail /dev/md*

but replace the * with the partition number.

Disk Array Operation

Note: You can add, remove disks or set them as faulty without stopping an array.

1. To stop an array, type:

sudo mdadm --stop /dev/md0

Where /dev/md0 is the array device.

2. To remove a Disk from an Array

sudo mdadm --remove /dev/md0 /dev/sda1

Where /dev/md0 is the array device and /dev/sda is the faulty disk.

3. Add a Disk to an Array

sudo mdadm --add /dev/md0 /dev/sda1

Where /dev/md0 is the array device and /dev/sda is the new disk. Note: This is not the same as "growing" the array!

4. Start an Array, to reassemble (start) an array that was previously created:

mdadm --assemble --scan

Mdadm will scan for defined arrays and start assembling it.

5. To track the status of the array as it gets started

cat /proc/mdstat

Resources

http://ubuntuforums.org/showthread.php?t=408461

http://man-wiki.net/index.php/8:mdadm

https://wiki.ubuntu.com/HotplugRaid Keeping your data synced and mirrored on external drives.

Installation/SoftwareRAID - Community Ubuntu Documentation https://help.ubuntu.com/community/Installation/SoftwareRAID

5 de 6 06/02/2012 09:29 p.m.

Page 6: Installation_SoftwareRAID - Community Ubuntu Documentation

http://en.wikipedia.org/wiki/RAID

http://en.wikipedia.org/wiki/Mdadm

Installation/SoftwareRAID (última edición 2011-12-21 13:15:14 efectuada por albertpool @ dsl-083-247-076-047.solcon.nl[83.247.76.47]:albertpool)

Parent PagePage History

Installation/SoftwareRAID - Community Ubuntu Documentation https://help.ubuntu.com/community/Installation/SoftwareRAID

6 de 6 06/02/2012 09:29 p.m.