Wrong information being reported using fdisk command

Discussions about using Linux guests in VirtualBox.
Post Reply
MystikalX
Posts: 4
Joined: 1. Oct 2023, 03:11

Wrong information being reported using fdisk command

Post by MystikalX »

I am a beginner to Linux and currently taking a class in it. I am using Slackware 15 Linux with VirtualBox 7.0. I was watching the instructor step for step using fdisk and related commands. However, I noticed my fdisk pick up my host computer storage instead of the USB. The lsblk command results are correct but fdisk is reporting my host computer information. I don't have a clue why. I restarted the VM and removed the USB (formatted it in case)..... the same issue. I attached a picture of it. The USB is an older 2GB generic one. Any help would be greatly appreciated. Image
Attachments
Screenshot 2023-09-30 210641.png
Screenshot 2023-09-30 210641.png (94.78 KiB) Viewed 5836 times
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Wrong information being reported using fdisk command

Post by mpack »

If a tool is reporting info about the host then you are running the tool on the host. I see nothing in your screenshot to indicate that you were running in a VM.

Also I'm puzzled by your "instead of the USB". What USB? A VM will not see any host drives, the drives you see are virtual SATA drives.
fth0
Volunteer
Posts: 5678
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Wrong information being reported using fdisk command

Post by fth0 »

Whatever you did, /dev/sdb has no partition table. The shown Start and Sectors values of /dev/sdb1 are an interpretation of the byte sequence "0x65 0x79 0x20 0x74 0x6f 0x20 0x72 0x65", which is an ASCII text fragment: "ey to re".
MystikalX
Posts: 4
Joined: 1. Oct 2023, 03:11

Re: Wrong information being reported using fdisk command

Post by MystikalX »

mpack wrote: 1. Oct 2023, 11:31 If a tool is reporting info about the host then you are running the tool on the host. I see nothing in your screenshot to indicate that you were running in a VM.

Also I'm puzzled by your "instead of the USB". What USB? A VM will not see any host drives, the drives you see are virtual SATA drives.
In the class, our instructor had us install Slackware 15 into a VM (so if we messed it up we could go back to a snapshot) instead of a bare metal install. I connected a simple 2 GB generic thumb drive and then passed it through from the host to VM Virtualbox. When I used the command lsblk in the VM Linux. It shows the proper size of 1.9 G for the thumbdrive, but no partition (which I formatted to FAT32). What confuses me is that fdisk command returns 3 partitions for over 811 GB.

I really do appreciate the assistance fth0 and mpack.

Attached is my host computer partitions. Image
Attachments
Screenshot 2023-10-01 103241.png
Screenshot 2023-10-01 103241.png (70.62 KiB) Viewed 5783 times
MystikalX
Posts: 4
Joined: 1. Oct 2023, 03:11

Re: Wrong information being reported using fdisk command

Post by MystikalX »

fth0 wrote: 1. Oct 2023, 13:01 Whatever you did, /dev/sdb has no partition table. The shown Start and Sectors values of /dev/sdb1 are an interpretation of the byte sequence "0x65 0x79 0x20 0x74 0x6f 0x20 0x72 0x65", which is an ASCII text fragment: "ey to re".
After you mention that ... I checked the hex of the USB drive and found the hex sequence.
Image
Attachments
Screenshot 2023-10-01 104409.png
Screenshot 2023-10-01 104409.png (86.09 KiB) Viewed 5780 times
fth0
Volunteer
Posts: 5678
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Wrong information being reported using fdisk command

Post by fth0 »

This is a MSDOS 5.0 boot sector. You've formatted the USB stick with a single FAT32 filesystem without any partitioning (MBR/GPT). This is the normal use case for small USB sticks, since you usually don't want to split the 2 GB into multiple partitions. In consequence, there's nothing for fdisk to work with.
MystikalX
Posts: 4
Joined: 1. Oct 2023, 03:11

Re: Wrong information being reported using fdisk command

Post by MystikalX »

fth0 wrote: 1. Oct 2023, 17:02 This is a MSDOS 5.0 boot sector. You've formatted the USB stick with a single FAT32 filesystem without any partitioning (MBR/GPT). This is the normal use case for small USB sticks, since you usually don't want to split the 2 GB into multiple partitions. In consequence, there's nothing for fdisk to work with.
Ok, now that makes sense. Thank you fth0! It's a good morning when I get to learn something new. Have a great Sunday!
Post Reply