# Exhd mounting/recovery. **SOLVED**

## todd93

Hi, as many of you know, I've just freshly reinstalled Gentoo after a couple of years of not using it. I'd like to say that I had no real reason for doing this, however, that wouldn't be true. I have an external hd that wouldn't show up in windows, I first thought that it may be the enclosure, so I purchased a new docking bay for my 2 1TB hds. Unfortunately, that wasn't the problem, after a scan with some software in Windows, I've found that something happened during unmounting in Windows causing the file system to be corrupted on these disks. Of course, the software could recover the drives for quite a bit of $$, I knew that there has to be some way I can do this in Gentoo without unnecessary expense/trouble...

When I turn the docking bay on, both HDs show up, however, when I click on them, I get the following warning: 

```
Unable to mount location

  Can't mount file
```

The output of lsblk:

```
$ lsblk -o +fstype,label,uuid,partuuid

NAME MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS FSTYPE LABEL UUID                                   PARTUUID

sda    8:0    0 465.8G  0 disk                                                                 

├─sda1

│      8:1    0   500M  0 part             ntfs   System Reserved

│                                                       CA447847447837F1                       366d2ddb-01

├─sda2

│      8:2    0 464.4G  0 part /mnt/windows

│                                          ntfs         C812801312800920                       366d2ddb-02

└─sda3

       8:3    0   858M  0 part             ntfs         C03434FC3434F6CE                       366d2ddb-03

sdb    8:16   0 931.5G  0 disk                                                                 

├─sdb1

│      8:17   0   512M  0 part /mnt/ubuntu vfat         F1D8-DD5C                              121b4259-30a6-4349-a709-5d1af8bdbd4f

├─sdb2

│      8:18   0   244M  0 part             ext2         6fb4be7d-7d8a-471a-96cb-76f6f49e28ee   0d003d32-6bc4-44c4-9a71-aa78ed1afbde

└─sdb3

       8:19   0 930.8G  0 part             LVM2_m       4p43Sh-sdQt-uA0O-Ldp2-Z5WA-hoqU-XXF9i4 599feb92-705e-4073-9c13-b8e4f09025ee

  ├─ubuntu--vg-root

  │  253:0    0 926.8G  0 lvm              ext4         2d51638b-11e3-4f23-9a72-ac00eab4cb9e   

  └─ubuntu--vg-swap_1

     253:1    0   3.9G  0 lvm              swap         a0591fba-4d72-40cc-a10b-4c9c9f2a1ff8   

sdc    8:32   0 931.5G  0 disk                                                                 

├─sdc1

│      8:33   0   100M  0 part             ntfs   System Reserved

│                                                       663E395F3E392987                       a08b42f3-01

└─sdc2

       8:34   0 931.4G  0 part /mnt/oldwin ntfs         F24A3C7C4A3C3FA1                       a08b42f3-02

sdd    8:48   0 465.8G  0 disk                                                                 

├─sdd1

│      8:49   0   256M  0 part /boot       vfat         99FC-DE47                              c651cc85-01

├─sdd2

│      8:50   0     4G  0 part [SWAP]      swap         b2b1f66a-977a-4356-8bba-5912f658ff03   c651cc85-02

└─sdd3

       8:51   0 461.5G  0 part /           ext4         bb114566-68e9-47bc-9d8d-7dd64deaa260   c651cc85-03

sde    8:64   1     0B  0 disk                                                                 

sdf    8:80   1     0B  0 disk                                                                 

sdg    8:96   1     0B  0 disk                                                                 

sdh    8:112  1     0B  0 disk                                                                 

sdi    8:128  1     0B  0 disk                                                                 

sdj    8:144  1     0B  0 disk                                                                 

sdk    8:160  1     0B  0 disk                                                                 

sdl    8:176  1     0B  0 disk                                                                 

sdm    8:192  1     0B  0 disk                                                                 

sdn    8:208  1     0B  0 disk                                                                 

sdo    8:224  0 931.5G  0 disk                                                                 

sdp    8:240  0 931.5G  0 disk                                                                 

sr0   11:0    1  1024M  0 rom                                                                  

sr1   11:1    1  1024M  0 rom
```

The drives I'm having trouble with are sdo and sdp.

If anyone has any advice on this, I would welcome it. I apologize if I put this in the wrong thread, however, I consider it to be a hardware problem, since the drives won't mount. I'm pretty sure the filesystem for the drives is ntfs, however, it could also be Fat32. I honestly can't remember.

Thanks

ToddLast edited by todd93 on Wed Aug 03, 2022 12:05 am; edited 1 time in total

----------

## mike155

Please turn off your external hd.

Run 'dmesg'

Turn on your external hd.

Run 'dmesg' again

Please post all messages that were printed in step 4, but not in step 2

Please post the output of

```
fdisk -l /dev/sdo

fdisk -l /dev/sdp
```

----------

## todd93

I did notice a difference in the two outputs... Step 4 dmesg output:

https://pastebin.com/m16tc4AS

```
# fdisk -l /dev/sdo

Disk /dev/sdo: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors

Disk model: Dual SATA Bridge

Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 33553920 bytes

Disklabel type: dos

Disk identifier: 0xc6786850
```

```
# fdisk -l /dev/sdp

Disk /dev/sdp: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors

Disk model: Dual SATA Bridge

Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 33553920 bytes

Disklabel type: dos

Disk identifier: 0xc6786851
```

Thanks

Todd

----------

## mike155

It looks like /dev/sdo and /dev/sdp do not have a partition table - which would be strange for disks, but probably okay for USB sticks. It does NOT look like a hardware error.

What happens if you run

```
mkdir /mnt/sdo

mkdir /mnt/sdp

mount /dev/sdo /mnt/sdo

mount /dev/sdp /mnt/sdp

ls -la /mnt/sdo

ls -la /mnt/sdp

```

----------

## todd93

 *mike155 wrote:*   

> It looks like /dev/sdo and /dev/sdp do not have a partition table - which would be strange for disks, but probably okay for USB sticks. It does NOT look like a hardware error.

 

Normally, yes, that would be correct, but this problem just recently arose in Windows, due to some sort of unclean unmounting of the drives, or so I suspect. Unfortunately, neither are no longer detectable in Windows. 

 *Quote:*   

> What happens if you run
> 
> ```
> mkdir /mnt/sdo
> 
> ...

 

```
 # mount /dev/sdo /mnt/sdo

mount: /mnt/sdo: wrong fs type, bad option, bad superblock on /dev/sdo, missing codepage or helper program, or other error.

# mount /dev/sdp /mnt/sdp

mount: /mnt/sdp: wrong fs type, bad option, bad superblock on /dev/sdp, missing codepage or helper program, or other error.
```

I'm getting the same error for both disks when I attempt to mount them... I'm not sure what could have caused them to get corrupted filesystems, possibly a power outage at one point when the hd was on and mounted in Windows. I do know for a fact that all the data is still on the drives.

Thanks

Todd

----------

## mike155

Okay, what do the commands below print:

```
file -s /dev/sdo

file -s /dev/sdp
```

----------

## todd93

 *mike155 wrote:*   

> Okay, what do the commands below print:
> 
> ```
> file -s /dev/sdo
> 
> ...

 

```
# file -s /dev/sdo

/dev/sdo: DOS/MBR boot sector MS-MBR Windows 7 english at offset 0x163 "Invalid partition table" at offset 0x17b "Error loading operating system" at offset 0x19a "Missing operating system", disk signature 0xc6786850
```

```
# file -s /dev/sdp

/dev/sdp: DOS/MBR boot sector MS-MBR Windows 7 english at offset 0x163 "Invalid partition table" at offset 0x17b "Error loading operating system" at offset 0x19a "Missing operating system", disk signature 0xc6786851
```

----------

## mike155

This looks like disks once had a partition table. The partition tables were destroyed. We don't know why. You could try to restore the partition tables with a program like testdisk.

```
* app-admin/testdisk

     Available versions:  7.1-r1 {ewf jpeg ntfs qt5 reiserfs static zlib}

     Homepage:            https://www.cgsecurity.org/wiki/TestDisk

     Description:         Checks and undeletes partitions + PhotoRec, signature based recovery tool

```

----------

## NeddySeagoon

todd93,

Don't let testdisk write a partition table.

When it finds something, we can go fishing with -o ro,offset=...

No partition table required.

The first 4 partitions are saved in the partition table.

Logical partitions are in the form of a linked list at the start of each logical partition.

When you get a false positive logical partition, the data in that sector will be overwritten.

Were these disks used by Windows Logical Disk Manager?

Also known as Dynamic Disks?

----------

## todd93

NeddySeagoon,

Thank you, and unfortunately it didn't seem to find anything. I fear that I may have left out a bit of information. I had both of these drives in a USB hard drive enclosure... As memory serves, I think they were both seen collectively as one drive (of course, I could be mistaken about that). I originally thought that the hard drive enclosure was possibly bad, that's why I thought it was a good idea to try a new one, and ended up with a 2 bay docking station. The enclosure could be bad, as I put them back in it, and it's not seen by the system.

I will again try testdisk and post the output here, I will not allow it to do anything more than what is advised here.

I'm not sure they were dynamic, but I could be wrong about that, that's not sounding right, though.

Thanks

Todd

----------

## mike155

 *todd93 wrote:*   

> As memory serves, I think they were both seen collectively as one drive (of course, I could be mistaken about that).

 

Was it a RAID system? Was it RAID 1 (mirroring) or RAID 0 (striping)?

----------

## todd93

 *mike155 wrote:*   

>  *todd93 wrote:*   As memory serves, I think they were both seen collectively as one drive (of course, I could be mistaken about that). 
> 
> Was it a RAID system? Was it RAID 1 (mirroring) or RAID 0 (striping)?

 

No, definitely not a RAID system.

----------

## mike155

Can you tell us the manufacturer and model of the docking bay / hard drive enclosure, please?

----------

## NeddySeagoon

todd93,

If it was Windows Logical Disk Manager making both drives appear as one, its slight of hand by windows for RAID of some sort.

What does

```
 fdisk -l -t dos /dev/...
```

