0

So I'm completely new to Ubuntu and am trying to set up a backup/media server at home. I saw the guide on Lifehacker and figured I'd give it a try.

My system is an i3 3225 on an Intel DH77DF mobo with 8GB of ram. There's a 64GB mSATA SSD as the boot drive and two 4TB WD Red drives for the RAID1 configuration.

I installed Ubuntu 14.04 LTS in UEFI mode on the SSD without issues but as soon as I create the software RAID1 (and it finishes syncing after 9 hours), gparted gives me the following errors:

Libparted Bug Found!

End of file while reading Invalid argument

The primary GPT table is corrupt, but the backup appears OK, so that will be used.

These appear twice as almost for each 4TB drive.

Am I doing something wrong when creating the RAID? The RAID also appears as md127 if that helps.

Thanks, Mark

PS - This RAID setup has been a huge pain so far and I could write a good rant but I'll refrain for now. For example, mdadm wasn't initially installed so I had to figure that out. This was also after the fact I found out BIOS RAID is really FakeRAID.

  • You will have to be more specific: how did you create the raid? What command did you run to get that error? – psusi May 13 '14 at 23:42
  • I created the RAID1 using the disk application included with Ubuntu . Using the GUI, I selected the two 4TB drives and clicked on the Create RAID button that appeared at the bottom of its window. After following the steps (type of RAID, name, etc) the RAID1 began to sync. Once completed, I rebooted the system and opened GParted to create my partitions. The errors appeared as soon as GParted loaded. – Markardi May 15 '14 at 01:15

2 Answers2

1

Apparently you have some leftover broken partition tables on the drives. This causes the version of libparted in Ubuntu to refuse to operate on it. Wipe it out so you can start fresh with dd:

sudo dd if=/dev/zero count=64 of=/dev/md127

Alternatively you should be able to use the disk utility to create a new partition table on the raid array. After either of these, you should be able to use gparted.

