Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.




117 posts

Master Geek
+1 received by user: 21


Topic # 189515 2-Jan-2016 19:31
Send private message

I've been having quite a lot of difficulty in creating a RAID 10 array in Ubuntu Server 14.04 with Webmin, mainly because of issues with the GPT tables on the HDD's and indeterminable Webmin foibles.

As per this thread I've deleted my RAID in Webmin and repaired the partition tables for each disk using gdisk.

Before I dive into MDADM and start throwing the --create command into play I'd like to put a few issues to bed. I'll post up different questions in this thread to keep it all neat and self-contained.

 

QUESTION: 1!

 


One of the things that's bugging the hell out of me is: while trying to fix an issue, I unplugged all the HDD's, and when reconnected they reordered themselves, as far as linux lists the devices.

So where I had /dev/sda/ as my bootdrive plugged into SATA-1, and /dev/sdb-sde (my data drives) all neatly mapped as per the SATA ports on the motherboard, now my bootdrive (separate from the raid business) is showing up as /dev/sdb and I've no idea which of the other drives is which! Therefore if I get a drive failure I won't be able to immediately identify the drive by correlating the missing /dev/sdx code to 'the second drive down' in my case.

Does anyone know how to assign these drive letters to specific devices? Or any system which will make it easy for me to identify which drive is the culprit and swap em' in case of a failure? I'm not just talking hard failure where it's obvious from the BIOS, I mean if I need to fail a drive because of SMART errors etc.

Any of your pro tips would be greatly appreciated!

Create new topic
166 posts

Master Geek
+1 received by user: 30


  Reply # 1460360 2-Jan-2016 20:23
Send private message

This seems to be prevalent when mixing sata and pata devices.
Using UUID in /etc/fstab makes the system always mount the partitions as you want them mounted.
Another option is to give the partitions a label (can be done easily with gparted, of course from a live disk). Then you use the label in /etc/fstab.
https://help.ubuntu.com/community/Fstab



117 posts

Master Geek
+1 received by user: 21


  Reply # 1460402 2-Jan-2016 21:52
Send private message

Gozer: This seems to be prevalent when mixing sata and pata devices.
Using UUID in /etc/fstab makes the system always mount the partitions as you want them mounted.
Another option is to give the partitions a label (can be done easily with gparted, of course from a live disk). Then you use the label in /etc/fstab.
https://help.ubuntu.com/community/Fstab


Bear with a noobie here, at the moment my drives have a GPT table but no partition. Therefore when I run <sudo blkid> the only UUID's I get are for the three partitions on my boot drive.
Am I right in thinking that, as per this, the correct thing to do is to create 'symlinks' for each piece of hardware rather than mess with UUID's?

 
 
 
 


1310 posts

Uber Geek
+1 received by user: 325


  Reply # 1460407 2-Jan-2016 21:57
One person supports this post
Send private message

I'm not so great with Linux LVM, but you could make a few notes and stick them to the outside of the computer :-)

Once you've created something it'll look something like this :

 


 

root@127.0.0.1:/dev# cat /dev/mdstat

 

cat: /dev/mdstat: No such file or directory

 

root@127.0.0.1:/dev# mdadm --detail /dev/md1

 

/dev/md1:

 

        Version : 1.0

 

  Creation Time : Thu May 12 19:27:22 2011

 

     Raid Level : raid5

 

     Array Size : 5854396032 (5583.19 GiB 5994.90 GB)

 

  Used Dev Size : 1951465344 (1861.06 GiB 1998.30 GB)

 

   Raid Devices : 4

 

  Total Devices : 4

 

    Persistence : Superblock is persistent

 

 

 

    Update Time : Sat Jan  2 21:38:53 2016

 

          State : clean

 

 Active Devices : 4

 

Working Devices : 4

 

 Failed Devices : 0

 

  Spare Devices : 0

 

 

 

         Layout : left-symmetric

 

     Chunk Size : 128K

 

 

 

           Name : N4200PRO:1  (local to host N4200PRO)

 

           UUID : 4c987154:45a0e7d7:846bd7a4:75f94e10

 

         Events : 233796

 

 

 

    Number   Major   Minor   RaidDevice State

 

       5       8        2        0      active sync   /dev/sda2

 

       4       8       18        1      active sync   /dev/sdb2

 

       2       8       34        2      active sync   /dev/sdc2

 

       3       8       50        3      active sync   /dev/sdd2

 

 



The bottom few lines will show you what devices are in the setup, then pull the serial numbers of those devices with :

 


root@127.0.0.1:/dev# hdparm -i /dev/sda