and 

```
fdisk -l -t gpt /dev/...
```

say for both drives.

Its possible that if they had a gpt disklable, the protective dos disklable was destroyed along with the primary copy of a gpt table but the backup gpt may have survived.

Testdisk should have fount that though.

Were the drives used in Linux, Windows, or both?

----------

## todd93

Mike155, the docking bay is Sabrent EC-HD2B

https://www.amazon.com/dp/B0759567JT?ref=ppx_yo2ov_dt_b_product_details&th=1

NeddySeagoon,

```
# fdisk -l -t dos /dev/sdo

Disk /dev/sdo: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors

Disk model: Dual SATA Bridge

Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 33553920 bytes

Disklabel type: dos

Disk identifier: 0xc6786850
```

```
# fdisk -l -t dos /dev/sdp

Disk /dev/sdp: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors

Disk model: Dual SATA Bridge

Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 33553920 bytes

Disklabel type: dos

Disk identifier: 0xc6786851
```

```
# fdisk -l -t gpt /dev/sdo

Disk /dev/sdo: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors

Disk model: Dual SATA Bridge

Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 33553920 bytes
```

```
# fdisk -l -t gpt /dev/sdp

Disk /dev/sdp: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors

Disk model: Dual SATA Bridge

Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 33553920 bytes
```

Thank you!

----------

## NeddySeagoon

todd93,

It looks like the drives had a MSDOS disk label at some time as

```
Disklabel type: dos

Disk identifier: 0xc6786850

Disklabel type: dos

Disk identifier: 0xc6786851
```

With a GPT disk label, the identifiers are zero.

However, real identifiers are 32 bit random numbers and your two are only 1 apart.

That's a 1 in 4Gi probability.

Lets play the daft laddie and see what we find.

The first partition starts at sector 63 on at sector 2048, depending on when the drive was partitioned.

Turning those numbers into bytes by multiplying by 512 we get 32256 and 1048576. Lets see if we can find a filesystem there.

```
mount -o ro,offset=32256 /dev/sdo /mnt/someplace
```

Read only for safety. It really is the whole device in the mount command as we don't have a partition table.

The offset=32256 says to mount the filesystem that starts 32256 bytes from the start of the block device gives

Try all four combinations, and post back.

----------

## todd93

NeddySeagoon,

This is quite an interesting exercise! Unfortunately, I have the same error on all four combinations... It is as follows:

```
# mount -o ro,offset=32256 /dev/sdo /mnt/sdo

mount: /mnt/sdo: wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error.
```

```
# mount -o ro,offset=1048576 /dev/sdo /mnt/sdo

mount: /mnt/sdo: wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error..
```

```
# mount -o ro,offset=32256 /dev/sdp /mnt/sdp

mount: /mnt/sdp: wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error.
```

```
# mount -o ro,offset=1048576 /dev/sdp /mnt/sdp

mount: /mnt/sdp: wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error.
```

Hopefully this tells us something.

Thanks

Todd

----------

## NeddySeagoon

todd93,

It tells that none of the filesystems available in your kernel could mount any filesystem that may be at those locations, or that there are no filesystems there to mount.

Do you know what filesystems were there and if the drives were partitioned in Windows or Linux?

----------

## todd93

NeddySeagoon,

As memory serves, I'm certain that I partitioned the drives in Windows

----------

## NeddySeagoon

todd93,

Does that mean that they should have NTFS or FAT32 filesystems? 

Are those filesystems available to your kernel?

If they are modules, the modules will need to be loaded before the mount command.

----------

## todd93

NeddySeagoon,

I'm sure they are NTFS, as I was wanting to be able to access them from both Linux and Windows... I do have both Fat32 and NTFS built as modules in my kernel, and the modules are loaded, as I have both my other NTFS drives mounted during boot in Gentoo.

Thanks

Todd

----------

## pietinger

 *todd93 wrote:*   

> 
> 
> ```
> # ...
> 
> ...

 

Only to be safe against this kind of error ... what do you have configured here

```
File systems  --->

    DOS/FAT/EXFAT/NT Filesystems  --->

        (437) Default codepage for FAT

        (iso8859-1) Default iocharset for FAT
```

and here ?

```
File systems  --->

    -*- Native language support  --->

        ???
```

----------

## NeddySeagoon

todd93,

Do you have any webspace to put a binary file for me to download and look at?

I would like to see the first 2MiB of each drive, so I can put it into a hex editor.

Its difficult to describe what to do because it depends on what's there.

----------

## todd93

NeddySeagoon, 

I apologize for the long hiatus this week, been a rough week at work for me! I do have some Google Drive space, if that would work, if it needs to be something else, I can come up with something, I'm sure...

----------

## NeddySeagoon

todd93,

As long as Google does not want me to log in, that's fine.

email works too as long as the email is under 1MB.

If you opt for email, I would like you permission to host the files for your other supporters here.

----------

## todd93

NeddySeagoon, 

I have no problem with email, it would probably be the simplest, as long as what is needed is under the max size of 1mb. However, I wouldn't mind a place with a nice cloud that is more user-friendly for us Gentooers

----------

## NeddySeagoon

todd93,

As I want two 2Mb files, compress them and pt them in separate files.

If the contents are mostly zero bytes, they will compress nicely.

----------

## todd93

NeddySeagoon, 

I can do that, but you'll have to walk me through what you need, and how to compress them. I will be honest, I haven't done anything along the lines of compressing files in Linux in quite some time, many years, actually. But I'm happy to do whatever is needed.

Thanks

Todd

----------

## NeddySeagoon

todd93,

Plug the drives in but do not try to mount anything.

I want to see the first 2MiB of each drive.

```
dd if=/dev/sdo of=/root/sdo.bin bs=2M count=1
```

will make a 2MiB file called /root/sdo.bin

That's too big for email.

```
cd /root
```

you may well be there already.

Run 

```
bzip2 -9 sdo.bin
```

sdo.bin will be replaced with a smaller sdo.bin.bz2 file.

Well, it will be smaller unless that 2MiB is full of random data, which cannot be compressed. Then it will be bigger :)

Rinse and repeat for the other drive.

The  -9 means best compression.

email me the *.bin.bz2 files.

My email address should be visible to logged in users, unless I've set my forums account up incorrectly years ago.

----------

## todd93

NeddySeagoon,

Ok, you should have mail

----------

## NeddySeagoon

todd93,

```
~/Downloads $ ls -al 

-rw-r--r--   1 roy users 888703 Apr 16 15:39 sdo.bin.bz2

-rw-r--r--   1 roy users    527 Apr 16 15:40 sdp.bin.bz2
```

That's interesting. It means that one is mostly empty and one is not.

```
~/Downloads $ ls -l

-rw-r--r-- 1 roy users 2097152 Apr 16 15:39 sdo.bin

-rw-r--r-- 1 roy users 2097152 Apr 16 15:40 sdp.bin
```

and its not because you made files the wrong size. That's exactly right.

Looking at  

```
hexedit sdp.bin
```

at the end of the boot record is

```
00000160   24 02 C3 49  6E 76 61 6C  69 64 20 70  61 72 74 69  $..Invalid parti

00000170   74 69 6F 6E  20 74 61 62  6C 65 00 45  72 72 6F 72  tion table.Error

00000180   20 6C 6F 61  64 69 6E 67  20 6F 70 65  72 61 74 69   loading operati

00000190   6E 67 20 73  79 73 74 65  6D 00 4D 69  73 73 69 6E  ng system.Missin

000001A0   67 20 6F 70  65 72 61 74  69 6E 67 20  73 79 73 74  g operating syst

000001B0   65 6D 00 00  00 63 7B 9A  51 68 78 C6  FF FF 00 00  em...c{.Qhx.....

000001C0   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................

000001D0   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................

000001E0   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................

000001F0   00 00 00 00  00 00 00 00  00 00 00 00  00 00 55 AA  ..............U.
```

The strings look very windowsesque. Grub says grub a few times there.

The 55 AA at the end is the signature, that signifies a valid MSDOS partition table.

Its there, but its empty. Its those 00 bytes.

The rest of the file is 0xFF bytes, which compress very well.  The drive may have been deliberately wiped.

sdo.bin starts off the same but it appears to have a backup copy of the MBR at address 

0x2000. 

```
00002000   33 C0 8E D0  BC 00 7C FB  50 07 50 1F  FC BE 1B 7C  3.....|.P.P....|

00002010   BF 1B 06 50  57 B9 E5 01  F3 A4 CB BD  BE 07 B1 04  ...PW...........

00002020   38 6E 00 7C  09 75 13 83  C5 10 E2 F4  CD 18 8B F5  8n.|.u..........

00002030   83 C6 10 49  74 19 38 2C  74 F6 A0 B5  07 B4 07 8B  ...It.8,t.......

00002040   F0 AC 3C 00  74 FC BB 07  00 B4 0E CD  10 EB F2 88  ..<.t...........

00002050   4E 10 E8 46  00 73 2A FE  46 10 80 7E  04 0B 74 0B  N..F.s*.F..~..t.

00002060   80 7E 04 0C  74 05 A0 B6  07 75 D2 80  46 02 06 83  .~..t....u..F...

00002070   46 08 06 83  56 0A 00 E8  21 00 73 05  A0 B6 07 EB  F...V...!.s.....

00002080   BC 81 3E FE  7D 55 AA 74  0B 80 7E 10  00 74 C8 A0  ..>.}U.t..~..t..

00002090   B7 07 EB A9  8B FC 1E 57  8B F5 CB BF  05 00 8A 56  .......W.......V

000020A0   00 B4 08 CD  13 72 23 8A  C1 24 3F 98  8A DE 8A FC  .....r#..$?.....

000020B0   43 F7 E3 8B  D1 86 D6 B1  06 D2 EE 42  F7 E2 39 56  C..........B..9V

000020C0   0A 77 23 72  05 39 46 08  73 1C B8 01  02 BB 00 7C  .w#r.9F.s......|

000020D0   8B 4E 02 8B  56 00 CD 13  73 51 4F 74  4E 32 E4 8A  .N..V...sQOtN2..

