LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Partitioning for Raid 5 (https://www.linuxquestions.org/questions/linux-software-2/partitioning-for-raid-5-a-4175421135/)

Evocati 08-08-2012 11:07 PM

Partitioning for Raid 5
 
I'm having issues trying to partition 4x 1tb harddrives. I booted in to the usb linux, tried "Everything Else" and selected the drives individually to partition, but then it gives me an error. Since I already have a OS drive (80gb drive son /sde/sde1), I don't actually want to install ubuntu again.

I would prefer to do it in bash, but I can't seem to find a HOWTO with clear directions. Any suggestions?

chrism01 08-09-2012 12:17 AM

As root
Code:

cat /etc/*release*

df -h

# lowercase L option switch here
fdisk -l

That will get the basic info.
You'll want eg

1. background info concepts https://raid.wiki.kernel.org/index.php/Linux_Raid
2. HOWTO http://www.linuxhomenetworking.com/w...re_RAID#RAID_5

Evocati 08-09-2012 01:40 AM

at fdisk -l, this was the return:

Quote:

root@evocati-desktop:/home/evocati# fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/sda doesn't contain a valid partition table

[...]
This continues on with the other three disks.

Also:
Quote:

evocati@evocati-desktop:~$ sudo -H -s
[sudo] password for evocati:
root@evocati-desktop:/home/evocati# cat /etc/*release*
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04 LTS"
root@evocati-desktop:/home/evocati# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sde1 67G 3.5G 60G 6% /
udev 3.9G 4.0K 3.9G 1% /dev
tmpfs 1.6G 944K 1.6G 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 3.9G 76K 3.9G 1% /run/shm
[...]

Evocati 08-09-2012 09:49 AM

Quote:

root@evocati-desktop:/home/evocati# fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
81 heads, 63 sectors/track, 382818 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x96ba8f41

Device Boot Start End Blocks Id System
/dev/sda1 2048 1953525167 976761560 b W95 FAT32

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0009745c

Device Boot Start End Blocks Id System
/dev/sdb1 2048 1953523711 976760832 b W95 FAT32

Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00070991

Device Boot Start End Blocks Id System
/dev/sdc1 2048 1953523711 976760832 b W95 FAT32

Disk /dev/sdd: 1000.2 GB, 1000204886016 bytes
81 heads, 63 sectors/track, 382818 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0bbe68ef

Device Boot Start End Blocks Id System
/dev/sdd1 2048 1953525167 976761560 b W95 FAT32

Disk /dev/sde: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders, total 156301488 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000962e4

Device Boot Start End Blocks Id System
/dev/sde1 * 2048 139599871 69798912 83 Linux
/dev/sde2 139601918 156301311 8349697 5 Extended
/dev/sde5 139601920 156301311 8349696 82 Linux swap / Solaris
root@evocati-desktop:/home/evocati#
Got it. Thanks for your help! I was exhausted lastnight... and frustrated after 4 days.

Evocati 08-09-2012 09:45 PM

So I managed get everything partitioned, awesome, but now it's giving me a wierd error.

Quote:

root@evocati-desktop:/home/evocati# mdadm --create --verbose /dev/md0 --level=5 \ --raid-devices=4 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1
mdadm: only give one device per ARRAY line: /dev/md/Server and 1
mdadm: no raid-devices specified.
How do I handle that? I looked for it online, but I can't seem to find a answer.

Suggestions?

chrism01 08-09-2012 11:56 PM

I think the implications of this page http://linux.die.net/man/8/mdadm (both syntax defn & examples) imply that the /dev/mdX name should come immediately after the -C
Code:

# also, use a single long line (ie no '\') & short circuit dev names
mdadm --create /dev/md0 --verbose --level=5 --raid-devices=4 /dev/sd{a,b,c,d}1


Evocati 08-11-2012 01:36 AM

Wwwooootttt!!! Thanks!!

Evocati 08-11-2012 06:43 PM

So, that all worked (YAY!), but after I managed to get the network set up and mapped in to windows, I saw that it was only 800gb. so with a simple cat /proc/mdstat:

Code:

root@evocati-desktop:/home/evocati# cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md127 : active raid5 sda1[0] sdc1[2] sdd1[4] sdb1[1]
      2930280960 blocks super 1.2 level 5, 512k chunk, algorithm 2 [4/4] [UUUU]
     
unused devices: <none>
root@evocati-desktop:/home/evocati#

Any idea why there's an issue with the size not showing correctly in properties?

chrism01 08-12-2012 05:25 PM

Tricky to say; did you fdisk those to stay as FAT32, or as Linux RAID : partition type fd in fdisk ?
http://www.win.tue.nl/~aeb/partition...n_types-1.html
Try
Code:

fdisk -l
to check as above.
Note that RAID5 'loses' 1 disk for parity https://en.wikipedia.org/wiki/Standa..._levels#RAID_5 and when you mkfs.ext3 (or mkfs.ext4), you 'lose' 5% reserved to root/OS usage.
You can amend that at the mkfs time http://linux.die.net/man/8/mkfs.ext3 or later with tune2fs http://linux.die.net/man/8/tune2fs

Evocati 08-12-2012 06:16 PM

Quote:

Originally Posted by chrism01 (Post 4752655)
Tricky to say; did you fdisk those to stay as FAT32, or as Linux RAID : partition type fd in fdisk ?
http://www.win.tue.nl/~aeb/partition...n_types-1.html
Try
Code:

fdisk -l
to check as above.
Note that RAID5 'loses' 1 disk for parity https://en.wikipedia.org/wiki/Standa..._levels#RAID_5 and when you mkfs.ext3 (or mkfs.ext4), you 'lose' 5% reserved to root/OS usage.
You can amend that at the mkfs time http://linux.die.net/man/8/mkfs.ext3 or later with tune2fs http://linux.die.net/man/8/tune2fs

They're 1tb harddrives, so they should come out to roughly 3tb when in Raid 5. After some perusing, I've found that it's most likely that I'm running 64 bit and the kernel doesn't have large block support incorporated. Now, I have to figure out how to add large block support in. Why isn't that standard, I wonder.


Also:
Code:

evocati@evocati-desktop:~$ sudo fdisk -l
[sudo] password for evocati:

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
81 heads, 63 sectors/track, 382818 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000d85e0

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1            2048  1953525167  976761560    b  W95 FAT32

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
81 heads, 63 sectors/track, 382818 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xcd5266e8

  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1            2048  1953525167  976761560    b  W95 FAT32

Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
81 heads, 63 sectors/track, 382818 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x6c8d855f

  Device Boot      Start        End      Blocks  Id  System
/dev/sdc1            2048  1953525167  976761560    b  W95 FAT32

Disk /dev/sdd: 1000.2 GB, 1000204886016 bytes
81 heads, 63 sectors/track, 382818 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0001417d

  Device Boot      Start        End      Blocks  Id  System
/dev/sdd1            2048  1953525167  976761560    b  W95 FAT32

Disk /dev/sde: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders, total 156301488 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000962e4

  Device Boot      Start        End      Blocks  Id  System
/dev/sde1  *        2048  139599871    69798912  83  Linux
/dev/sde2      139601918  156301311    8349697    5  Extended
/dev/sde5      139601920  156301311    8349696  82  Linux swap / Solaris

WARNING: GPT (GUID Partition Table) detected on '/dev/md0'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/md0: 3000.6 GB, 3000607703040 bytes
2 heads, 4 sectors/track, 732570240 cylinders, total 5860561920 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 524288 bytes / 1572864 bytes
Disk identifier: 0x00000000

    Device Boot      Start        End      Blocks  Id  System
evocati@evocati-desktop:~$


chrism01 08-15-2012 09:08 PM

I'm not sure how mdadm will handle MS FAT32 disks and in any case you are limited by FAT32 itself, which is very old(!) tech and will not address that size of disk I believe.
Why don't you use a native Linux FS eg ext3/ext4?
If you want to mount this afterwards from MSWin, there are drivers for ext3 under MS I believe, or (better) use network mounting via Samba or NFS.

Actually, the disk partition types need to be set to 'fd' = Linux RAID.
ext3/ext4 is the Filesystem type.

Evocati 08-16-2012 02:00 PM

I managed to get this all working last weekend. As it turns out, if you just use an EXT4 partition on the raid and a Fat32 (or MSDOS w/e) on the drives themselves with a GPT selection, it works just fine. I had some issues getting things cleaned up, but once I was able to get the system to recognize the full raid size, I was golden.

Now, I'm needing to go through and clean out the auto-mount fstab file so it stops pausing during boot and then change the raid name so it isn't some long list of numbers/letters... that's annoying. I'd prefer to have it auto-mount with a particular name so the rest of the comps can connect to it immediately.

One odd thing is that one of the machines keeps having connectivity issues and dropping the connection. I've heard that that's been an issue, but I figured it was resolved. I'll have to get a screen shot the next time it happens.

Either way, I now have 4Tb+ on a network. Yay. (2.73Tb WD Black Raid5 + 1.8Tb WD Green solo)


Lastly, I didn't want to have to fool with the windows boxes incase there were something I needed to do to them. I wanted something that you could just plug a computer in to the router and be able to communicate with it immediately. The drivers seemed like one more thing to remember to get if I were to do a wipe.


All times are GMT -5. The time now is 11:27 AM.