/dev/sda:

Model=WDC WD20EZRX-00D8PB0 , FwRev=80.00A80, SerialNo= WD-WMC4N0L611U7
Config={ HardSect NotMFM HdSw>15uSec SpinMotCtl Fixed DTR>5Mbs FmtGapReq }
RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=0
BuffType=unknown, BuffSize=0kB, MaxMultSect=16, MultSect=?0?
CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=268435455
IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
PIO modes: pio0 pio3 pio4
DMA modes: mdma0 mdma1 mdma2
UDMA modes: udma0 udma1 udma2
AdvancedPM=no WriteCache=enabled
Drive conforms to: Unspecified: ATA/ATAPI-1 ATA/ATAPI-2 ATA/ATAPI-3 ATA/ATAPI-4 ATA/ATAPI-5 ATA/ATAPI-6 ATA/ATAPI-7

* signifies the current active mode

 



Then if/when a device fails just run the hdparm command again on the surviving members and don't pull them out :-)

Clunky... and there is bound to be a smarter way of doing it, but I'm a lazy storage admin and the arrays do it all for me now!





117 posts

Master Geek
+1 received by user: 21


  Reply # 1460429 2-Jan-2016 23:34
Send private message

Nice Mark, slightly ghetto but it will work in a pinch!

Still, I'd like to hear people's opinion on symlinking, as it seems to be a more reliable way of having your drives do what you want them to do every single time... but the internets aren't providing definitive answers on whether or not this is even possible with MDADM. Does MDADM even support this functionality, or does it only speak in the language of '/dev/sdx'?

I'll be RAIDing the entire disks together rather than creating an array of partitions, which I didn't make clear in the first post sorry.



1931 posts

Uber Geek
+1 received by user: 141

Trusted

  Reply # 1460432 2-Jan-2016 23:40
Send private message

MDADM software raid doesn't really care if the drives change name, as long as they have the correct UUID in their RAID meta information.

I personally always put a partition table down for raid or LVM.

GPT on disks + single partition correctly aligned + Raid (I'd use Raid 6 over Raid 10 for future expansion) then LVM.




Generally known online as OpenMedia, now working for Red Hat New Zealand as a Solution Architect for all things Linux, Virtual and of course Cloud. Still playing with MythTV and digital media on the side.



117 posts

Master Geek
+1 received by user: 21


  Reply # 1460568 3-Jan-2016 12:15
Send private message

openmedia: MDADM software raid doesn't really care if the drives change name, as long as they have the correct UUID in their RAID meta information.

I personally always put a partition table down for raid or LVM.

GPT on disks + single partition correctly aligned + Raid (I'd use Raid 6 over Raid 10 for future expansion) then LVM.


So MDADM will use UUID's automatically without any prompting/added configuration?

Create new topic



Twitter »

Follow us to receive Twitter updates when new discussions are posted in our forums:



Follow us to receive Twitter updates when news items and blogs are posted in our frontpage:



Follow us to receive Twitter updates when tech item prices are listed in our price comparison site:





News »

Fujifilm X beats its best with new top of the range, high-performance camera
Posted 24-Feb-2018 14:05


One million kiwis affected by cybercrime
Posted 24-Feb-2018 13:58


New Zealanders want to engage with government online and via mobile apps
Posted 24-Feb-2018 13:56


Samsung launches Samsung Max
Posted 24-Feb-2018 13:52


CPTPP text and National Interest Analysis released for public scrutiny
Posted 21-Feb-2018 19:43


Foodstuffs to trial digitised shopping trolleys
Posted 21-Feb-2018 18:27


2018: The year of zero-login, smart cars & the biometrics of things
Posted 21-Feb-2018 18:25


Intel reimagines data centre storage with new 3D NAND SSDs
Posted 16-Feb-2018 15:21


Ground-breaking business programme begins in Hamilton
Posted 16-Feb-2018 10:18


Government to continue search for first Chief Technology Officer
Posted 12-Feb-2018 20:30


Time to take Appleā€™s iPad Pro seriously
Posted 12-Feb-2018 16:54


New Fujifilm X-A5 brings selfie features to mirrorless camera
Posted 9-Feb-2018 09:12


D-Link ANZ expands connected smart home with new HD Wi-Fi cameras
Posted 9-Feb-2018 09:01


Dragon Professional for Mac V6: Near perfect dictation
Posted 9-Feb-2018 08:26


OPPO announces R11s with claims to be the picture perfect smartphone
Posted 2-Feb-2018 13:28



Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.

Alternatively, you can receive a daily email with Geekzone updates.