Fdisk outputs 2 similar volumes

Hello guys,

Hoping someone could help me understand why I got 2 volumes (sda and sdb) with the same characteristics - is this normal or does it mean I got 2 disks inside the server? The disk identifier fields for both seem different, I'm not too familiar with Linux just yet so trying to understand - thanks in adv for your time and suggestions everyone

Output below using fdisk -l

Disk /dev/sdb: 931.53 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: APPLE HDD ST1000
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 43844A3A-57A2-4BC3-8A52-62298CE6E55C

Device       Start        End    Sectors  Size Type
/dev/sdb1     2048    1050623    1048576  512M EFI System
/dev/sdb2  1050624 1953521663 1952471040  931G Linux filesystem


Disk /dev/sda: 931.53 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: APPLE HDD ST1000
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 2C5A3BDB-CE06-46E4-BCED-E2385C594D8A

Device       Start        End    Sectors  Size Type
/dev/sda1     2048    1050623    1048576  512M EFI System
/dev/sda2  1050624    3147775    2097152    1G Linux filesystem
/dev/sda3  3147776 1953521663 1950373888  930G Linux filesystem


Disk /dev/mapper/ubuntu--vg-ubuntu--lv: 200 GiB, 214748364800 bytes, 419430400 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Yes, you have got two disks.
lsblk -p
looks nicer.

1 Like

Thank you, however I can see that sda3 has 931.5G of space allocated as per below output

/dev/sda                                8:0    0 931.5G  0 disk
├─/dev/sda1                             8:1    0   512M  0 part /boot/efi
├─/dev/sda2                             8:2    0     1G  0 part /boot
└─/dev/sda3                             8:3    0   930G  0 part

But when I check sd3 using the below command it says I got 2.9G which does not makes sense to me - am I missing something here?

df -h /dev/sda3
Filesystem      Size  Used Avail Use% Mounted on
udev            2.9G     0  2.9G   0% /dev

Yes that looks confusing.
Since the lsblk does not show a mounted filesystem (in the last column), it is not yet mounted. And it is yet a special file on the providing file system that is mounted on /dev.
To be 100% sure that the /dev/sda3 is unused, run the commands

grep -w sda3 /etc/fstab
mount | grep -w sda3
swapon -s | grep -w sda3
systemctl | grep -w sda3

Shouldn't output anything.

2 Likes

Please see below, I have about 95GB of data on it - definitely NOT unused

guineapig@minimac:~$ grep -w sda3 /etc/fstab
guineapig@minimac:~$ mount | grep -w sda3
guineapig@minimac:~$ swapon -s | grep -w sda3
guineapig@minimac:~$ systemctl | grep -w sda3
  sys-devices-pci0000:00-0000:00:1f.2-ata1-host0-target0:0:0-0:0:0:0-block-sda-sda3.device                                loaded active plugged   APPLE_HDD_ST1000 3

Just thinking - your /dev/sda3 device should have worked with

df -h /dev/sda3

But it is somehow unusable on your Linux system. Either because it is an unknown/unsupported partition type, or it has an unknown/unsupported file system type.
What yields

df -hT /dev/sda3

?

2 Likes

I got the below output:

guineapig@minimac:~$ df -hT /dev/sda3
Filesystem     Type      Size  Used Avail Use% Mounted on
udev           devtmpfs  2.9G     0  2.9G   0% /dev

Hello,

That certainly fits with what @MadeInGermany suspected earlier, and confirms what he thought was going on. What you are seeing when you run df -hT /dev/sda3 is the disc space "used" by the virtual filesystem /dev, which is provided by the udev service. You would see this same output for any individual file underneath /dev that you ran df on, if that file did not correspond to a device that was currently mounted.

In other words: the underlying storage device represented by the device file /dev/sda3 is not currently mounted on your system. Now, that doesn't mean that the filesystem contained in that partition is empty, or that it's unused, or that it's any size other than the 9.3GB that fdisk and other similar commands say it is. It simply means that right now, or certainly as of when you ran these commands, it was not mounted. Before a filesystem's contents actually appear and are accessible, the device containing that filesystem must be mounted underneath a dedicated directory within your filesystem tree.

If you want whatever data is contained in /dev/sda3 to appear in a usable way on your system, you will have to mount that partition. Given that the partition table at least claims that the partition should contain a Linux filesystem, this is probably as simple as typing:

mount /dev/sda3 /path/to/wherever/you/want/it/mounted/underneath

and then it will be mounted. Once you verify that it does contain what you're expecting it to and that you are interested in having it mounted permanently, you'd have to create an entry in /etc/fstab to get your system to automatically mount it for you at boot time.

Hope this helps ! If you have any further questions or if you experience any difficulties in mounting the filesystem, please do let us know and we can then take things from there.

3 Likes

Thank you for your response. I tried mounting sda3 to /mnt/disk1 (where disk1 is a directory I created under /mnt) and got the below message:

guineapig@minimac:~$ sudo mount -a
mount: /mnt/disk1: /dev/sda3 already mounted or mount point busy.

