• Any Lunix experts here?

    From SH@21:1/5 to All on Tue Aug 24 14:54:07 2021
    I've installed a hard disc.

    I'm able to create a EXT4 partition to it and copy files across.....

    However, if I power down and restart, the HDD is no longer visible in
    Ubuntu but I can see the drive listed during the BIOS POST

    Upon checking with gparted, I get the following message:

    The primary GPT table is corrupt, but the backup appears OK

    and it proceeds to then use the backup GPT.

    The only way to get the hard disc back up visible in Ubuntu is to
    partition & format it again to Ext4 and then mmount it.


    It is then fine until the next power down and subsequent restart

    How do I fix the corrupt primary GPT once and for all?

    S.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Theo@21:1/5 to i.love.spam@spam.com on Tue Aug 24 15:41:43 2021
    SH <i.love.spam@spam.com> wrote:
    How do I fix the corrupt primary GPT once and for all?

    If you don't care about what's on the drive, I'd be tempted to zero it and start again:

    sudo dd if=/dev/zero of=/dev/sdX bs=1M

    where /dev/sdX is the drive device.

    That will make it clean as if from the factory, so you could partition it
    anew.

    It will take a while to zero out the whole drive, so you could try running
    it for a minute and then Ctrl-C and see if it's zapped enough to allow it to
    be repartitioned. The secondary GPT lives at the end of the drive, so if
    you also did:

    sudo dd if=/dev/zero of=/dev/sdX bs=1GB seek=950

    it would start zeroing at 950 (power of ten) gigabytes, which should be
    enough to zap the GPT on a 1TB drive if you leave it to complete. Adjust
    the numbers for your size of drive.

    Theo

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From SH@21:1/5 to Theo on Tue Aug 24 16:14:23 2021
    On 24/08/2021 15:41, Theo wrote:
    SH <i.love.spam@spam.com> wrote:
    How do I fix the corrupt primary GPT once and for all?

    If you don't care about what's on the drive, I'd be tempted to zero it and start again:

    sudo dd if=/dev/zero of=/dev/sdX bs=1M

    where /dev/sdX is the drive device.

    That will make it clean as if from the factory, so you could partition it anew.

    It will take a while to zero out the whole drive, so you could try running
    it for a minute and then Ctrl-C and see if it's zapped enough to allow it to be repartitioned. The secondary GPT lives at the end of the drive, so if
    you also did:

    sudo dd if=/dev/zero of=/dev/sdX bs=1GB seek=950

    it would start zeroing at 950 (power of ten) gigabytes, which should be enough to zap the GPT on a 1TB drive if you leave it to complete. Adjust
    the numbers for your size of drive.

    Theo


    the drive is 2 TB..... it has no data on it that I wish to keep....

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From SH@21:1/5 to Theo on Wed Aug 25 08:38:39 2021
    On 24/08/2021 15:41, Theo wrote:
    SH <i.love.spam@spam.com> wrote:
    How do I fix the corrupt primary GPT once and for all?

    If you don't care about what's on the drive, I'd be tempted to zero it and start again:

    sudo dd if=/dev/zero of=/dev/sdX bs=1M

    where /dev/sdX is the drive device.

    That will make it clean as if from the factory, so you could partition it anew.

    It will take a while to zero out the whole drive, so you could try running
    it for a minute and then Ctrl-C and see if it's zapped enough to allow it to be repartitioned. The secondary GPT lives at the end of the drive, so if
    you also did:

    sudo dd if=/dev/zero of=/dev/sdX bs=1GB seek=950

    it would start zeroing at 950 (power of ten) gigabytes, which should be enough to zap the GPT on a 1TB drive if you leave it to complete. Adjust
    the numbers for your size of drive.

    Theo


    Theo,

    I have zeroed out the hard disc drive using the command you gave that being:


    sudo dd if=/dev/zero of=/dev/sdb bs=1M from a terminal window

    I left it to run overnight.

    Came back to it and saw that the operation had completed in the terminal window.

    I then ran gparted which complaiined there was no partition table so I
    created a new partition table.

    I then created a new Ext4 partition and was able to mount it.

    I then copied across a Linux ISO to sdb.

    I then shut down and restarted.

    I still get the:

    The primary GPT table is corrupt, but the backup appears OK

    and it proceeds to then use the backup GPT.

    But I cannot mount the disk without formatting it to EXT4 again.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Theo@21:1/5 to i.love.spam@spam.com on Wed Aug 25 21:29:55 2021
    SH <i.love.spam@spam.com> wrote:
    I still get the:

    The primary GPT table is corrupt, but the backup appears OK

    and it proceeds to then use the backup GPT.

    But I cannot mount the disk without formatting it to EXT4 again.

    So something is monkeying with the GPT. Do you have anything possible in
    BIOS that might? For example some BIOSes do software RAID which might try
    to save RAID stuff to the disc.

    It's also worth running smartctl and checking the disc doesn't have any
    health problems:

    sudo apt install smartmontools
    sudo smartctl -a /dev/sdb

    look for things like 'reallocated sector count' being high which would
    suggest parts of the surface aren't working properly.

    Theo

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gordon@21:1/5 to i.love.spam@spam.com on Thu Aug 26 04:26:04 2021
    On 2021-08-25, SH <i.love.spam@spam.com> wrote:
    On 24/08/2021 15:41, Theo wrote:
    SH <i.love.spam@spam.com> wrote:
    How do I fix the corrupt primary GPT once and for all?

    If you don't care about what's on the drive, I'd be tempted to zero it and >> start again:

    sudo dd if=/dev/zero of=/dev/sdX bs=1M

    where /dev/sdX is the drive device.

    That will make it clean as if from the factory, so you could partition it
    anew.

    It will take a while to zero out the whole drive, so you could try running >> it for a minute and then Ctrl-C and see if it's zapped enough to allow it to >> be repartitioned. The secondary GPT lives at the end of the drive, so if
    you also did:

    sudo dd if=/dev/zero of=/dev/sdX bs=1GB seek=950

    it would start zeroing at 950 (power of ten) gigabytes, which should be
    enough to zap the GPT on a 1TB drive if you leave it to complete. Adjust
    the numbers for your size of drive.

    Theo


    Theo,

    I have zeroed out the hard disc drive using the command you gave that being:


    sudo dd if=/dev/zero of=/dev/sdb bs=1M from a terminal window

    I left it to run overnight.

    Came back to it and saw that the operation had completed in the terminal window.

    I then ran gparted which complaiined there was no partition table so I created a new partition table.

    I then created a new Ext4 partition and was able to mount it.

    I then copied across a Linux ISO to sdb.

    I then shut down and restarted.

    I still get the:

    The primary GPT table is corrupt, but the backup appears OK

    and it proceeds to then use the backup GPT.

    But I cannot mount the disk without formatting it to EXT4 again.


    How old is the HD? On the way out?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Adrian Caspersz@21:1/5 to Theo on Thu Aug 26 10:32:46 2021
    On 25/08/2021 21:29, Theo wrote:
    SH <i.love.spam@spam.com> wrote:
    I still get the:

    The primary GPT table is corrupt, but the backup appears OK

    and it proceeds to then use the backup GPT.

    But I cannot mount the disk without formatting it to EXT4 again.

    So something is monkeying with the GPT. Do you have anything possible in BIOS that might? For example some BIOSes do software RAID which might try
    to save RAID stuff to the disc.

    "Boot sector protection" might be a feature in the bios ye could
    disable, but been years since I've seen that feature.

    https://www.google.com/search?q=bios+boot+sector+protection

    --
    Adrian C

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Geoff Clare@21:1/5 to All on Thu Aug 26 13:47:35 2021
    SH wrote:

    I then ran gparted which complaiined there was no partition table so I created a new partition table.

    I then created a new Ext4 partition and was able to mount it.

    I then copied across a Linux ISO to sdb.

    I then shut down and restarted.

    I still get the:

    The primary GPT table is corrupt, but the backup appears OK

    How did you copy the ISO? If you did something like:

    cp whatever.iso /dev/sdb

    then that would overwrite the primary GPT table and the beginning
    of the Ext4 file system with an ISO file system.

    --
    Geoff Clare <netnews@gclare.org.uk>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jim Jackson@21:1/5 to i.love.spam@spam.com on Thu Aug 26 18:27:15 2021
    On 2021-08-25, SH <i.love.spam@spam.com> wrote:

    I have zeroed out the hard disc drive using the command you gave that being:

    sudo dd if=/dev/zero of=/dev/sdb bs=1M from a terminal window

    I left it to run overnight.

    Came back to it and saw that the operation had completed in the terminal window.

    I then ran gparted which complaiined there was no partition table so I created a new partition table.

    I then created a new Ext4 partition and was able to mount it.

    I then copied across a Linux ISO to sdb.

    This worries me.

    Do you mean you installed from a linux ISO to the new partition /dev/sdb1 ?

    If not HOW do you copy the linux ISO to the disk?
    What are you trying to do?


    I then shut down and restarted.

    I still get the:

    The primary GPT table is corrupt, but the backup appears OK

    and it proceeds to then use the backup GPT.

    But I cannot mount the disk without formatting it to EXT4 again.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From SH@21:1/5 to Jim Jackson on Thu Aug 26 23:11:22 2021
    On 26/08/2021 19:27, Jim Jackson wrote:
    On 2021-08-25, SH <i.love.spam@spam.com> wrote:

    I have zeroed out the hard disc drive using the command you gave that being: >>
    sudo dd if=/dev/zero of=/dev/sdb bs=1M from a terminal window

    I left it to run overnight.

    Came back to it and saw that the operation had completed in the terminal
    window.

    I then ran gparted which complaiined there was no partition table so I
    created a new partition table.

    I then created a new Ext4 partition and was able to mount it.

    I then copied across a Linux ISO to sdb.

    This worries me.

    Do you mean you installed from a linux ISO to the new partition /dev/sdb1 ?

    If not HOW do you copy the linux ISO to the disk?
    What are you trying to do?


    I then shut down and restarted.

    I still get the:

    The primary GPT table is corrupt, but the backup appears OK

    and it proceeds to then use the backup GPT.

    But I cannot mount the disk without formatting it to EXT4 again.



    Right....

    I've finally solved the primary GPT issue....

    Basically I was trying to set up a PC with OMV (open media vault.)

    I have 13 SATA3 drives lying about being used as various NAS drives in different kit.

    I had bought two Adaptec 6805T cards taht will support 8 drives each.

    (the Mobo I have has 2 off SATA3 ports and 4 off SATA 2 ports and 1 off
    EIDE ports)

    I have two Samsung SATA3 SSDs on teh 2 SATA 3 ports, one with Ubuntu and
    the other with OMV.


    Then there is two DVD burners off the EIDE port.

    (The idea is that if one SSD breaks, I can still access the data with
    the other SSD, along with Ubuntu LIVE dvd's via the DVD drives))

    I had hung 4 off 500GB drives off one of the adaptec 6805T cards to make
    a RAID 5 array. No probelsm at all with this one.

    I then hung a 2TB drive off the other adaptec 6805T card.

    I had thought both cards would permit the presenting of HDDs via Int 13H interrupts so that the BIOSes would then list them as Int 13H drives
    accessible to any OS.

    I found I had to set up the 2TB drive as a JBOD of one disc to make it
    visible to either OMV or Ubuntu. This was the one I was having issues
    with the primary drive with the primary GPT.

    I ended up updating the Adaptec BIOSes and I then found another option
    called "Morph to Simple Volume"

    So the JBOD of the single 2TB drive was then morphed to a simple volume
    and voila, no more corrupt primary GPTs.

    The plan is to copy across the data from the existing NASes onto the OMV/Ubuntu box and then move the rest of the drives one by one so there
    was always a backup copy before moving a HDD across.

    Eventually when all is said and done, I was going to the secure wipe and
    sell off the 4 off 500GB drives, leaving me with 4 off 1TB and 5 off 2TB
    drives but across two Adaptec cards to avoid single points of failure.

    (I have spare mobos/procesors/memory etc so its really duplicating the
    hard discs, the adaptec cards etc I was focussing on)

    As for copying ISOs, this was a test really, I downloaded the ubuntu ISO
    and simply copied and pasted the ISO to a test directory on sdb1 and
    onto sdba1.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Theo@21:1/5 to i.love.spam@spam.com on Fri Aug 27 09:48:30 2021
    SH <i.love.spam@spam.com> wrote:
    Basically I was trying to set up a PC with OMV (open media vault.)

    I have 13 SATA3 drives lying about being used as various NAS drives in different kit.

    I had bought two Adaptec 6805T cards taht will support 8 drives each.

    (the Mobo I have has 2 off SATA3 ports and 4 off SATA 2 ports and 1 off
    EIDE ports)

    Just FYI, it's helpful if you tell us stuff like this upfront. If you
    don't, we're going to assume your setup is just a standard PC with a mobo, one/two HDD, that's it, because that's what 99% of people have, especially
    the people asking for help because they don't know what they don't know.

    There's no way we can guess that you have an unusual setup like this, but it does have a bearing on the problem. So if you're asking for help at least flagging when you're doing something out of the ordinary is helpful so we
    can identify if that's going to be relevant to the problem or not.

    Glad you got it sorted...

    Theo

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From SH@21:1/5 to Theo on Fri Aug 27 10:00:13 2021
    On 27/08/2021 09:48, Theo wrote:
    SH <i.love.spam@spam.com> wrote:
    Basically I was trying to set up a PC with OMV (open media vault.)

    I have 13 SATA3 drives lying about being used as various NAS drives in
    different kit.

    I had bought two Adaptec 6805T cards taht will support 8 drives each.

    (the Mobo I have has 2 off SATA3 ports and 4 off SATA 2 ports and 1 off
    EIDE ports)

    Just FYI, it's helpful if you tell us stuff like this upfront. If you
    don't, we're going to assume your setup is just a standard PC with a mobo, one/two HDD, that's it, because that's what 99% of people have, especially the people asking for help because they don't know what they don't know.

    There's no way we can guess that you have an unusual setup like this, but it does have a bearing on the problem. So if you're asking for help at least flagging when you're doing something out of the ordinary is helpful so we
    can identify if that's going to be relevant to the problem or not.

    Glad you got it sorted...

    Theo



    All duly noted..... :-)

    In the past, You could configure RAID adapters as simple HBAs (Host bus adapters) such as the 2400A card so as to create just a load of extra
    hard disc sockets but via the PCI/PCIe bus.

    So you could hook up two drives to the mobo via its onboard ports then
    hook up 4 more to the HBA.

    Then as long as you enabled Int 13h support in the HBA's bios, the
    machine would then boot into your OS of choice, run Fdisk or Gparted, do
    the partitioning and formatting then you'd end up with drives C, D, E,
    F, G and H or sda1, sbb1, sdc1, sdd1, sde1 and sdf1.

    So as far as the OS was concerned, they were just 6 "simple" and
    bootable drives

    On these 6805Ts you have to set up as RAID or JBOD, there appears to be
    no Int 13h support.

    So thats how I ended up making individual disks as 1 drive JBODs.
    Then as mentioned before, I then had the issues with primary GPTs.

    It seems converting the 1 disc JBOD into a morphed single volume works.....

    Now I need to think about the scenario where if both 6805T adapters
    fail, can I still access the data via a regular Mobo SATA3 port?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Theo@21:1/5 to i.love.spam@spam.com on Sat Aug 28 00:14:43 2021
    SH <i.love.spam@spam.com> wrote:
    So as far as the OS was concerned, they were just 6 "simple" and
    bootable drives

    On these 6805Ts you have to set up as RAID or JBOD, there appears to be
    no Int 13h support.

    If you're doing RAID things, there's something to be said for having your
    boot drive a non-RAID disc, at least as far as the OS kernel (for example
    the contents of /boot). Slightly less resilient, but you don't have to
    worry about boot foibles of your RAID adapter.

    Many VM hosts and similar put the hypervisor OS on an internally-mounted USB stick for this reason.

    So thats how I ended up making individual disks as 1 drive JBODs.
    Then as mentioned before, I then had the issues with primary GPTs.

    It seems converting the 1 disc JBOD into a morphed single volume works.....

    Now I need to think about the scenario where if both 6805T adapters
    fail, can I still access the data via a regular Mobo SATA3 port?

    Try it and see. Just swap the cables over and see if you can still read it. (for bonus points you could hash the contents to check they're exactly the same)

    Theo

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From SH@21:1/5 to Theo on Sat Aug 28 09:12:47 2021
    On 28/08/2021 00:14, Theo wrote:
    SH <i.love.spam@spam.com> wrote:
    So as far as the OS was concerned, they were just 6 "simple" and
    bootable drives

    On these 6805Ts you have to set up as RAID or JBOD, there appears to be
    no Int 13h support.

    If you're doing RAID things, there's something to be said for having your boot drive a non-RAID disc, at least as far as the OS kernel (for example
    the contents of /boot). Slightly less resilient, but you don't have to
    worry about boot foibles of your RAID adapter.

    As it happens in this particular install, I am using a Samsung SSD with
    the Boot OS on it via one of the two motherboard on-board SATA3 connnectors.

    The 2nd SSD is on the 2nd SATA3 conenctor and holds Ubuntu on it.

    All of the data would be on the spinning rust drives attached to the
    6805Ts which allowas me to hook up to 16 drives for data storage.

    Many VM hosts and similar put the hypervisor OS on an internally-mounted USB stick for this reason.

    So thats how I ended up making individual disks as 1 drive JBODs.
    Then as mentioned before, I then had the issues with primary GPTs.

    It seems converting the 1 disc JBOD into a morphed single volume works..... >>
    Now I need to think about the scenario where if both 6805T adapters
    fail, can I still access the data via a regular Mobo SATA3 port?

    Try it and see. Just swap the cables over and see if you can still read it. (for bonus points you could hash the contents to check they're exactly the same)

    As in swapping one of the drives from teh 6805T controller to one of the onboard motherboard ports?

    S.

    Theo


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Theo@21:1/5 to i.love.spam@spam.com on Sat Aug 28 13:11:10 2021
    SH <i.love.spam@spam.com> wrote:
    As in swapping one of the drives from teh 6805T controller to one of the onboard motherboard ports?

    Yes. If you mount it readonly it shouldn't write anything to make it get
    out of sync with the RAID drive. Although when you put it back the array
    could decide it's a 'new' drive and resilver it anyway. But that shouldn't matter at this stage if there's nothing of value there.

    Theo

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)