000020E0   56 00 CD 13  EB E4 8A 56  00 60 BB AA  55 B4 41 CD  V......V.`..U.A.

000020F0   13 72 36 81  FB 55 AA 75  30 F6 C1 01  74 2B 61 60  .r6..U.u0...t+a`

00002100   6A 00 6A 00  FF 76 0A FF  76 08 6A 00  68 00 7C 6A  j.j..v..v.j.h.|j

00002110   01 6A 10 B4  42 8B F4 CD  13 61 61 73  0E 4F 74 0B  .j..B....aas.Ot.

00002120   32 E4 8A 56  00 CD 13 EB  D6 61 F9 C3  49 6E 76 61  2..V.....a..Inva

00002130   6C 69 64 20  70 61 72 74  69 74 69 6F  6E 20 74 61  lid partition ta

00002140   62 6C 65 00  45 72 72 6F  72 20 6C 6F  61 64 69 6E  ble.Error loadin

00002150   67 20 6F 70  65 72 61 74  69 6E 67 20  73 79 73 74  g operating syst

00002160   65 6D 00 4D  69 73 73 69  6E 67 20 6F  70 65 72 61  em.Missing opera

00002170   74 69 6E 67  20 73 79 73  74 65 6D 00  00 00 00 00  ting system.....

00002180   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................

00002190   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................

000021A0   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................

000021B0   00 00 00 00  00 2C 44 63  F8 D7 A1 CA  00 00 80 01  .....,Dc........

000021C0   01 00 07 FE  FF FF 3F 00  00 00 43 B3  E0 E8 00 00  ......?...C.....

000021D0   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................

000021E0   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................

000021F0   00 00 00 00  00 00 00 00  00 00 00 00  00 00 55 AA  ..............U.
```

There is a partition table entry there too.

```
000021B0   xx xx xx xx  xx xx xx xx  xx xx xx xx  xx x 80 01  .....,Dc........

000021C0   01 00 07 FE  FF FF 3F 00  00 00 43 B3  E0 E8 
```

We will decode that later ... reading on ...

```
00009F80   EB F2 C3 0D  0A 41 20 64  69 73 6B 20  72 65 61 64  .....A disk read

00009F90   20 65 72 72  6F 72 20 6F  63 63 75 72  72 65 64 00   error occurred.

00009FA0   0D 0A 4E 54  4C 44 52 20  69 73 20 6D  69 73 73 69  ..NTLDR is missi

00009FB0   6E 67 00 0D  0A 4E 54 4C  44 52 20 69  73 20 63 6F  ng...NTLDR is co

00009FC0   6D 70 72 65  73 73 65 64  00 0D 0A 50  72 65 73 73  mpressed...Press

00009FD0   20 43 74 72  6C 2B 41 6C  74 2B 44 65  6C 20 74 6F   Ctrl+Alt+Del to

00009FE0   20 72 65 73  74 61 72 74  0D 0A 00 00  00 00 00 00   restart
```

That will be Windows then.

There are strings relating to Xbox Backup Creator v2.9 there.

The drive has not been wiped, it looks like the fist 2MiB from a disk that has had the partitions deleted from the partition table.

The gory details of partition table entries are on wikipedia.

21BE 80, Thats the bootable set. The next tree bytes are 01 01 00, which is the CHS start address of the partition.

We don't care about that as its been obsolete and ignored since before drives reached 4GB. 

For completness, it means Head 1, Sector 1 Cylinder 0.

The 07 is the partition type, it has several meaning but its probably Windows NT, an NTLDR appears in the file too.

The FE  FF FF is the CHS address of the last sector. We don't care about that. Decoding it is left as an exercise for the reader.

The 3F 00  00 00, is the LBA of the start of the partition.

The 43 B3  E0 E8 is the number of sectors in the partition.

The x86 CPUs are little endian, so those 32 bit numbers are low byte first.

Fixing the byte order to make in more human readable, that start sector is 00 00 00 3F, or just 3F, which is sector 63, which was an early guess for offset=.

The sector count is E8 E0 B3 43, according to by hex calculator, that's 3907040067 sectors. That's 976.76001675GB which is a 1TB drive full.

Sector 63 starts at address 7E00 in the file but that's blank until address 9E00.

I need to have a look at a real NTFS drive but it seems as if there is an NTFS filesystem there but not where I would expect it to be.

More later.

----------

## NeddySeagoon

todd93,

A real NTFS partition starts

```
EB 52 90 4E  54 46 53 20  20 20 20 00  02 08 00 00  .R.NTFS    .....
```

so it looks like you have one of those at address 9E00, rather than the 00007E00 advertised by the partition table, which is 0x2000 out of place.

9E00 is offset=40448 if you want to try to mount it.

Its NTFS, so be sure that your have an ntfs driver loaded before you try.

```
mount -o ro,offset=40448 -t <your ntfs_driver>  /dev/sdo /mnt/someplace
```

I fully expect it to fail because its 8kiB away from where it should be.

That makes me wonder it its a disk image written to a disk with 8k at the start for some reason.

Some virtualisation tools do things like that too.

Don't give up on sdp yet. Run 

```
strings /dev/sdp
```

and wait.

It will read the entire drive and print any string fragments it finds.

----------

## todd93

NeddySeagoon, 

This is all extremely fascinating! Just incredible the things you have found from that information! 

I am using ntfs3g, which I assume is the common ntfs driver, so if I was to enter:

```
mount -o ro,offset=40448 -t ntfs3g  /dev/sdo /mnt/sdo
```

Would that be correct? /mnt/sdo is a directory that already exists for the purpose of mounting this drive.

Thanks

Todd

----------

## NeddySeagoon

todd93,

It's the result of a misspent youth :)

Its either -t ntfs3g or -t ntfs-3g. I don't know which.

----------

## todd93

NeddySeagoon,

Looks more like a very educational youth to me! You were right, I did receive an error:

```
# mount -o ro,offset=40448 -t ntfs-3g  /dev/sdo /mnt/sdo

Failed to read last sector (3907040065): Invalid argument

HINTS: Either the volume is a RAID/LDM but it wasn't setup yet,

   or it was not setup correctly (e.g. by not using mdadm --build ...),

   or a wrong device is tried to be mounted,

   or the partition table is corrupt (partition is smaller than NTFS),

   or the NTFS boot sector is corrupt (NTFS size is not valid).

Failed to mount '/dev/loop0': Invalid argument

The device '/dev/loop0' doesn't seem to have a valid NTFS.

Maybe the wrong device is used? Or the whole disk instead of a

partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
```

And:

```
strings /dev/sdp
```

Is still running, has been for a good while... We're getting ready to leave for the evening, so I assume it will be completed by the time we get home later tonight...

Thanks

Todd

----------

## NeddySeagoon

todd93,

Lets sneak up on it slowly 

Try 

```
losetup -o 8192 -P /dev/sdo
```

and read 

```
man losetup
```

This sets up a loop device as if it were a real block device, starting  8kiB (8192B from the start of sdo.

It will scan the partition table, too, if it finds it.

If /dev/loop0 is used and I've got the arithmetic right, you will have a /dev/loop0p1 which is the partition holding the filesystem that you want to mount.

```
fdisk -l /dev/loop0
```

should show the partition table too.

If all is well and /dev/loop1p1 exists, try 

```
mount -o ro -t ntfs--3g /dev/loop1p1 ...
```

No o=<offset>, we are reading the partition table and the kernel is doing the arithmetic.

It's better at it than me :)

strings is reading the entire drive. It will take a few hours.

----------

## todd93

NeddySeagoon,

Ok, strings is finished, but I tried what you suggested, and got the following error:

```
# losetup -o 8192 -P /dev/sdo

losetup: /dev/sdo: failed to use device: No such device
```

Here's the tail end of the output of strings:

```
179.500520344,-84.7905356359999,0

              179.512700739,-84.790049312,0

              179.525248285,-84.7895339229999,0

              179.538237422,-84.7889864099999,0

              179.562035359,-84.7879513649999,0

              179.588385502,-84.7867669189999,0

              179.614740221,-84.7855545789999,0

              179.643333613,-84.7842233469999,0

              179.684599871,-84.7823065139999,0

              179.705447488,-84.7813542779999,0

              179.72420874,-84.7805137589999,0

              179.745551421,-84.7795825969999,0

              179.765555066,-84.7787397149999,0

              179.78460309,-84.7779689759999,0

              179.802891114,-84.7772625069999,0

              179.813927557,-84.7768537109999,0

              179.824755896,-84.7764664359999,0

              179.835398935,-84.7760998669999,0

              179.845874659,-84.7757533859999,0

              179.856202549,-84.7754263549999,0

              179.866392545,-84.7751184669999,0

              179.876456784,-84.7748293559999,0

              179.886405406,-84.7745587309999,0

              179.896261951,-84.7743059839999,0

              179.906019971,-84.7740713159999,0

              179.91568694,-84.7738545459999,0

              179.925269329,-84.7736555299999,0

              179.934774013,-84.7734741269999,0

              179.944205497,-84.7733102529999,0

              179.953568804,-84.7731638209999,0

              179.962868386,-84.773034762,0

              179.981253574,-84.7728029539999,0

              180,-84.7725916459999,0

              180,-84.943384234,0

            </coordinates>

          </LineString>

        </MultiGeometry>

      </Placemark>

    </Folder>

    <NetworkLink>

      <Region>

        <LatLonAltBox>

          <north>-45</north>

          <south>-90</south>

          <east>135</east>

          <west>90</west>

        </LatLonAltBox>

        <Lod>

          <minLodPixels>256</minLodPixels>

          <maxLodPixels>8192</maxLodPixels>

        </Lod>

      </Region>

      <Link>

        <href>0320.kmz</href>

        <viewRefreshMode>onRegion</viewRefreshMode>

      </Link>

    </NetworkLink>

    <NetworkLink>

      <Region>

        <LatLonAltBox>

          <north>-45</north>

          <south>-90</south>

          <east>180</east>

          <west>135</west>

        </LatLonAltBox>

        <Lod>

          <minLodPixels>256</minLodPixels>

          <maxLodPixels>8192</maxLodPixels>

        </Lod>

      </Region>

      <Link>

        <href>0323.kmz</href>

        <viewRefreshMode>onRegion</viewRefreshMode>

      </Link>

    </NetworkLink>

  </Document>

</kml>

687.pngPK

doc.kmlPK

NTFS    

fXfX

A disk read error occurred

NTLDR is missing

NTLDR is compressed

Press Ctrl+Alt+Del to restart
```

Thanks

Todd

----------

## NeddySeagoon

todd93,

Try 

```
losetup -o 8192 -P -f /dev/sdo 
```

It's a long time since I've done this.

```
NTFS   

fXfX

A disk read error occurred

NTLDR is missing

NTLDR is compressed

Press Ctrl+Alt+Del to restart
```

Thats interesting.

Its probably a NTFS filesystem near the end of the disk, as its last.

I don't want a whole 1TB in my email to look at though. :)

The HTML shows that there is something on the drive, so its not wiped.

-- edit --

From an earlier post

```
# fdisk -l /dev/sdp

Disk /dev/sdp: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors 
```

The last 2MB may be interesting. It could contain a backup GPT.

Thats 4096 512B blocks

Working with bs=512

```
dd if=/dev/sdp skip= of=/root/sdp_end.bin skip=1953521072 bs=512 
```

That might take a while, depending on how skip is implemented.

It will output everything after the first 1953521072 sectors, which will be about 2MiB. There may be an out by one error but that wont matter.

Then compress and email as you did before.

----------

## todd93

NeddySeagoon,

Ok, losetup worked somewhat, the new command you gave me worked, then I get the following:

```
# fdisk -l /dev/loop0

Disk /dev/loop0: 931.51 GiB, 1000204877824 bytes, 1953525152 sectors

Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disklabel type: dos

Disk identifier: 0xcaa1d7f8

Device       Boot Start        End    Sectors  Size Id Type

/dev/loop0p1 *       63 3907040129 3907040067  1.8T  7 HPFS/NTFS/exFAT
```

Followed by:

```
# mount -o ro -t ntfs--3g /dev/loop1p1

mount: /dev/loop1p1: can't find in /etc/fstab.
```

Which I assume just requires a new entry into fstab, but I don't know...

Then I get this on sdp:

```
# dd if=/dev/sdp skip= of=/root/sdp_end.bin skip=1953521072 bs=512

dd: invalid number: ‘’
```

Thanks

Todd

----------

## Hu

 *todd93 wrote:*   

> Followed by:
> 
> ```
> # mount -o ro -t ntfs--3g /dev/loop1p1
> 
> ...

 The example that Neddy showed had an ellipsis where you are supposed to provide the mount point.  If you do not provide both the source device and the mount point, then mount will look in /etc/fstab to guess the missing value.  If you provide both, then mount will not use /etc/fstab and will rely solely on what you entered on the command line. *todd93 wrote:*   

> Then I get this on sdp:
> 
> ```
> # dd if=/dev/sdp skip= of=/root/sdp_end.bin skip=1953521072 bs=512
> 
> ...

 You have two instances of skip=, and the first one has no value.  Neddy's example has that same error.  Remove the skip= argument and try again.  Keep the skip=1953521072.

----------

## todd93

Hu,

Ok, that got a much better result:

```
# dd if=/dev/sdp of=/root/sdp_end.bin skip=1953521072 bs=512

4096+0 records in

4096+0 records out

2097152 bytes (2.1 MB, 2.0 MiB) copied, 0.0620723 s, 33.8 MB/s
```

Regarding fstab, what should the entry be there? You will have to forgive me, I'm not very experienced in altering fstab, as I don't need to do it much, and on this latest install, I was able to copy over my previous fstab, as nothing had really changed hardware wise on my system...

Thanks

Todd

----------

## NeddySeagoon

todd93,

That looks better.  That's the partition table at 0x2000 from the start of sdo.

```
 Device       Boot Start        End    Sectors  Size Id Type

/dev/loop0p1 *       63 3907040129 3907040067  1.8T  7 HPFS/NTFS/exFAT
```

Eww... a 1.8T partition on a 1Tb drive.  That indicates that in was a part of a Windows Dynamic Disk raid0.

There are two sorts of raid0.

1. Striped, where blocks are written first to one block device, then the other. This provides increased I/O speed.

2. Linear, where the block devices are joined end to end.

They both have the disadvantage, that all of the component devices are required to be able to mount the filesystem.

Its really aid, no R. The R means redundant and raid0 isn't

Now we know that the the filesystem is too big for a single drive 

```
mount -o ro -t ntfs-3g /dev/loop1p1
```

 is going to fail, as only half the filesystem is there.

Either the first half or only odd/even numbered stripes.

That command is missing the /mnt/someplace at the end.

Its the lazy form of mount, which forces /etc/fstab to be consulted.

```
dd if=/dev/sdp skip= of=/root/sdp_end.bin skip=1953521072 bs=512
```

Oops, Too many skips.

```
dd if=/dev/sdp of=/root/sdp_end.bin skip=1953521072 bs=512
```

Next, I feel a kernel rebuild coming on. Linux understands Windows Dynamic Disks.

Add 

```
CONFIG_LDM_PARTITION
```

Read the context sensitive help on the option and possibly the reference material mentioned in the help.

Its in the Advanced partition selection menu.

That may well explain The strange Disk IDs, two adjacent 32 bit random numbers.  

If you are really lucky, it may just work with that support.

The output of dmesg will be interesting, if not.

After you rebuild your kernel and boot into it, run 

```
uname -a
```

and inspect the date and time.

That's the build date and time of the running kernel. It should be about nowish, if its your new kernel. 

I gave up using Windows at home in 2002, so I am pushing the limits of my knowledge now.

== edit ==

It looks like you will need ldmtool to put everything together but maybe not.

== another edit ==

There is an ebuild in https://bugs.gentoo.org/700960, that makes Windown Dynamic Disks work with lvm2 which will want some more kernel options

```
CONFIG_MD

CONFIG_BLK_DEV_MD

CONFIG_MD_RAID0

CONFIG_BLK_DEV_DM
```

The ebuild does not check for them.

----------

## todd93

NeddySeagoon,

Kernel building was greatly timed, as I did have a new kernel to build. I used my old .config to build the new kernel, and noticed that 

```
CONFIG_LDM_PARTITION
```

 was already set in the old .config. 

```
# uname -a

Linux localhost 5.10.109-gentoo-gentoo-dist #1 SMP Sun Apr 10 04:39:03 CDT 2022 x86_64 AMD Ryzen 7 1700 Eight-Core Processor AuthenticAMD GNU/Linux
```

Something is wrong, as this is the wrong date/time. Not sure if it was because I installed the kernel last week, or what the deal is.

 *Quote:*   

> 
> 
> There is an ebuild in https://bugs.gentoo.org/700960, that makes Windown Dynamic Disks work with lvm2 which will want some more kernel options
> 
> Code:	
> ...

 

Unfortunately, emerge is not finding this ebuild... Or is it something that I have to take another route to find/install?

Thanks

Todd

----------

## NeddySeagoon

todd93,

The kernel bit is easy, so I'll start there. 

```
Sun Apr 10 04:39:03 CDT 2022
```

is the build time and date of the running kernel.

That tell that its not your new kernel that is running ... yet.

Did you mount /boot before it was installed?

Did you write a new grub.cfg file?

Is the new kernel the default kernel in grub.cfg?

That bug is submitting an ebuild for inclusion in the ::gentoo repo. Its not there yet.

There are two ways to do this, the right way and the dirty hack. You choose.

The right way is to make yourself an overlay. Read all of Portage CustomTreethen follow the steps in Adding unofficial ebuilds After you have defined a custom ebuild repository to hold ebuild, add the ebuild from the bug.

Its this one 

```
# Copyright 1999-2019 Gentoo Authors

# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit autotools

DESCRIPTION="Gives access to Microsoft Windows dynamic disks, aka LDM, similar to LVM"

HOMEPAGE="https://github.com/mdbooth/libldm/"

SRC_URI="https://github.com/mdbooth/libldm/archive/libldm-0.2.4.tar.gz"

LICENSE="GPL-3+ LGPL-3+"

SLOT="0"

KEYWORDS="~amd64"

S="${WORKDIR}/${PN}-${PN}-${PV}"

DEPEND="

   >=dev-libs/glib-2.26.0

   >=dev-libs/json-glib-0.14.0

   sys-fs/lvm2

   sys-libs/zlib

   "

BDEPEND="

   dev-libs/libxslt

   dev-util/gtk-doc

"

#PATCHES=( "${FILESDIR}/Remove-deprecated-g_type_class_add_private.patch" "${FILESDIR}/Replace-_GET_PRIVATE-macros-with-_get_instance_priva.patch" )

PATCHES=( "${FILESDIR}/libldmguysmoilovgitchangesupto20032020.patch" )

src_prepare() {

   default

   eautoreconf

}

```

It goes into sys-fs/libldm in you overlay with filename libldm-0.2.4.ebuild once its there ebuild /path/to/sys-fs/libldm/libldm-0.2.4.ebuild will fetch the sources and generate the digest.

Now portage will be able to see and use it.

The dirty hack is to put it in your copy of the ::gentoo repo and skip making your own repo. If you do that, emerge --sync will remove it, as its not distributed by Gentoo.

Does your kernel also have  

```
CONFIG_MD

CONFIG_BLK_DEV_MD

CONFIG_MD_RAID0

CONFIG_BLK_DEV_DM 
```

 selected?

Modules or built in both work.

----------

## todd93

 *NeddySeagoon wrote:*   

> todd93,
> 
> The kernel bit is easy, so I'll start there. 
> 
> ```
> ...

 

Ok, I may have a bit of an issue here that I missed... Yes, I wrote a new grub.cfg, and /boot is indeed mounted. However, when I boot, I have to go into the advanced menu and choose the kernel that I desire to boot, everything boots just fine, but I fear it's not the new kernel that is booting, and it's defaulting to the genkernel that I started with, which could be a cause of certain things creating errors.... I use the 

