LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-30-2023, 08:02 AM   #1
cloudman16
LQ Newbie
 
Registered: Nov 2023
Distribution: Alpine, fedora
Posts: 6

Rep: Reputation: 1
stuck at grub rescue (attempt to read or write outside of partition)


I recently made the switch to linux I chose alpine and fedora:
I was making a partition using cfdisk with alpinelinux on a 1Tb hard drive, I declared the type to linux filesystem and wrote changes to disk. My pc immediately rebooted and entered grub mode with the following message:: error: attempt to read or write outside of partition
entering grub rescue.
I need some help to get back to my partition or something?
 
Old 11-30-2023, 10:52 AM   #2
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,547

Rep: Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498
Is the 1TB disk you refer to an external or non operating system disk? Creating and formatting a partition won't do what happened in your case and I would not expect the computer to automatically reboot after making a partition change which is what it seems you are saying. Did you use the entire disk to create/format a partition. And again, what if anything was on the disk?
 
1 members found this post helpful.
Old 12-01-2023, 12:50 AM   #3
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,852
Blog Entries: 1

Rep: Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074
Seems to me the partition table change may have invalidated a previously installed Grub, and it may need to be reinstalled if there's still a good OS installation on the disk. If there is none, then wiping 30 or so sectors following the MBR sector could be helpful until such time as you install an OS. Answers to yancek's questions should be telling.
 
1 members found this post helpful.
Old 12-01-2023, 12:50 AM   #4
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,852
Blog Entries: 1

Rep: Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074
Seems to me the partition table change may have invalidated a previously installed Grub, and it may need to be reinstalled if there's still a good OS installation on the disk. If there is none, then wiping 30 or so sectors following the MBR sector could be helpful until such time as you install an OS. Answers to yancek's questions should be telling.
 
1 members found this post helpful.
Old 12-01-2023, 05:41 AM   #5
cloudman16
LQ Newbie
 
Registered: Nov 2023
Distribution: Alpine, fedora
Posts: 6

Original Poster
Rep: Reputation: 1
hi yancek the drive is not an external I was partitioning the pc's internal drive(hdd), I partitioned 128Gib of the drive...
I recently tried rescuing grub with setting the:>set prefix and >set boot commands it still responds the same error "attempt to read or write outside of partition"
let me share more of the grub rescue:
###Note### The following is the current configs, I had made a lot of changes these are not default###NOTE###

Code:
error: attempt to read or write outside of partition
entering grub rescue
>ls
(hd0) (hdo,gpt3) (hd0,gpt2) (hd0,gpt1)
>ls (hd0,gpt3)
filesystem: ext2

> set
root=hd0,gpt3
cmdpath=(hd0,gpt1)/EFI/BOOT
prefix=(hd0,gpt3)/boot/grub
boot=hd0,gpt3
>insmod normal
error: attempt to read or write outside of partition
>
so this is my list of partitions in the drive(I think)
what other crucial information can I provide?
 
Old 12-01-2023, 05:53 AM   #6
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,852
Blog Entries: 1

Rep: Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074
fdisk -l or parted -l input/output would be useful. So would efibootmgr input/output, and content of the installed system's fstab.
 
1 members found this post helpful.
Old 12-01-2023, 06:30 AM   #7
zeebra
Senior Member
 
Registered: Dec 2011
Distribution: Slackware
Posts: 1,834
Blog Entries: 17

Rep: Reputation: 642Reputation: 642Reputation: 642Reputation: 642Reputation: 642Reputation: 642
The best way to go about such a situation is to not panic, and to use a "live cd" or a specialized live cd called a "rescue cd".. It just happens to be that Slackware is an excellent rescue disk (not a cd, but dvd/usb).. With this you can boot the Kernel on the disk, with any available partition as your /root, and set up a full environment to get things fixed.

The best way to go about it, is to use such a disk to boot your pc, then:
1. Analyze the partition situation (intact? content still there?)
2. Repair your bootloader
3. If that doesn't work, repair the rest of your boot sequence (Kernel/init)
4. If that doesn't work, rescue any content you need from the partition(s) or some other more advanced solutions/attempts at repair
 
1 members found this post helpful.
Old 12-04-2023, 02:49 PM   #8
cloudman16
LQ Newbie
 
Registered: Nov 2023
Distribution: Alpine, fedora
Posts: 6

Original Poster
Rep: Reputation: 1
I have live boot and managed to get my important files safe on a usb and just restarted from the beginning. thanks guys zeebra, mrmazda & ywncek
 
1 members found this post helpful.
Old 12-05-2023, 07:50 AM   #9
zeebra
Senior Member
 
Registered: Dec 2011
Distribution: Slackware
Posts: 1,834
Blog Entries: 17

Rep: Reputation: 642Reputation: 642Reputation: 642Reputation: 642Reputation: 642Reputation: 642
Quote:
Originally Posted by cloudman16 View Post
I have live boot and managed to get my important files safe on a usb and just restarted from the beginning. thanks guys zeebra, mrmazda & ywncek
That's great. Good to hear!

Conventional wisdom says to ALWAYS use backups when doing major system operations. And that's true for everyone. I can't say how many times I've gotten myself into such situations (and out quite often too), but my experience verifies to me the correctness of the conventional wisdom. And still also.. No matter how many times you've done these things, and feel 100% sure everything will be fine (you know these things in and out), you should still ALWAYS make backups when doing major system operations.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Welcome to grub rescue!. Error: attempt to read or write outside of partition AsadtheMonster Linux - Newbie 4 01-17-2022 11:51 PM
[SOLVED] error: attempt to read or write outside partition viv_linux Linux - Newbie 1 11-21-2014 09:43 AM
[SOLVED] error: attempt to read or write outside of disk 'hd0' -- entering rescue mode vienswuer Linux - Distributions 4 09-16-2014 11:00 PM
Error: attempt to read or write outside of disk 'hd0' Entering rescue mode . . . grub lynyl Ubuntu 3 08-05-2014 11:11 PM
Infinite Grub Loop: GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB... beeblequix MEPIS 2 11-02-2013 10:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration