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?

 
 
 
 


1292 posts

Uber Geek
+1 received by user: 319


  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.



1906 posts

Uber Geek
+1 received by user: 127

Trusted
Subscriber

  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 »

UAV Traffic Management Trial launching today in New Zealand
Posted 12-Dec-2017 16:06


UFB connections pass 460,000
Posted 11-Dec-2017 11:26


The Warehouse Group to adopt IBM Cloud to support digital transformation
Posted 11-Dec-2017 11:22


Dimension Data peeks into digital business 2018
Posted 11-Dec-2017 10:55


2018 Cyber Security Predictions
Posted 7-Dec-2017 14:55


Global Govtech Accelerator to drive public sector innovation in Wellington
Posted 7-Dec-2017 11:21


Stuff Pix media strategy a new direction
Posted 7-Dec-2017 09:37


Digital transformation is dead
Posted 7-Dec-2017 09:31


Fake news and cyber security
Posted 7-Dec-2017 09:27


Dimension Data New Zealand strengthens cybersecurity practice
Posted 5-Dec-2017 20:27


Epson NZ launches new Expression Premium Photo range
Posted 5-Dec-2017 20:26


Eventbrite and Twickets launch integration partnership in Australia and New Zealand
Posted 5-Dec-2017 20:23


New Fujifilm macro lens lands in New Zealand
Posted 5-Dec-2017 20:16


Cyber security not being taken seriously enough
Posted 5-Dec-2017 20:13


Sony commences Android 8.0 Oreo rollout in New Zealand
Posted 5-Dec-2017 20:08



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.