```
grub-mkconfig -o /boot/grub/grub.cfg
```

 command to write the new grub.cfg file automatically...

Here's the output of grub.cfg, it seems to be very complex in my honest opinion, but I may be wrong about that...

```
#

# DO NOT EDIT THIS FILE

#

# It is automatically generated by grub-mkconfig using templates

# from /etc/grub.d and settings from /etc/default/grub

#

### BEGIN /etc/grub.d/00_header ###

if [ -s $prefix/grubenv ]; then

  load_env

fi

if [ "${next_entry}" ] ; then

   set default="${next_entry}"

   set next_entry=

   save_env next_entry

   set boot_once=true

else

   set default="0"

fi

if [ x"${feature_menuentry_id}" = xy ]; then

  menuentry_id_option="--id"

else

  menuentry_id_option=""

fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then

  set saved_entry="${prev_saved_entry}"

  save_env saved_entry

  set prev_saved_entry=

  save_env prev_saved_entry

  set boot_once=true

fi

function savedefault {

  if [ -z "${boot_once}" ]; then

    saved_entry="${chosen}"

    save_env saved_entry

  fi

}

function load_video {

  if [ x$feature_all_video_module = xy ]; then

    insmod all_video

  else

    insmod efi_gop

    insmod efi_uga

    insmod ieee1275_fb

    insmod vbe

    insmod vga

    insmod video_bochs

    insmod video_cirrus

  fi

}

if [ x$feature_default_font_path = xy ] ; then

   font=unicode

else

insmod part_msdos

insmod ext2

set root='hd3,msdos3'

if [ x$feature_platform_search_hint = xy ]; then

  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos3 --hint-efi=hd3,msdos3 --hint-baremetal=ahci3,msdos3  bb114566-68e9-47bc-9d8d-7dd64deaa260

else

  search --no-floppy --fs-uuid --set=root bb114566-68e9-47bc-9d8d-7dd64deaa260

fi

    font="/usr/share/grub/unicode.pf2"

fi

if loadfont $font ; then

  set gfxmode=auto

  load_video

  insmod gfxterm

  set locale_dir=$prefix/locale

  set lang=en_US

  insmod gettext

fi

terminal_output gfxterm

if [ x$feature_timeout_style = xy ] ; then

  set timeout_style=menu

  set timeout=5

# Fallback normal timeout code in case the timeout_style feature is

# unavailable.

else

  set timeout=5

fi

### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###

menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-bb114566-68e9-47bc-9d8d-7dd64deaa260' {

   load_video

   if [ "x$grub_platform" = xefi ]; then

      set gfxpayload=keep

   fi

   insmod gzio

   insmod part_msdos

   insmod fat

   set root='hd3,msdos1'

   if [ x$feature_platform_search_hint = xy ]; then

     search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos1 --hint-efi=hd3,msdos1 --hint-baremetal=ahci3,msdos1  99FC-DE47

   else

     search --no-floppy --fs-uuid --set=root 99FC-DE47

   fi

   echo   'Loading Linux 5.15.32-gentoo-dist ...'

   linux   /vmlinuz-5.15.32-gentoo-dist root=UUID=bb114566-68e9-47bc-9d8d-7dd64deaa260 ro  

   echo   'Loading initial ramdisk ...'

   initrd   /initramfs-5.15.32-gentoo-dist.img

}

submenu 'Advanced options for Gentoo GNU/Linux' $menuentry_id_option 'gnulinux-advanced-bb114566-68e9-47bc-9d8d-7dd64deaa260' {

   menuentry 'Gentoo GNU/Linux, with Linux 5.15.32-gentoo-dist' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.15.32-gentoo-dist-advanced-bb114566-68e9-47bc-9d8d-7dd64deaa260' {

      load_video

      if [ "x$grub_platform" = xefi ]; then

         set gfxpayload=keep

      fi

      insmod gzio

      insmod part_msdos

      insmod fat

      set root='hd3,msdos1'

      if [ x$feature_platform_search_hint = xy ]; then

        search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos1 --hint-efi=hd3,msdos1 --hint-baremetal=ahci3,msdos1  99FC-DE47

      else

        search --no-floppy --fs-uuid --set=root 99FC-DE47

      fi

      echo   'Loading Linux 5.15.32-gentoo-dist ...'

      linux   /vmlinuz-5.15.32-gentoo-dist root=UUID=bb114566-68e9-47bc-9d8d-7dd64deaa260 ro  

      echo   'Loading initial ramdisk ...'

      initrd   /initramfs-5.15.32-gentoo-dist.img

   }

   menuentry 'Gentoo GNU/Linux, with Linux 5.15.32-gentoo-dist (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.15.32-gentoo-dist-recovery-bb114566-68e9-47bc-9d8d-7dd64deaa260' {

      load_video

      if [ "x$grub_platform" = xefi ]; then

         set gfxpayload=keep

      fi

      insmod gzio

      insmod part_msdos

      insmod fat

      set root='hd3,msdos1'

      if [ x$feature_platform_search_hint = xy ]; then

        search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos1 --hint-efi=hd3,msdos1 --hint-baremetal=ahci3,msdos1  99FC-DE47

      else

        search --no-floppy --fs-uuid --set=root 99FC-DE47

      fi

      echo   'Loading Linux 5.15.32-gentoo-dist ...'

      linux   /vmlinuz-5.15.32-gentoo-dist root=UUID=bb114566-68e9-47bc-9d8d-7dd64deaa260 ro single 

      echo   'Loading initial ramdisk ...'

      initrd   /initramfs-5.15.32-gentoo-dist.img

   }

   menuentry 'Gentoo GNU/Linux, with Linux 5.15.29-gentoo-dist' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.15.29-gentoo-dist-advanced-bb114566-68e9-47bc-9d8d-7dd64deaa260' {

      load_video

      if [ "x$grub_platform" = xefi ]; then

         set gfxpayload=keep

      fi

      insmod gzio

      insmod part_msdos

      insmod fat

      set root='hd3,msdos1'

      if [ x$feature_platform_search_hint = xy ]; then

        search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos1 --hint-efi=hd3,msdos1 --hint-baremetal=ahci3,msdos1  99FC-DE47

      else

        search --no-floppy --fs-uuid --set=root 99FC-DE47

      fi

      echo   'Loading Linux 5.15.29-gentoo-dist ...'

      linux   /vmlinuz-5.15.29-gentoo-dist root=UUID=bb114566-68e9-47bc-9d8d-7dd64deaa260 ro  

      echo   'Loading initial ramdisk ...'

      initrd   /initramfs-5.15.29-gentoo-dist.img

   }

   menuentry 'Gentoo GNU/Linux, with Linux 5.15.29-gentoo-dist (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.15.29-gentoo-dist-recovery-bb114566-68e9-47bc-9d8d-7dd64deaa260' {

      load_video

      if [ "x$grub_platform" = xefi ]; then

         set gfxpayload=keep

      fi

      insmod gzio

      insmod part_msdos

      insmod fat

      set root='hd3,msdos1'

      if [ x$feature_platform_search_hint = xy ]; then

        search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos1 --hint-efi=hd3,msdos1 --hint-baremetal=ahci3,msdos1  99FC-DE47

      else

        search --no-floppy --fs-uuid --set=root 99FC-DE47

      fi

      echo   'Loading Linux 5.15.29-gentoo-dist ...'

      linux   /vmlinuz-5.15.29-gentoo-dist root=UUID=bb114566-68e9-47bc-9d8d-7dd64deaa260 ro single 

      echo   'Loading initial ramdisk ...'

      initrd   /initramfs-5.15.29-gentoo-dist.img

   }

   menuentry 'Gentoo GNU/Linux, with Linux 5.15.25-gentoo-dist' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.15.25-gentoo-dist-advanced-bb114566-68e9-47bc-9d8d-7dd64deaa260' {

      load_video

      if [ "x$grub_platform" = xefi ]; then

         set gfxpayload=keep

      fi

      insmod gzio

      insmod part_msdos

      insmod fat

      set root='hd3,msdos1'

      if [ x$feature_platform_search_hint = xy ]; then

        search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos1 --hint-efi=hd3,msdos1 --hint-baremetal=ahci3,msdos1  99FC-DE47

      else

        search --no-floppy --fs-uuid --set=root 99FC-DE47

      fi

      echo   'Loading Linux 5.15.25-gentoo-dist ...'

      linux   /vmlinuz-5.15.25-gentoo-dist root=UUID=bb114566-68e9-47bc-9d8d-7dd64deaa260 ro  

      echo   'Loading initial ramdisk ...'

      initrd   /initramfs-5.15.25-gentoo-dist.img

   }

   menuentry 'Gentoo GNU/Linux, with Linux 5.15.25-gentoo-dist (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.15.25-gentoo-dist-recovery-bb114566-68e9-47bc-9d8d-7dd64deaa260' {

      load_video

      if [ "x$grub_platform" = xefi ]; then

         set gfxpayload=keep

      fi

      insmod gzio

      insmod part_msdos

      insmod fat

      set root='hd3,msdos1'

      if [ x$feature_platform_search_hint = xy ]; then

        search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos1 --hint-efi=hd3,msdos1 --hint-baremetal=ahci3,msdos1  99FC-DE47

      else

        search --no-floppy --fs-uuid --set=root 99FC-DE47

      fi

      echo   'Loading Linux 5.15.25-gentoo-dist ...'

      linux   /vmlinuz-5.15.25-gentoo-dist root=UUID=bb114566-68e9-47bc-9d8d-7dd64deaa260 ro single 

      echo   'Loading initial ramdisk ...'

      initrd   /initramfs-5.15.25-gentoo-dist.img

   }

   menuentry 'Gentoo GNU/Linux, with Linux 5.10.109-gentoo-gentoo-dist' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.10.109-gentoo-gentoo-dist-advanced-bb114566-68e9-47bc-9d8d-7dd64deaa260' {

      load_video

      if [ "x$grub_platform" = xefi ]; then

         set gfxpayload=keep

      fi

      insmod gzio

      insmod part_msdos

      insmod fat

      set root='hd3,msdos1'

      if [ x$feature_platform_search_hint = xy ]; then

        search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos1 --hint-efi=hd3,msdos1 --hint-baremetal=ahci3,msdos1  99FC-DE47

      else

        search --no-floppy --fs-uuid --set=root 99FC-DE47

      fi

      echo   'Loading Linux 5.10.109-gentoo-gentoo-dist ...'

      linux   /vmlinuz-5.10.109-gentoo-gentoo-dist root=UUID=bb114566-68e9-47bc-9d8d-7dd64deaa260 ro  

      echo   'Loading initial ramdisk ...'

      initrd   /initramfs-5.10.109-gentoo-gentoo-dist.img

   }

   menuentry 'Gentoo GNU/Linux, with Linux 5.10.109-gentoo-gentoo-dist (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.10.109-gentoo-gentoo-dist-recovery-bb114566-68e9-47bc-9d8d-7dd64deaa260' {

      load_video

      if [ "x$grub_platform" = xefi ]; then

         set gfxpayload=keep

      fi

      insmod gzio

      insmod part_msdos

      insmod fat

      set root='hd3,msdos1'

      if [ x$feature_platform_search_hint = xy ]; then

        search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos1 --hint-efi=hd3,msdos1 --hint-baremetal=ahci3,msdos1  99FC-DE47

      else

        search --no-floppy --fs-uuid --set=root 99FC-DE47

      fi

      echo   'Loading Linux 5.10.109-gentoo-gentoo-dist ...'

      linux   /vmlinuz-5.10.109-gentoo-gentoo-dist root=UUID=bb114566-68e9-47bc-9d8d-7dd64deaa260 ro single 

      echo   'Loading initial ramdisk ...'

      initrd   /initramfs-5.10.109-gentoo-gentoo-dist.img

   }

   menuentry 'Gentoo GNU/Linux, with Linux 5.10.103-gentoo-gentoo-dist' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.10.103-gentoo-gentoo-dist-advanced-bb114566-68e9-47bc-9d8d-7dd64deaa260' {

      load_video

      if [ "x$grub_platform" = xefi ]; then

         set gfxpayload=keep

      fi

      insmod gzio

      insmod part_msdos

      insmod fat

      set root='hd3,msdos1'

      if [ x$feature_platform_search_hint = xy ]; then

        search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos1 --hint-efi=hd3,msdos1 --hint-baremetal=ahci3,msdos1  99FC-DE47

      else

        search --no-floppy --fs-uuid --set=root 99FC-DE47

      fi

      echo   'Loading Linux 5.10.103-gentoo-gentoo-dist ...'

      linux   /vmlinuz-5.10.103-gentoo-gentoo-dist root=/dev/sdd3 ro  

   }

   menuentry 'Gentoo GNU/Linux, with Linux 5.10.103-gentoo-gentoo-dist (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.10.103-gentoo-gentoo-dist-recovery-bb114566-68e9-47bc-9d8d-7dd64deaa260' {

      load_video

      if [ "x$grub_platform" = xefi ]; then

         set gfxpayload=keep

      fi

      insmod gzio

      insmod part_msdos

      insmod fat

      set root='hd3,msdos1'

      if [ x$feature_platform_search_hint = xy ]; then

        search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos1 --hint-efi=hd3,msdos1 --hint-baremetal=ahci3,msdos1  99FC-DE47

      else

        search --no-floppy --fs-uuid --set=root 99FC-DE47

      fi

      echo   'Loading Linux 5.10.103-gentoo-gentoo-dist ...'

      linux   /vmlinuz-5.10.103-gentoo-gentoo-dist root=/dev/sdd3 ro single 

   }

}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###

### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###

menuentry 'Windows 10 (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-CA447847447837F1' {

   insmod part_msdos

   insmod ntfs

   set root='hd0,msdos1'

   if [ x$feature_platform_search_hint = xy ]; then

     search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  CA447847447837F1

   else

     search --no-floppy --fs-uuid --set=root CA447847447837F1

   fi

   parttool ${root} hidden-

   drivemap -s (hd0) ${root}

   chainloader +1

}

menuentry 'Windows 7 (on /dev/sdc1)' --class windows --class os $menuentry_id_option 'osprober-chain-663E395F3E392987' {

   insmod part_msdos

   insmod ntfs

   set root='hd2,msdos1'

   if [ x$feature_platform_search_hint = xy ]; then

     search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos1 --hint-efi=hd2,msdos1 --hint-baremetal=ahci2,msdos1  663E395F3E392987

   else

     search --no-floppy --fs-uuid --set=root 663E395F3E392987

   fi

   parttool ${root} hidden-

   chainloader +1

}

menuentry 'Ubuntu 16.04.3 LTS (16.04) (on /dev/mapper/ubuntu--vg-root)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-2d51638b-11e3-4f23-9a72-ac00eab4cb9e' {

   insmod part_gpt

   insmod ext2

   set root='hd1,gpt2'

   if [ x$feature_platform_search_hint = xy ]; then

     search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2  6fb4be7d-7d8a-471a-96cb-76f6f49e28ee

   else

     search --no-floppy --fs-uuid --set=root 6fb4be7d-7d8a-471a-96cb-76f6f49e28ee

   fi

   linux /vmlinuz-4.4.0-96-generic.efi.signed root=/dev/mapper/ubuntu--vg-root ro quiet splash $vt_handoff

   initrd /initrd.img-4.4.0-96-generic

}

submenu 'Advanced options for Ubuntu 16.04.3 LTS (16.04) (on /dev/mapper/ubuntu--vg-root)' $menuentry_id_option 'osprober-gnulinux-advanced-2d51638b-11e3-4f23-9a72-ac00eab4cb9e' {

   menuentry 'Ubuntu (on /dev/mapper/ubuntu--vg-root)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-4.4.0-96-generic.efi.signed--2d51638b-11e3-4f23-9a72-ac00eab4cb9e' {

      insmod part_gpt

      insmod ext2

      set root='hd1,gpt2'

      if [ x$feature_platform_search_hint = xy ]; then

        search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2  6fb4be7d-7d8a-471a-96cb-76f6f49e28ee

      else

        search --no-floppy --fs-uuid --set=root 6fb4be7d-7d8a-471a-96cb-76f6f49e28ee

      fi

      linux /vmlinuz-4.4.0-96-generic.efi.signed root=/dev/mapper/ubuntu--vg-root ro quiet splash $vt_handoff

      initrd /initrd.img-4.4.0-96-generic

   }

   menuentry 'Ubuntu, with Linux 4.4.0-96-generic (on /dev/mapper/ubuntu--vg-root)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-4.4.0-96-generic.efi.signed--2d51638b-11e3-4f23-9a72-ac00eab4cb9e' {

      insmod part_gpt

      insmod ext2

      set root='hd1,gpt2'

      if [ x$feature_platform_search_hint = xy ]; then

        search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2  6fb4be7d-7d8a-471a-96cb-76f6f49e28ee

      else

        search --no-floppy --fs-uuid --set=root 6fb4be7d-7d8a-471a-96cb-76f6f49e28ee

      fi

      linux /vmlinuz-4.4.0-96-generic.efi.signed root=/dev/mapper/ubuntu--vg-root ro quiet splash $vt_handoff

      initrd /initrd.img-4.4.0-96-generic

   }

   menuentry 'Ubuntu, with Linux 4.4.0-96-generic (upstart) (on /dev/mapper/ubuntu--vg-root)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-4.4.0-96-generic.efi.signed--2d51638b-11e3-4f23-9a72-ac00eab4cb9e' {

      insmod part_gpt

      insmod ext2

      set root='hd1,gpt2'

      if [ x$feature_platform_search_hint = xy ]; then

        search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2  6fb4be7d-7d8a-471a-96cb-76f6f49e28ee

      else

        search --no-floppy --fs-uuid --set=root 6fb4be7d-7d8a-471a-96cb-76f6f49e28ee

      fi

      linux /vmlinuz-4.4.0-96-generic.efi.signed root=/dev/mapper/ubuntu--vg-root ro quiet splash $vt_handoff init=/sbin/upstart

      initrd /initrd.img-4.4.0-96-generic

   }

   menuentry 'Ubuntu, with Linux 4.4.0-96-generic (recovery mode) (on /dev/mapper/ubuntu--vg-root)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-4.4.0-96-generic.efi.signed--2d51638b-11e3-4f23-9a72-ac00eab4cb9e' {

      insmod part_gpt

      insmod ext2

      set root='hd1,gpt2'

      if [ x$feature_platform_search_hint = xy ]; then

        search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2  6fb4be7d-7d8a-471a-96cb-76f6f49e28ee

      else

        search --no-floppy --fs-uuid --set=root 6fb4be7d-7d8a-471a-96cb-76f6f49e28ee

      fi

      linux /vmlinuz-4.4.0-96-generic.efi.signed root=/dev/mapper/ubuntu--vg-root ro recovery nomodeset

      initrd /initrd.img-4.4.0-96-generic

   }

   menuentry 'Ubuntu, with Linux 4.4.0-93-generic (on /dev/mapper/ubuntu--vg-root)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-4.4.0-93-generic.efi.signed--2d51638b-11e3-4f23-9a72-ac00eab4cb9e' {

      insmod part_gpt

      insmod ext2

      set root='hd1,gpt2'

      if [ x$feature_platform_search_hint = xy ]; then

        search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2  6fb4be7d-7d8a-471a-96cb-76f6f49e28ee

      else

        search --no-floppy --fs-uuid --set=root 6fb4be7d-7d8a-471a-96cb-76f6f49e28ee

      fi

      linux /vmlinuz-4.4.0-93-generic.efi.signed root=/dev/mapper/ubuntu--vg-root ro quiet splash $vt_handoff

      initrd /initrd.img-4.4.0-93-generic

   }

   menuentry 'Ubuntu, with Linux 4.4.0-93-generic (upstart) (on /dev/mapper/ubuntu--vg-root)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-4.4.0-93-generic.efi.signed--2d51638b-11e3-4f23-9a72-ac00eab4cb9e' {

      insmod part_gpt

      insmod ext2

      set root='hd1,gpt2'

      if [ x$feature_platform_search_hint = xy ]; then

        search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2  6fb4be7d-7d8a-471a-96cb-76f6f49e28ee

      else

        search --no-floppy --fs-uuid --set=root 6fb4be7d-7d8a-471a-96cb-76f6f49e28ee

      fi

      linux /vmlinuz-4.4.0-93-generic.efi.signed root=/dev/mapper/ubuntu--vg-root ro quiet splash $vt_handoff init=/sbin/upstart

      initrd /initrd.img-4.4.0-93-generic

   }

   menuentry 'Ubuntu, with Linux 4.4.0-93-generic (recovery mode) (on /dev/mapper/ubuntu--vg-root)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-4.4.0-93-generic.efi.signed--2d51638b-11e3-4f23-9a72-ac00eab4cb9e' {

      insmod part_gpt

      insmod ext2

      set root='hd1,gpt2'

      if [ x$feature_platform_search_hint = xy ]; then

        search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2  6fb4be7d-7d8a-471a-96cb-76f6f49e28ee

      else

        search --no-floppy --fs-uuid --set=root 6fb4be7d-7d8a-471a-96cb-76f6f49e28ee

      fi

      linux /vmlinuz-4.4.0-93-generic.efi.signed root=/dev/mapper/ubuntu--vg-root ro recovery nomodeset

      initrd /initrd.img-4.4.0-93-generic

   }

   menuentry 'Ubuntu, with Linux 4.4.0-79-generic (on /dev/mapper/ubuntu--vg-root)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-4.4.0-79-generic.efi.signed--2d51638b-11e3-4f23-9a72-ac00eab4cb9e' {

      insmod part_gpt

      insmod ext2

      set root='hd1,gpt2'

      if [ x$feature_platform_search_hint = xy ]; then

        search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2  6fb4be7d-7d8a-471a-96cb-76f6f49e28ee

      else

        search --no-floppy --fs-uuid --set=root 6fb4be7d-7d8a-471a-96cb-76f6f49e28ee

      fi

      linux /vmlinuz-4.4.0-79-generic.efi.signed root=/dev/mapper/ubuntu--vg-root ro quiet splash $vt_handoff

      initrd /initrd.img-4.4.0-79-generic

   }

   menuentry 'Ubuntu, with Linux 4.4.0-79-generic (upstart) (on /dev/mapper/ubuntu--vg-root)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-4.4.0-79-generic.efi.signed--2d51638b-11e3-4f23-9a72-ac00eab4cb9e' {

      insmod part_gpt

      insmod ext2

      set root='hd1,gpt2'

      if [ x$feature_platform_search_hint = xy ]; then

        search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2  6fb4be7d-7d8a-471a-96cb-76f6f49e28ee

      else

        search --no-floppy --fs-uuid --set=root 6fb4be7d-7d8a-471a-96cb-76f6f49e28ee

      fi

      linux /vmlinuz-4.4.0-79-generic.efi.signed root=/dev/mapper/ubuntu--vg-root ro quiet splash $vt_handoff init=/sbin/upstart

      initrd /initrd.img-4.4.0-79-generic

   }

   menuentry 'Ubuntu, with Linux 4.4.0-79-generic (recovery mode) (on /dev/mapper/ubuntu--vg-root)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-4.4.0-79-generic.efi.signed--2d51638b-11e3-4f23-9a72-ac00eab4cb9e' {

      insmod part_gpt

      insmod ext2

      set root='hd1,gpt2'

      if [ x$feature_platform_search_hint = xy ]; then

        search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2  6fb4be7d-7d8a-471a-96cb-76f6f49e28ee

      else

        search --no-floppy --fs-uuid --set=root 6fb4be7d-7d8a-471a-96cb-76f6f49e28ee

      fi

      linux /vmlinuz-4.4.0-79-generic.efi.signed root=/dev/mapper/ubuntu--vg-root ro recovery nomodeset

      initrd /initrd.img-4.4.0-79-generic

   }

}

### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###

### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom ###

# This file provides an easy way to add custom menu entries.  Simply type the

# menu entries you want to add after this comment.  Be careful not to change

# the 'exec tail' line above.

### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###

if [ -f  ${config_directory}/custom.cfg ]; then

  source ${config_directory}/custom.cfg

elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then

  source $prefix/custom.cfg

fi

### END /etc/grub.d/41_custom ###
```

