Linux Ubuntu 14.04 LTS /dev/md0 doesn't contain a valid partition table

Hello,

I replaced a HDD in my server.  This is a RAID1 configuration with a swap partition and a "/" partition.  It appears the mirror was recreated, but now I am getting the errors "/dev/md0 doesn't contain a valid partition table" and "/dev/md1 doesn't contain a valid partition table" when I run fdisk -l

I am not able to boot to the replaced "new" drive.

Please let me know if you need additional info.

Please advise.

Have a great day,

Don
GEMCCAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Zephyr ICTCloud ArchitectCommented:
I think you don't have a partition table, just a partition ... You just created a partition on the disk as where before it might of have a partition table.

Hence it's normal that you get that message ...

A partition table could be created with something like
parted /dev/md0 mklabel msdos

Open in new window


Or use fdisk by opening the disk when inserted after failing and close with "w"(rite)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
andreasSystem AdminCommented:
Can you please post the output of fdisk -l from all found devices. mdx and sdx

Im also guessing the mds itself were unpartitioned before and contain the filesystem itself. The mds i think are sitting in its partitions on the disks. And those partitions /dev/sda1 /dev/sdb1 are mirrored as a md device.

In this scenario each /dev/md will not have partitions.

You need to create the same partition table on the new disk as its on the remaining of the raid mirror and then use mdadm to initialize and add the new created paritions back into the raid.

(im assuming it was a linux soft raid and not a mainboard raid).

afterwards you may need to re install the bootloader to the MBR of the new installed HDD. Especially it it was /dev/sda that was failing before.

If lucky and the old setup was correct the bootloader should have been on BOTH disks so just switch bios boot order to the other HDD as 1st device and your linux may boot.
0
GEMCCAuthor Commented:
Hello,

If I run parted /dev/md0 mklabel msdos, I am given a warning that the data will be lost.

Here is what fdisk -l says:

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: 0x6992f643

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048      487423      242688   fd  Linux raid autodetect
/dev/sda2          487424  1953523711   976518144   fd  Linux raid autodetect

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 / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x000cf274

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048      487423      242688   fd  Linux raid autodetect
/dev/sdb2          487424  1953523711   976518144   fd  Linux raid autodetect

Disk /dev/md0: 248 MB, 248315904 bytes
2 heads, 4 sectors/track, 60624 cylinders, total 484992 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

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

Disk /dev/md1: 999.8 GB, 999820165120 bytes
2 heads, 4 sectors/track, 244096720 cylinders, total 1952773760 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

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


Please advise.

Have a great day,

Don
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

andreasSystem AdminCommented:
So far so good, your partitioning is ok.

next I need the output of

cat /proc/mdstat

and

file -s /dev/md0
file -s /dev/md1

you also could try to mount /dev/md1 to /mnt within your rescue environment, to check if you can mount it.

please mount like this:

mount /dev/md1 /mnt -o ro

which will mount it read only to prevent accidential damage.

if mount was successful you could check if /mnt contains the files of your ubuntu installation.
0
GEMCCAuthor Commented:
Ended up wiping out and restarting install.
0
GEMCCAuthor Commented:
Not sure if this would have really resolved the issue as I wiped out the system and started from scratch.
0
andreasSystem AdminCommented:
would have not as your filesystems should have been in /dev/md1 and swap in /dev/md0,

But i also think reinstalling is fastest way for you. hope you didnt had important files inside.

my assumption of your problem was is that the system either had not mirrored the raid correctly OR that the bootloader on the new disk wasnt properly installed.

Nevermind if reinstallation was ok for you its surely the solution with less hassle. (but lesser learning ;))
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.