I also first added sda3 uuid to fstab as below:

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/ubuntu-vg/ubuntu-lv during curtin installation
/dev/disk/by-id/dm-uuid-LVM-c4iw0Tsuh0jBFgcnLdflM1qTJtT3VwFMxfWiTn0yiAjL5sTAxqBdIc4nUR9pUvDa / ext4 defaults 0 1
# /boot was on /dev/sda2 during curtin installation
/dev/disk/by-uuid/a62f1c40-26ff-4a60-99e1-abc9b01ee501 /boot ext4 defaults 0 1
# /boot/efi was on /dev/sda1 during curtin installation
/dev/disk/by-uuid/6C54-81E7 /boot/efi vfat defaults 0 1
/swap.img       none    swap    sw      0       0

# My mounted disks
UUID=WgosSz-uKpn-ZVqh-ybfQ-0cqY-TacA-443VnC /mnt/disk1 ext4 defaults 0 0

Meanwhile I have remembered that a df /dev/sda3 should work even if not mounted.
The device driver for /dev/sda3 seems to have a problem.
Please look at the system messages with

journalctl
1 Like

It does output but shows the same. Will check using journalctl as suggested - could you please advise what command should trigger the driver error or what log am I looking for?. Thank you in adv :slight_smile:

guineapig@minimac:~$ df -h /dev/sda3
Filesystem      Size  Used Avail Use% Mounted on
udev            2.9G     0  2.9G   0% /dev

Hello,

Hmm, this is a weird one. On the one hand, your system is behaving as though the filesystem is not mounted; on the other hand, it is reporting that it is already mounted.

Could you see what you get for the output of fuser -m /dev/sda3 please ? This should show us the process IDs of any processes that are using any filesystem that is mounted using that block device. If nothing shows up there then the mystery continues - otherwise, take a look at the output of ps for those PIDs, and see if you can get a better idea of what might be going on.

Output below, nothing there :frowning:

guineapig@minimac:~$ fuser -m /dev/sda3
guineapig@minimac:~$

Hi,

Hmm, OK. Is this Linux server inside a container or a chroot'd environment of any kind ?
EDIT: Also, make sure you're running fuser (and all these other commands) as root and not a regular user.

Hello,

Just an Ubuntu Server running in a miniMac - I use it for a Plex server only at the moment and yes, I did run the command as root too and the same

root@minimac:/home/guineapig# fuser -m /dev/sda3
root@minimac:/home/guineapig#

Yes, because @edujs7 is running Ubuntu in a VM or container on his mac without providing the details of the VM or container environment (so it appears to me based on this reply below):?

Maybe I am wrong and @edujs7 is running Linux directly on his mac, but I kinda doubt it, based on my experience with macs. When I run Linux on a mac, it's always in a container (Docker, for example)

Hello @Neo - actually I'm not using any hypervisor on the miniMac. Ubuntu server is running directly on it

root@minimac:/home/guineapig# sudo dmidecode -s system-manufacturer
Apple Inc.
root@minimac:/home/guineapig# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:        20.04
Codename:       focal
root@minimac:/home/guineapig#
1 Like

Hello,

OK, thanks. Two further questions, then: does this happen even after you reboot or start the computer up from cold in Linux ? And is this in any way a shared storage device accessed by another device or operating system, which may have it mounted somewhere ?

Lastly, could you also try taking out the fstab entry, and manually mounting it directly without using the UUID under a newly-created mount point (e.g. mount /dev/sda3 /mnt/new_mount or somesuch) ?

1 Like

Hi

Maybe you have a Apple Disk drive - sometimes Apple installs a Fusion Drive.
One part high Capacity slower hard disk drive and another part is smaller capacity but Very High Speed.

I have never actually seen the Fusion drive hardware myself - they are fairly new so they should NOT be having trouble out in the field of repair as yet. Or some low percentage may have and I just have not seen them.

GPT format says that your sda2 is 1GB and sda3 is close to 1 TB at 930 GB with some space assigned to EFI.

What tools are you using to generate that report ???
On a running Mac with that hardware installed internally (based on the sda and sdb and sdc) you should b able to Start up a Terminal session and Type ‘diskutil list’ and get plain text output describing the INTERNAL and any EXTERNAL drives.

The ‘diskutil list internal’ and ‘diskutil list external’ sub commands do exist in most of the recent Macs.
The output usually specifies /dev/disk0 or /dev/disk3 etc along with the size and purpose (eg. EFI)

Apple systems later than ‘High Sierra’ may have fairly complex information about the drives.
The complication is APFS volume controls. Actually a very good idea technically.
It can save a lot of hassle if you corrupt the booting file-system. Take you Mac to a store and ask about getting your data back. I do some data repairs if the drive is working and I have another company do disk repairs etc if the drive is not working at all or spotty.

NOW assuming you have LINUX up and running - where did the drive come from ? And where is it installed ?
Just curious.

Helpful

1 Like

Hi @drysdalk - done as suggested. Took the entry off fstab

Tried mounting sda3 to a newly created directory under /mnt called "New_mount" and got the below:

guineapig@minimac:/mnt$ sudo mkdir new_mount
guineapig@minimac:/mnt$ ls
disk1  new_mount
guineapig@minimac:/mnt$ sudo mount /dev/sda3 /mnt/new_mount
mount: /mnt/new_mount: unknown filesystem type 'LVM2_member'.
guineapig@minimac:/mnt$

I've also rebooted the server and the same:

guineapig@minimac:~$ df -h /dev/sda3
Filesystem      Size  Used Avail Use% Mounted on
udev            2.9G     0  2.9G   0% /dev
guineapig@minimac:~$