----------

## NeddySeagoon

todd93,

I avoid grub if I can. I use syslinux on Intel/AMD which is like a cross between lilo and grub legacy to configure.

The lines that matter to see whats where start menuentry, linux and initrd.

The text in the 

```
menuentry 'Gentoo GNU/Linux' 
```

is what gets displayed in the menu.

```
linux   /vmlinuz-5.15.32-gentoo-dist root=UUID=bb114566-68e9-47bc-9d8d-7dd64deaa260 ro 
```

tells the kernel file name and kernel parameters.

```
initrd   /initramfs-5.15.32-gentoo-dist.img
```

tells the name of the initrd that will be used.

```
vmlinuz-5.15.32-gentoo-dist
```

might be your default grub entry it depends on what comes out of

```
if [ "${next_entry}" ] ; then

   set default="${next_entry}"

   set next_entry=

   save_env next_entry

   set boot_once=true

else

   set default="0"

fi 
```

It will become your default, once its booted. Right now, default is 2, which is  5.10.109-gentoo-gentoo-dist.

```
vmlinuz-5.15.29-gentoo-dist

vmlinuz-5.15.25-gentoo-dist

vmlinuz-5.10.109-gentoo-gentoo-dist

vmlinuz-5.10.103-gentoo-gentoo-dist - without an initrd

Windows 10 (on /dev/sda1)

Windows 7 (on /dev/sdc1)

Ubuntu 16.04.3 LTS (16.04) (on /dev/mapper/ubuntu--vg-root)

Ubuntu, with Linux 4.4.0-96-generic

Ubuntu, with Linux 4.4.0-93-generic

Ubuntu, with Linux 4.4.0-79-generic
```