psusi
  • 37,551
  • Hey @psusi, I ran that script but the errors still appeared. Again they appear twice so could that mean the errors have to do with each drive oppose to the raid itself? Should I run that script on /sda and /sdb? I haven't done anything with the drives so I'm fine if the raid has to be rebuilt. Also, I could not find the function to create a new partition table on the raid in the disk utility, just the option to format the whole 4TB. Thanks for your help with this. – Markardi May 16 '14 at 00:03
  • @Markardi, do you get the error when you run sudo parted /dev/sda print or with /dev/md127? – psusi May 16 '14 at 01:22
  • yes, I get the error when I run /sda though it's worded a little differently "Error: end of file while reading Inappropriate ioctl for device." "The primary GPT table is corrupt ..." If I run it for /sdb it comes up with the same error. There is no error for /sdc (the SSD) and also no error for /md127. It looks like it's something to do with the individual drives then correct? Thanks. – Markardi May 16 '14 at 02:14
  • @Markardi, odd.. it does look that way. You might want to zero the individual drives then and start over. Run sudo mdadm --stop /dev/md127 and sudo mdadm --zero-superblocks /dev/sd[ab] first. – psusi May 16 '14 at 02:17
  • I ran those commands and it got rid of the current raid as it looked like that would do. When I ran -superblocks I had to enter it as -superblock because an error came up saying it didn't recognize the command. If gparted is run now, the "end of file while reading..." still appears twice. Likewise if I enter sudo parted /dev/sda print in the terminal. what can I do to wipe sda and sdb clean before I put the raid back together? Thanks. – Markardi May 17 '14 at 00:42
  • Just for reference, here's the return in the terminal: Server:~$ sudo mdadm --zero-superblocks /dev/sd[ab] mdadm: unrecognized option '--zero-superblocks' Usage: mdadm --help for help Server:~$ sudo mdadm --zero-superblock /dev/sd[ab] mdadm: Unrecognised md component device - /dev/sda mdadm: Unrecognised md component device - /dev/sdb – Markardi May 17 '14 at 00:45
  • @Markardi, try using the gnome disk utility to create a partition table on the disks. – psusi May 17 '14 at 19:42
  • Maybe my terminology is not up to speed, but is there a difference between creating a new partition vs a partition table? Just asking because I can't see an option to create a partition table, just a new partition. I have gone and created a new partition on each /sda and /sdb (test1 and test2) which seemed to have solved the errors. There are no longer errors appearing in the terminal or GParted. With the system as it is now, should I delete the partitions to create the raid or will the creation of the raid delete the current test1 and test2 partitions for me? Thanks. – Markardi May 18 '14 at 01:21
  • @Markardi, normally you would create the raid using the partition. – psusi May 18 '14 at 01:25
  • so should I set up my partitions on /sda and /sdb to be the same name (both test1)? Or as I would like them for the raid where 1TB is Backup and 3TB is Media? Thanks. – Markardi May 18 '14 at 01:30
  • @Markardi, set them up as you want them to be of course – psusi May 18 '14 at 03:15
  • I created the 1TB and 3TB partitions on both /sda and /sdb separately and everything was fine. Then using the disk utility, created the raid1 and let that sync over night. After a system restart the errors are back. The info I see on the disk utility doesn't show and partitions, just one large 4TB volume. In the terminal though, the next comment is what I see. – Markardi May 18 '14 at 12:50
  • Server:~$ sudo parted /dev/sda print
    Error: end of file while reading Inappropriate ioctl for device
    Ignore
    Error: The primary GPT table is corrupt, but the backup appears OK, so that will be used.

    Model: ATA WDC WD40EFRX-68W (scsi)
    Disk /dev/sda: 4001GB
    Sector size (logical/physical): 512B/4096B
    Partition Table: gpt

    Number Start End Size File system Name Flags
    1 1049kB 855GB 855GB ext4
    2 855GB 4001GB 3146GB ext4

    – Markardi May 18 '14 at 12:53
  • (the format in comments doesn't help but) it looks like the 1TB and 3TB partitions are still there on /sda (and also /sdb). The raid however doesn't see them. I then tried formatting /md127 and got one large partition but I still get the same errors. Now /sda and /sdb see 2 partitions and /md127 sees one large partition. – Markardi May 18 '14 at 13:05
  • @Markardi, you should have created two different raids, one using each partition. It sounds like you are creating a raid out of the whole disk, in which case, the problem is that the disks still have a partition table that is now broken since you used the whole disk to create a raid array. – psusi May 18 '14 at 19:03
  • if possible, I would like to create a raid1 of the whole disk! In the disk utility it looks like it's only possible to create a raid of the whole drive as there isn't an option to select separate partitions. Maybe I'm missing something? But as I mentioned before, I would prefer to create a raid of the whole drive and partition it after. Is that possible? Thanks. – Markardi May 19 '14 at 17:08
0

With the help of a friend I figured it out!!

After doing more research because I wasn't entirely satisfied with having to create two raids on one set of drives (no offence), I managed to set it up how I want it. Moving over to the terminal rather than the GUI helped a lot and the big issue was left over GPT table data from my previous raid attempts. Once I figured out how to clear that data and create the raid from scratch, I had no other issues.

To check for left over data:
sudo mdadm -D /dev/sda
retuns "..does not appear to be an md device." (same for /sdb)

But when I go to create the raid:
sudo mdadm –create /dev/md1 –level=1 –raid-devices=2 /dev/sda /dev/sdb
returns "../Dev/sda appears to be part of a raid array..."

So to clear the old GPT data I had to go to each drive and:

sudo gdisk /dev/sda 2 (for GPT) x (for expert commands) z (wipe the gpt data) Yes Yes
(credit goes to @Steve HHH for his answer here)

From there I created the raid1 in the terminal rather than the GUI using the same code above:

sudo mdadm –create /dev/md1 –level=1 –raid-devices=2 /dev/sda /dev/sdb

After that finished syncing I used the GUI based GParted to create the separate partitions and no more errors are appearing. I can finally move forward with this media server!