0

Installed by Ubuntu 14.04 LTS Installer:

I have installed Ubuntu 14.04 LTS Desktop onto my notebook PC, and I made a wrong decision to alter the file ownership and permissions from the root drive as I wanted to access my notebook files via my desktop PC.

The result is that now I cannot access my disk. My notebook has two hard drives, one flash boot flash drive enough for the system, and a hard drive for storage which I made into to partitions, /Home and /Var.

Below is a reference of commands with disk information output:

sudo fdisk -l /dev/sda

 WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! 
 The util fdisk doesn't support GPT.  Use GNU Parted.

    Device  Boot      Start          End      Blocks    Id   System
 /dev/sda1   ?      6579571   1924427647  968924038+    70   DiskSecure Multi-Boot
 Partition 1 does not start on physical sector boundary.
 /dev/sda2   ?   1953251627   3771827541  909287957+    43   Unknown
 Partition 2 does not start on physical sector boundary.
 /dev/sda3   ?    225735265    225735274          5     72   Unknown
 Partition 3 does not start on physical sector boundary.
 /dev/sda4   ?   2642411520   2642463490      25945      0   Empty

 Partition table entries are not in disk order

sudo cryptsetup -v luksDump /dev/sda1

 Device /dev/sda1 is not a valid LUKS device.
 Command failed with code 22:  Device /dev/sda1 is not a valid LUKS device.

sudo cryptsetup -v luksDump /dev/sda2

 Device /dev/sda1 is not a valid LUKS device.
 Command failed with code 22:  Device /dev/sda2 is not a valid LUKS device.

It seems that there's also /dev/sda3 and /dev/sda4, but these partitions contain nothing and /sda3 has 5 blocks, /sda4 has 25945 blocks being empty. This was all done via Ubuntu 14.04 LTS desktop installation.

Section 1. Command Output

sudo gdisk -l /dev/sda

 GPT fdisk (gdisk) version 0.8.8 

 Caution: invalid main GPT header, but valid backup; regenerating main header
 from backup! 

 Caution! After loading partitions, the CRC doesn't check out! 
 Warning! Main partition table CRC mismatch! Loaded backup partition table 
 instead of main partition table! 

 Warning! One or more CRCs don't match. You should repair the disk! 

 Partition table scan: 
 MBR: MBR only 
 BSD: not present 
 APM: not present 
 GPT: damaged 

 Found valid MBR and corrupt GPT. Which do you want to use? (Using the
 GPT MAY permit recovery of GPT data.) 
 1 - MBR
 2 - GPT
 3 - Create blank GPT

 Your answer: 2

 Disk /dev/sda:  1953525168 sectors, 931.5 GiB
 Logical sector size  512 bytes
 Disk identifier  (GUID):  37C12505-96AB-4193-AD2F-A86ECEE7A8F9
 Partition table holds up to 128 entries
 First usable sector is 34, last uable sector is 1953525134
 Partitions will be aligned on 2048-sector boundaries
 Total free space is 3437 sectors (1.7 MiB)

 Number   Start (sector)   End (sector)  Size      Code   Name
   1              2048     1054685183   502.9 GiB  8300
   2        1054685184     1953523711   428.6 GiB  8300

Section 2. Command Output

sudo lsblk

 NAME    MAJ:MIN  RM      SIZE   RO   TYPE  MOUNTPOINT
 sda       8:0     0    931.5G    0   disk
 |-sda1    8:1     0    811.6G    0   part
 |-sda2    8:2     0    346.1G    0   part
 sdb       8:16    0     22.4G    0   disk
 |-sdb1    8:17    0      512M    0   part  /boot/efi
 |-sdb2    8:18    0       14G    0   part  /
 |-sdb3    8:19    0      7.8G    0   part  [SWAP] 

sudo parted -l

 Model:  ATA WDC  WD10JPVT-08A (scsi)
 Disk /dev/sda: 1000GB
 Sector size (logical/physical): 412B/4096B
 Partition Table: loop

 Number    Start    End      Size    File system   Flags
  1         0.00B   1000GB   1000GB  ntfs

 Model: ATA LITEONIT  LSS-24L (scsi)
 Disk /dev/sdb: 24.0GB
 Sector size (logical/physical):  512B/512B
 Partition Table: gpt

 Number    Start    End      Size    File system  Name  Flags
  1        1049kB   538MB    537MB   fat32              boot
  2        538MB    15.6GB   15.1GB  ext4 
  3        15.6GB   8398MB   linux-swap(v1)

 Warning: Unable to open /dev/sr0 read-write (Read-only file system).  /dev/sr0
 has been opened read-only.
 Error: /dev/sr0: unrecognised disk label

sudo fdisk -l /dev/sda

 Disk /dev/sda: 1000.2 gb, 1000204886016 bytes
 255 heads, 63 sectors/tracks, 121601 cylinders, total 1953525168 sectors
 Units = sectors of 1 * 512 bytes
 Sector size (logical/physical): 512 bytes / 4096 bytes
 I/O size (minimum/optimal): 4096 bytes / 4096 bytes
 Disk identifier: 0x2052474d

 This doesn't look like a partition table
 Probably you selected the wrong device.

    Device  Boot      Start          End      Blocks    Id   System
 /dev/sda1   ?      6579571   1924427647  968924038+    70   DiskSecure Multi-Boot
 Partition 1 does not start on physical sector boundary.
 /dev/sda2   ?   1953251627   3771827541  909287957+    43   Unknown
 Partition 2 does not start on physical sector boundary.
 /dev/sda3   ?    225735265    225735274          5     72   Unknown
 Partition 3 does not start on physical sector boundary.
 /dev/sda4   ?   2642411520   2642463490      25945      0   Empty

*In this case (/dev/sdb) is my system boot drive, while (/dev/sda) is the storage hard drive in which I'm trying to remount, and it has been set as 'DiskSecure Multi-Boot' by Ubuntu 14.04 LTS Installer.

Now, why is it that '#lsblk' shows differing sizes (even greater than the disk drive max size)?

My booting hard drive (/dev/sdb) is already set as the boot drive with GPT. Do I still need a GPT partition on my non-booting hard drive?

Also how may I mount my storage drive with the two partitions if '#parted -l' is only able to see one partition that is spanning the whole drive as ntfs?

Section 3. Command Output

sudo blkid /dev/sda

 /dev/sda: UUID="58DEF9CB30F761D5" TYPE="ntfs"
  • fdisk is not a suitable tool for GPT-partitioned disks. Can you replace its output with that of gdisk -l? It would also help to see, what lsblk -o NAME,SIZE,TYPE,FSTYPE,LABEL,MOUNTPOINT /dev/sda has to say. – David Foerster Sep 30 '14 at 17:43
  • #sudo mount /dev/sda2 /mnt mount: wrong fs type, bad option, bad superblock on /dev/sda2, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so – Norman331 Sep 30 '14 at 17:49
  • Welcome to AU by the way! You can edit your question to add or update new information. – David Foerster Sep 30 '14 at 17:54
  • #sudo gdisk -l /dev/sda GPT fdisk (gdisk) version 0.8.8 Caution: invalid main GPT header, but valid backup; regenerating main header from backup! Caution! After loading partitions, the CRC doesn't check out! Warning! Main partition table CRC mismatch! Loaded backup partition table instead of main partition table! Warning! One or more CRCs don't match. You should repair the disk! Partition table scan: MBR: MBR only BSD: not present APM: not present GPT: damaged Found valid MBR and corrupt GPT. Which do you want to use? (Using the GPT MAY permit recovery of GPT data.) – Norman331 Sep 30 '14 at 17:56
  • 1 - MBR 2 - GPT 3 - Create blank GPT Your answer: – Norman331 Sep 30 '14 at 17:57
0

Your GPT partition table is broken according to the output of gdisk. Please backup your partition table to a file on a working drive with:

sudo sgdisk --backup=/path/to/backup.sgdisk /dev/sda

You need to store it somewhere where you have write permissions like a USB drive or your home folder. If you're on a live system, you should also store the backup persistently on another internal or external drive, because a live system usually looses all alterations on shutdown.

You can then safely proceed to with option 2 of gdisk's question about which partition table to use. It will likely restore the GPT backup and put everything back in working order. Then you can try to resolve the permission problem.

  • I have reinstalled a new Ubuntu 14.04 installation. And created the same username and password. Also, I still remember the password for the two encrypted partitions How do you back up the partition table in this case? – Norman331 Sep 30 '14 at 18:29
  • Any data in (encrypted) file systems is irrelevant to the backup of the partition table. Do you have any other disks mounted on the system you use to repair the broken drive? – David Foerster Sep 30 '14 at 18:31
  • #sudo sgdisk --backup=table /dev/sda > /backup.sgdisk bash: /backup.sgdisk: Permission denied – Norman331 Sep 30 '14 at 18:33
  • I do not have any other disks mounted. As mentioned there are two drives in my notebook, one flash enough for the system and one for storage which I've encrypted, as /home and /var. – Norman331 Sep 30 '14 at 18:35
  • How may I proceed to backup the partition table? The string thing is I used Ubuntu's built-in backup and when I went to retrieve my backup, I received all /home files, but the /var folder was empty. Is there a block on the /var folder that would prevent backup? – Norman331 Sep 30 '14 at 18:37

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.