are also listed

----------

## todd93

NeddySeagoon, 

This is starting to confuse me, I rebooted and chose the default Gentoo from the grub menu... It booted and I got 5.15.32 with uname -a... I may not have been as forthcoming with the information on my end... The kernel version I desire to run is 5.10.109. I do apologize that I didn't mention that earlier.

Thanks

Todd

----------

## NeddySeagoon

todd93,

You need to choose it from the menu system then.

----------

## figueroa

For the short term, set the GRUB_TIMEOUT=-1 in /etc/default/grub. This will cause grub to wait for you until you select something. I suggest you also set GRUB_DISABLE_SUBMENU=y which will make it easier to see all selections on the main screen. These choices will be used next time you generate a grub.cfg.

You can also hand-jam your own grub.cfg. Here is a minimal model for grub.cfg entries; all lines commented out:

```
#timeout=5

#default=0

#menu_color_normal=white/blue

#menuentry "Text you'd like to use"" {

#       set root="hd0,gpt2"

#       linux /<name of kernel> root=UUID=<UID #> <other options>

#       initrd /<initrd file if you use one>

#       }

#menuentry 'Linux' {

#       set root='hd0,msdos1'

#       linux /vmlinuz root=/dev/nvme0n1p2 ro acpi_enforce_resources=lax

#       }

```

So you don't end up with an unbootable system, you can test you hand jammed entries by naming the file /boot/grub/custom.cfg. Upon booting, grub will add the contents of custom.cfg to the bottom of what it finds in grub.cfg.

Once you have tested your own hand written entries, backup your grub.cfg, and replace it with your custom.cfg.

Here are the first two entries in my own custom.cfg, which were substantially copied from a grub setup grub.cfg. But, as you can see from the model, even most of what I have in custom.cfg you don't need. I'm lazy.

```
menuentry 'Gentoo GNU/Linux, with Linux 5.4.109-gentoo' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.4.109-gentoo-advanced-5958fd45-723e-4d6b-9253-e74dada52d45' {

        set root='hd0,msdos1'

        linux /boot/kernel-5.4.109-gentoo root=/dev/sda1 ro rootfstype=ext4 net.ifnames=0 intel_pstate=active ipv6.disable=1

#       initrd  /boot/early_ucode.cpio

        initrd  /boot/intel-uc.img

}

menuentry 'Gentoo GNU/Linux, with Linux 5.4.109-gentoo (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.4.109-gentoo-advanced-5958fd45-723e-4d6b-9253-e74dada52d45' {

        set root='hd0,msdos1'

        linux /boot/kernel-5.4.109-gentoo root=/dev/sda1 ro single rootfstype=ext4

#       initrd  /boot/early_ucode.cpio

        initrd  /boot/intel-uc.img

}

```

