Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Unable to access root partition from grub menu

  1. #1
    Join Date
    Jul 2020
    Beans
    8

    Unable to access root partition from grub menu

    Hello guys, I am in a lot of trouble so any help would be appreciated.

    I have a dual boot on my laptop with Windows and Ubuntu and I wanted to resize my partitions. I shrunk my Windows partition using gparted and grew the active ubuntu partition to fill the unallocated space using the first answer here: https://askubuntu.com/questions/2402...ion-at-runtime

    This seemed to have worked, but when I rebooted the computer to apply the new partition tables, I get the grub menu at Ubuntu boot. I can boot into Windows just fine. I've seen a lot of posts about finding the /boot/grub/ folder and loading the image and kernels from there to boot, but I cannot find this folder in my root partition. My main partition, /dev/sda5 or (hd0,gpt5) is now an unknown filesystem.

    I tried to use boot-repair from USB and the results for that are here: https://paste.ubuntu.com/p/Tx7SgFJFh5/. It said successful boot repair but when I reboot I still get the grub menu and I cannot find /boot/grub directory anywhere. What do I do?

  2. #2
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: Unable to access root partition from grub menu

    First always use Windows tools to resize Windows & reboot into Windows to make sure it runs chkdsk. While gparted can often resize NTFS partitions, when issues everyone blames Linux when often a Windows issues.
    General rule is Windows tools for Windows & Linux tools for Linux.

    You first need to change sda5 to ext4, assuming it was ext4 & your / partition. But do not want to format it, just change partition table entry. Then you probably need full fsck. Many tools that create partitions, both create it & format it, which you do not want.

    Do you have good backups, particularly /home, & list of installed apps and maybe /etc if you changed any system settings?

    backup partition table before any changes, so you can get back to current if changes not correct, save to another device. This is just a text file of partitions, so you can easier restore partition table.
    sudo sfdisk -d /dev/sda > PT_sda.txt
    So you know sectors:
    sudo parted /dev/sda unit s print

    What does gdisk show as it loads & compare gpt partition table with backup gpt partition table.
    sudo gdisk -l /dev/sda
    https://www.rodsbooks.com/gdisk/repairing.html

    What does testdisk show? It typically finds all old partitions show may show multiple versions of each partition, since resized.
    https://help.ubuntu.com/community/DataRecovery
    http://www.cgsecurity.org/wiki/TestDisk
    repairs including testdisk info & links
    https://help.ubuntu.com/community/DataRecovery#Lost_Partition


    #From liveDVD/Flash so everything is unmounted,swap off if necessary, change example shown with partition sda5 to your partition(s)
    #e2fsck is used to check the ext2/ext3/ext4 family of file systems. -p tries fixes where response not required
    sudo e2fsck -C0 -p -f -v /dev/sda5
    # -y auto answers yes for fixes needing response, also see man e2fsck
    sudo e2fsck -f -y -v /dev/sda5
    Last edited by oldfred; July 9th, 2020 at 04:22 PM.
    UEFI boot install & repair info - Regularly Updated :
    https://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  3. #3
    Join Date
    Jul 2020
    Beans
    8

    Re: Unable to access root partition from grub menu

    I don't have any good backups so I can't run those commands . I'm a little confused, sorry, should I boot ubuntu from a usb and try those commands?

    I'm running testdisk in my Windows partition right now. The partition was labeled as Linux filesystem data, and I couldn't read any of the filesystems inside. I tried to change the type to linux /home and /src with ext4 but it still couldn't read the filesystem. I'm performing quick search for partitions and it's taking a long time, stuck at 72%.

  4. #4
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: Unable to access root partition from grub menu

    Best to run Linux repairs from Linux.
    Windows tools have been known to damage Linux partitions as they just do not see them correctly. So not know about testdisk in Windows.

    Use your Ubuntu live installer.
    You want to backup partition table before anything else.
    If testdisk deeper search shows any files, then copy those to your backup drive just in case later you can not get them.

    Also run gdisk as it sees gpt the best of most tools.
    UEFI boot install & repair info - Regularly Updated :
    https://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  5. #5
    Join Date
    Jul 2020
    Beans
    8

    Re: Unable to access root partition from grub menu

    Hello again,

    Thank you for your advice so far. I have gdisk running on my boot repair disk since it is based off of Ubuntu (Lubuntu)

    For /dev/sda, here are the following outputs for basic commands:
    p
    Disk /dev/sda: 976773168 sectors, 465.8 GiB
    Model: ST500LM021-1KJ15
    Sector size (logical/physical): 512/4096 bytes
    Disk identifier (GUID): DDA3B9D5-792B-484E-B540-BC37F1FC154D
    Partition table holds up to 128 entries
    Main partition table begins at sector 2 and ends at sector 33
    First usable sector is 34, last usable sector is 976773134
    Partitions will be aligned on 2048-sector boundaries
    Total free space is 2029 sectors (1014.5 KiB)


    Number Start (sector) End (sector) Size Code Name
    1 2048 534527 260.0 MiB EF00 EFI system partition
    2 534528 567295 16.0 MiB 0C01 Microsoft reserved ...
    3 567296 350593023 166.9 GiB 0700 Basic data partition
    4 974725120 976773119 1000.0 MiB 2700 Basic data partition
    5 350593024 958162943 289.7 GiB 8300
    6 958162944 974725119 7.9 GiB 8200


    i 5 (info on partition 5, my Ubuntu partition I cannot access)
    Partition number (1-6): 5Partition GUID code: 0FC63DAF-8483-4772-8E79-3D69D8477DE4 (Linux filesystem)
    Partition unique GUID: 3F0D5A3F-51B1-7D4B-9675-58DF04EE44A7
    First sector: 350593024 (at 167.2 GiB)
    Last sector: 958162943 (at 456.9 GiB)
    Partition size: 607569920 sectors (289.7 GiB)
    Attribute flags: 0000000000000000
    Partition name: ''


    v
    No problems found. 2029 free sectors (1014.5 KiB) available in 2
    segments, the largest of which is 2014 (1007.0 KiB) in size.

  6. #6
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: Unable to access root partition from grub menu

    Then from live installer have you run fsck?
    man e2fsck

    sudo parted -l
    #From liveDVD/Flash so everything is unmounted,swap off if necessary, change example shown with partition sda5 to your partition(s)
    #e2fsck is used to check the ext2/ext3/ext4 family of file systems. -p tries fixes where response not required, so run both commands
    sudo e2fsck -C0 -p -f -v /dev/sda5
    # -y auto answers yes for fixes needing response, also see man e2fsck
    sudo e2fsck -f -y -v /dev/sda5
    UEFI boot install & repair info - Regularly Updated :
    https://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  7. #7
    Join Date
    Jul 2020
    Beans
    8

    Re: Unable to access root partition from grub menu

    This is my output for sudo parted -l

    Model: ATA ST500LM021-1KJ15 (scsi)
    Disk /dev/sda: 500GB
    Sector size (logical/physical): 512B/4096B
    Partition Table: gpt
    Disk Flags:


    Number Start End Size File system Name Flags
    1 1049kB 274MB 273MB fat32 EFI system partition boot, hidden, esp
    2 274MB 290MB 16.8MB Microsoft reserved partition msftres
    3 290MB 180GB 179GB ntfs Basic data partition msftdata
    5 180GB 491GB 311GB
    6 491GB 499GB 8480MB linux-swap(v1)
    4 499GB 500GB 1049MB ntfs Basic data partition hidden, diag




    Model: General UDisk (scsi)
    Disk /dev/sdb: 1006MB
    Sector size (logical/physical): 512B/512B
    Partition Table: msdos
    Disk Flags:


    Number Start End Size Type File system Flags
    1 1049kB 1006MB 1005MB primary fat32 boot, lba




    Model: Unknown (unknown)
    Disk /dev/zram3: 1029MB
    Sector size (logical/physical): 4096B/4096B
    Partition Table: loop
    Disk Flags:


    Number Start End Size File system Flags
    1 0.00B 1029MB 1029MB linux-swap(v1)




    Model: Unknown (unknown)
    Disk /dev/zram1: 1029MB
    Sector size (logical/physical): 4096B/4096B
    Partition Table: loop
    Disk Flags:


    Number Start End Size File system Flags
    1 0.00B 1029MB 1029MB 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
    Model: General UDisk (scsi)
    Disk /dev/sr0: 233kB
    Sector size (logical/physical): 2048B/2048B
    Partition Table: unknown
    Disk Flags:


    Model: Unknown (unknown)
    Disk /dev/zram2: 1029MB
    Sector size (logical/physical): 4096B/4096B
    Partition Table: loop
    Disk Flags:


    Number Start End Size File system Flags
    1 0.00B 1029MB 1029MB linux-swap(v1)




    Model: Unknown (unknown)
    Disk /dev/zram0: 1029MB
    Sector size (logical/physical): 4096B/4096B
    Partition Table: loop
    Disk Flags:


    Number Start End Size File system Flags
    1 0.00B 1029MB 1029MB linux-swap(v1)


    For the e2fsck commands should I use the partition I want to recover? You say replace /dev/sda5 with my partition but I don't know which partition you are referring to and I don't want to mess anything up even further

  8. #8
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: Unable to access root partition from grub menu

    I changed my generic post to your specific /dev/sda5 as that is your only Linux partition.
    You can only run fsck or e2fsck on unmounted ext2, ext3 or ext4 formatted partitions.
    UEFI boot install & repair info - Regularly Updated :
    https://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  9. #9
    Join Date
    Jul 2020
    Beans
    8

    Re: Unable to access root partition from grub menu

    My output for both of those commands:

    lubuntu@lubuntu:~$ sudo e2fsck -C0 -p -f -v /dev/sda5
    e2fsck: Bad magic number in super-block while trying to open /dev/sda5
    /dev/sda5:
    The superblock could not be read or does not describe a valid ext2/ext3/ext4
    filesystem. If the device is valid and it really contains an ext2/ext3/ext4
    filesystem (and not swap or ufs or something else), then the superblock
    is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
    or
    e2fsck -b 32768 <device>


    lubuntu@lubuntu:~$ sudo e2fsck -f -y -v /dev/sda5
    e2fsck 1.44.1 (24-Mar-2018)
    ext2fs_open2: Bad magic number in super-block
    e2fsck: Superblock invalid, trying backup blocks...
    e2fsck: Bad magic number in super-block while trying to open /dev/sda5


    The superblock could not be read or does not describe a valid ext2/ext3/ext4
    filesystem. If the device is valid and it really contains an ext2/ext3/ext4
    filesystem (and not swap or ufs or something else), then the superblock
    is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
    or
    e2fsck -b 32768 <device>

    Should I give those a try?

  10. #10
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: Unable to access root partition from grub menu

    Next alternative to try to recover is thealternate superblock.

    If that does not work, you should make an image of partition on another drive and run photorec or other scan tools.
    Or just reinstall & restore from backup.
    UEFI boot install & repair info - Regularly Updated :
    https://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •