Fred, I really can't tell you how much I appreciate all your assistance here. I'd be lost without you.
I tried entering the first of the commands you suggested:
sudo sfdisk -A2 /dev/sda
and got the following back
sfdisk: invalid option -- `2'
Fred, I really can't tell you how much I appreciate all your assistance here. I'd be lost without you.
I tried entering the first of the commands you suggested:
sudo sfdisk -A2 /dev/sda
and got the following back
sfdisk: invalid option -- `2'
Sorry this is just an example of the command. You have to replace sda with your drive and 2 with your partition. Probably should have posted this for sdXY. Added space, see below.
sudo sfdisk -A Y /dev/sdX
sudo sfdisk -A 1 /dev/sda
Your Windows boot partition is sda1.
But Boot-Repair copied essential boot files to sda2.
Windows does allow BIOS installs to not have boot partition and have only the one partition, so boot flag can work on either sda1 or should work on sda2.
looks like space between N & partition number is required
https://man7.org/linux/man-pages/man8/sfdisk.8.html
man sfdisk
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.
Okay. So I tried
sudo sfdisk -A 1 /dev/sda
and got
"sfdisk: cannot open 1: no such file or directory"
After reading up on sfdisk a bit, I tried running
sudo sfdisk -V sda
just to check on the partitions
and again it said "sfdisk: cannot open sda: no such file or directory"
Not sure if this is a syntax issue, or if I'm in the wrong directory (if i am, i have no idea what the right directory is or how to get to it), or whether there's something else going on.
sfdisk -l clearly lists all four sda partitions, so obviously it can find the device when it wants to.
sda1
sda2
sda3
sda4
What am I doing wrong?
You have to use full device. Almost all Linux commands are /dev/sda not just sda
I rarely use sfdisk. If using command line I use gdisk as I only use gpt partitions.Code:fred@Z170-jammy:~$ sudo sfdisk -V /dev/sda /dev/sda: No errors detected. Header version: 1.0 Using 10 out of 128 partitions. A total of 601090579 free sectors is available in 6 segments (the largest is 286.6 GiB).
But normally use gparted as I have gui.
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.
Ah. Got the -V thing to work! No errors detected, so that's good.
But why did "sudo sfdisk -A 1 /dev/sda" yield "no such file or directory"?
I always install gparted, so have not used the command, but had it in my files.
I suggest gparted as I know it works.
You can use gparted on umounted partitions. But with old MBR, all logical partitions inside the extended partition are seen as mounted if any partition is mounted. So normal suggest is to use live installer. Ubuntu has gparted. Or you can download a gparted live ISO.
I have two drives so install gparted to use on other drive. And with gpt I can add or modify any unmounted partition just not the mounted ones.
Last edited by oldfred; April 23rd, 2023 at 02:06 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.
Made a GParted live CD, running it now.
Was quickly and easily able to change the boot flag to sda1 by right clicking on the partition and selecting "Manage Flags" and checking the Boot option. Awesome.
HOWEVER
As soon as GParted loaded the GUI or whatever with my partitions displayed, I noticed a warning label on sda1. (The other partitions seem to be fine.) Clicking on it yields the following information:
! Warning:
Unable to detect file system! Possible reasons are:
-The file system is damaged
- The file system is unknown to GParted
-There is no file system available (unformatted)
-The device entry /dev/sda1 is missing
1. Should I be concerned about this, or is it just because it's a Windows partition?
2. What's my next move?
Edited to add: I found this article. Looks useful, but I'm a bit scared to try it. https://www.diskpart.com/articles/gp...-mbr-7201.html. It's advising me to use something called "testdisk." What do you think?
Last edited by arius88; April 24th, 2023 at 02:47 AM.
Testdisk is good for recovering missing partitions. Or perhaps recovery of backup PBR - partition boot sector.
You have sda1, but it does not seem to see it as NTFS.
First you should try chkdsk from a Windows repair disk. If it also gives errors, it may be issue with PBR.
Partition table says NTFS. But Windows NTFS & FAT32 have essential info in the PBR partition boot sector (record). NTFS does have a backup PBR that can be recovered with testdisk or Windows tools.
You want to get to this screen:
http://www.cgsecurity.org/wiki/TestD...ector_recovery
select [Advanced] instead of [Analyze] and select [BackupBS]
[HowTo] Repair the bootsector of a Windows partition - YannBuntu
https://help.ubuntu.com/community/BootSectorFix
http://ubuntuforums.org/showthread.php?t=1926510
Testdisk also can create a new BS, but it used to be the XP type. You then have to run chkdsk from a newer copy of Windows which will convert it to the newer version.
If for example, you installed grub to sda1, it will overwrite the Windows PBR. Testdisk may say it is valid as grub can be in a PBR (but never should be), just not in any Windows formatted partitions.
Last edited by oldfred; April 24th, 2023 at 04:06 AM.
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.
Always good to hear back from you, Fred.
Ran chkdsk from the Windows 7 install disk. No errors, so I'm guessing the PBR is okay.
Going to take a nap and then see what I can do with Testdisk.
If PBR - partition boot sector is not seen as NTFS, chkdsk does not run.
Depending on which parameters you used, you may have repaired it.
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.
Bookmarks