Here is another set of entries (That I'm actually using.):

```
menuentry 'Gentoo GNU/Linux, with Linux 5.10.109-gentoo' {

set root='hd0,msdos1'

linux   /boot/kernel-5.10.109-gentoo root=PARTUUID=5fa8d3ef-01 ro net.ifnames=0 intel_pstate=active ipv6.disable=1 

initrd  /boot/intel-uc.img

}

menuentry 'Gentoo GNU/Linux, with Linux 5.10.109-gentoo (recovery mode)' {

set root='hd0,msdos1'

linux   /boot/kernel-5.10.109-gentoo root=PARTUUID=5fa8d3ef-01 ro single net.ifnames=0 intel_pstate=active ipv6.disable=1 

initrd  /boot/intel-uc.img

}
```

Your mileage may vary. Test before using anything. Measure twice; cut once. I have no UEFI, no GPT, and maybe not much sense, but I'm trying to learn GRUB2.

----------

## NeddySeagoon

 *Quote:*   

> Measure twice; cut once.

 

Measure with a micrometer

Mark with chalk

Cut with an axe

I really need to uninstall fortune.

----------

## todd93

Great info here, I'll be trying some of these things as soon as I get a chance!

Thanks guys...

And NeddySeagoon,

I have chosen 5.10.109 in the submenu and am booted into that kernel.

Thanks

Todd

----------

## NeddySeagoon

todd93,

What I am aiming for is Windows Dynamic Disk support in your kernel and the user space ldmtool to create the /dev/mapper entries so you can use them.

From playing in a Win10 virtual machine and reading on the web, there are several versions of  Windows Dynamic Disk.

Lazy thought. You have 

```
Ubuntu 16.04.3 LTS (16.04) (on /dev/mapper/ubuntu--vg-root) 
```

installed.

That at least has kernel support for LVM. It may have Windows Dynamic Disk support too.

If it has ldmtool, you may be able to create the /dev/mapper entries and subsequently mount them using that Ubuntu.

See the ldbtool man page.

----------

## todd93

NeddySeagoon,

I might be able to do that, however, I will have to do a lot of work to Ubuntu to get it to work, more than likely. It's been several years since I even booted into it.

I am having trouble with setting the repository for ldmtool. It's all something I'm not doing right, probably because I misunderstood the way to do it, so I'm still working on that. 

Thanks

Todd

----------

## NeddySeagoon

todd93,

There are two isolated steps.

Setting up the local repository somewhere. Its called an overlay as it looks just like the ::gentoo repo.

You only add the category/package directories you actually need.

That's one step.

The second step is telling portage where it is, so that it will be used.

I use app-eselect/eselect-repository for that but you can write a file to go in  /etc/portage/repos.conf/with a name ending in .conf by hand.

```
# created by eselect-repo

[gentoo-static]

location = /var/db/repos/gentoo-static

sync-type = git

sync-uri = https://github.com/NeddySeagoon/gentoo-static

[crossdev]

location = /var/db/repos/crossdev
```

As its your own local repo, you need an entry like my [crossdev] one just to specify the location.

----------

## todd93

 *NeddySeagoon wrote:*   

> todd93,
> 
> What I am aiming for is Windows Dynamic Disk support in your kernel and the user space ldmtool to create the /dev/mapper entries so you can use them.
> 
> From playing in a Win10 virtual machine and reading on the web, there are several versions of  Windows Dynamic Disk.
> ...

 

NeddySeagoon,

Apologies, work has been crazy for me lately.... I tried booting into Ubuntu, and immediately was reminded of why I no longer use it, it has a pretty big error when starting up, I would have to format the HD it's on, and start over with it... I'm going to look at some of the other options here and see if I can't get this data recovered... Everything else on my system seems to be working properly now, except for emerging x11-drivers/xf86-video-nouveau, which is having an unrelated problem, and I will looking elsewhere for the solution of that. 

Thanks

Todd

----------

## NeddySeagoon

todd93,

We are all volunteers here. We do what we can when we can. Real life always comes first.

It looks like you need Windows Dynamic Disk support to get at your data but I suspect it will be there when you get that.

----------

## todd93

NeddySeagoon,

Thank you, and I just solved my problem with nouveau, so that's working right!

Is Windows Dynamic Disk support a kernel option? Or something that I'll have to use Windows to achieve?

Thanks,

Todd

----------

## NeddySeagoon

todd93,

Its in two pieces. A kernel option and a user space tool.

I'm not clear about the user space tool. Maybe its all in the kernel now.

```
 .config - Linux/x86 5.17.0-gentoo Kernel Configuration

 > Enable the block layer > Partition Types ───────────────────────────────────

  ┌──────────────────────────── Partition Types ────────────────────────────┐

  │  Arrow keys navigate the menu.  <Enter> selects submenus ---> (or empty │  

  │  submenus ----).  Highlighted letters are hotkeys.  Pressing <Y>        │  

  │  includes, <N> excludes, <M> modularizes features.  Press <Esc><Esc> to │  

  │  exit, <?> for Help, </> for Search.  Legend: [*] built-in  [ ]         │  

  │ ┌────^(-)─────────────────────────────────────────────────────────────┐ │  

  │ │    [ ]   Macintosh partition map support                            │ │  

  │ │    [*]   PC BIOS (MSDOS partition tables) support                   │ │  

  │ │    [ ]     BSD disklabel (FreeBSD partition tables) support         │ │  

  │ │    [ ]     Minix subpartition support                               │ │  

  │ │    [ ]     Solaris (x86) partition table support                    │ │  

  │ │    [ ]     Unixware slices support                                  │ │  

  │ │    [ ]   Windows Logical Disk Manager (Dynamic Disk) support        │ │  

  │ │    [ ]   SGI partition support                                      │ │  

  │ │    [ ]   Ultrix partition table support                             │ │  

  │ │    [*]   Sun partition tables support                               │ │  

  │ └────v(+)─────────────────────────────────────────────────────────────┘ │  
```

----------

## todd93

NeddySeagoon,

My kernel has that built in... You mentioned possibly using Ubuntu to see if it would make this happen... My Ubuntu has some serious problems, age being one of them, but it's going to require a reinstall, in order to get to the latest version. I have no problem doing that, but I'm not sure how well distros will work together, as far as grub goes. I mean I know different distros work well on the same machine, but I don't want to complicate things by installing it, and having it overwrite my grub.conf, then all of the sudden not be able to boot into Gentoo. I'm not sure if that makes sense.

Thanks

Todd

----------

## NeddySeagoon

todd93,

There may be nothing wrong with an old Ubuntu for this sort of thing.

It's just to read the data off of and old Windows Dynamic Disk.

Getting Windows Logical Disk Manager (Dynamic Disk) support in the kernel is the easy bit.

Getting the ldmtool userspace tool is the hard bit here.

I was hoping that the old Ubuntu would have it.

If you want to build it form source, as your normal user

```
git clone https://github.com/mdbooth/libldm

cd libldm

./autogen.sh

make
```

This fails for me as I don't have udev

```
 /usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: ./.libs/libldm-1.0.so: undefined reference to `dm_udev_create_cookie'
```

Now the risky bit ... this will fail by design. Still as your normal user because we want the messages

```
make install 
```

Where does it install to?

/usr/local is safe

/usr is not. 

Its usually possible to pass an install directory to make install when it does the wrong thing by default.

Once it tries to install to /usr/local, rerun the command as root, so it works.

----------

## todd93

NeddySeagoon,

I have no problem with the age of the Ubuntu install, it's just that it has a massive problem, not sure what happens, but there's a big error at bootup, rendering the system unusable... It opens the file manager over and over..

Good news, make install does install to /usr/local:

```
~/libldm $ make install

Making install in src

make[1]: Entering directory '/home/todd93/libldm/src'

make[2]: Entering directory '/home/todd93/libldm/src'

 /bin/mkdir -p '/usr/local/lib'

 /bin/sh ../libtool   --mode=install /usr/bin/install -c   libldm-1.0.la '/usr/local/lib'

libtool: install: /usr/bin/install -c .libs/libldm-1.0.so.0.0.0 /usr/local/lib/libldm-1.0.so.0.0.0

/usr/bin/install: cannot create regular file '/usr/local/lib/libldm-1.0.so.0.0.0': Permission denied

make[2]: *** [Makefile:485: install-libLTLIBRARIES] Error 1

make[2]: Leaving directory '/home/todd93/libldm/src'

make[1]: *** [Makefile:724: install-am] Error 2

make[1]: Leaving directory '/home/todd93/libldm/src'

make: *** [Makefile:505: install-recursive] Error 1
```

Thanks

Todd

----------

## NeddySeagoon

todd93,

Run the install as root, then see if it can find some Windows Dynamic Disks.

I don't know how to use it.

You should get something new in /dev/mapper if it works, which you treat as a block device and mount -o ro to have a look around.

Your kernel may need support for device-mapper if you don't have it

----------

## todd93

NeddySeagoon,

I do have Windows Logical Disk support built in, but cannot find device-mapper in the kernel menu options. Is it listed in another category that I'm possibly not seeing?

Thanks

Todd

----------

## NeddySeagoon

todd93,

Its under 

```
Multiple devices driver support (RAID and LVM)
```

Otherwise CONFIG_MD.

Then 

```
CONFIG_BLK_DEV_DM
```

```
CONFIG_DM_UEVENT
```

may be useful too.

That will get you /dev/mapper

While you are there, 

```
DM_RAID
```

 may be a good idea.

Your Windows Dynamic Disk is raid0 and something (I don't know what) needs do to the striping.

Windows Logical Disk support, will read the partition table.

libldm will extract the Windows Logical Disk metadata and set up the /dev/mapper entries.

What you have is software raid0 for Windows, so you will need raid0 support from somewhere.

----------

## todd93

Update...

I decided to try another avenue, not giving up on Gentoo by any stretch of the imagination, just wanted to try and get a look at it from another angle...

I can verify that the hard drive setup I'm working on is JBOD...

Now, I am using Windows to gain this information, using DMDE... I'm attempting to use it to stitch them back together. I have found some data on one drive that I was able to see, so I can verify that the data is quite safe...

I'm not sure if this information is helpful, but I can only hope that it is!

Thanks

Todd

----------

## NeddySeagoon

todd93,

Its a Windows raid0 Dynamic Disc. The concept of 'one drive' does not really exist.

There are two different ways to do raid0. 

In the first, the space is concatenated end to end. Its one big volume. Loose one and everything is gone as the filesystem spans the entire set.

The second is to stripe data across all the members of the raid set. The stripe size tells the size written to one drive before the next is used.

Again, the filesystem spans the entire space. Lose one member and its all gone.

Windows will put the volume together an show it to you as one drive. 

Notice that's its twice the size of the underlying drives as your raid set has two members.

All that changes between the two methods is the layout of the on disk data,

If you can see data in windows, that's all there is to see. Copy it to another volume.

I don't know if Windows Dynamic Disks has a JBOD mode. That doesn't really make sense to me.

----------

## todd93

NeddySeagoon,

Thank you for all your kind help with this, and your patience and guidance. I was able to fully recover all of the data from these disks in Windows using Dmde. I'm now going to boot back into Gentoo, I have since reformatted the disks I was having trouble with to allow for more storage. Again, I deeply appreciate all you do to help me! This one is solved!!

Todd

----------

