1748176 Members
4345 Online
108758 Solutions
New Discussion юеВ

fdisk -l doubt

 
iinfi1
Super Advisor

fdisk -l doubt

i am using suse linux (sles10sp3 64bit) on my laptop vmware workstation practicing a few things.
my storage box is openfiler running as another vm.
on my suse linux vm i have a single 20GB HDD added. further i have added a 3gb HDD thru iscsi.

fdisk -l shows this output
lin1:~ # fdisk -l

Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 26 208813+ 83 Linux
/dev/sda2 27 288 2104515 82 Linux swap / Solaris
/dev/sda3 289 2610 18651465 f W95 Ext'd (LBA)
/dev/sda5 289 2610 18651433+ 8e Linux LVM

Disk /dev/dm-0: 19.0 GB, 19008585728 bytes
255 heads, 63 sectors/track, 2310 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/dm-0 doesn't contain a valid partition table

Disk /dev/sdb: 3154 MB, 3154116608 bytes
98 heads, 62 sectors/track, 1013 cylinders
Units = cylinders of 6076 * 512 = 3110912 bytes

Device Boot Start End Blocks Id System
lin1:~ #


there are 3 disks shown here ... whereas i v only two.3gb one is the iscsi mapped one. my 20gb drive is being shown as 21gb and another 19gb

can someone plz throw more light on this?
9 REPLIES 9
P Muralidhar Kini
Honored Contributor

Re: fdisk -l doubt

Hi iinfi,

>> Disk /dev/dm-0 doesn't contain a valid partition table
Looks like some problem with the partition.
Are you able to mount it ?
Able to access data in it ?

Regards,
Murali
Let There Be Rock - AC/DC
P Muralidhar Kini
Honored Contributor

Re: fdisk -l doubt

iinfi1
Super Advisor

Re: fdisk -l doubt

i have jus 2 disks attached to my system

i have installed sles 10 on a vmware workstation

the drive sda shows correctly my local HDD while sdb is a ISCSI target on openfiler, which is also correctly shown
..
now i dont understand what /dev/dm-0: 19.0 GB is... :(

lin1:~ # df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg1-root 18G 3.1G 14G 19% /
udev 503M 136K 503M 1% /dev
/dev/sda1 198M 14M 174M 8% /boot
P Muralidhar Kini
Honored Contributor

Re: fdisk -l doubt

Hi iinfi,

>> now i dont understand what /dev/dm-0: 19.0 GB is... :(
You have /dev/sda and /dev/sdb corresponding to the 20GB and 3GB HDD.

The /dev/dm-X are device mapper devices.
They are associated with LVM and correspond to logical volumes.

When the programs fdisk and sfdisk are run with the option -l and no
argument, e.g.
# /sbin/fdisk -l
they look for all devices that can have cylinders, heads, sectors, etc.
If they find such a device, they output that information to standard
output and they output the partition table to standard output. If there is
no partition table, they have an error message (also standard output).

The following link talks more about this -
http://www.linuxquestions.org/questions/fedora-35/dev-dm-0-a-506904/
http://www.softpanorama.org/Commercial_linuxes/disk_management.shtml

Hope this helps.

Regards,
Murali
Let There Be Rock - AC/DC
iinfi1
Super Advisor

Re: fdisk -l doubt

thank you .. i understood the difference partly. how can one make out the difference on an unknown system that this one is a LVM and the other one is a HDD ..
its confusing ..
P Muralidhar Kini
Honored Contributor

Re: fdisk -l doubt

Hi iinfi,

* Physical Volume
This corresponds to a physical media like a disk or a Raid LUN that is
presented to the operating system.

* Logical Volume
This corresponds to a LVM logical volume which comes out of a volume group.

You can have a set of disks together in a volume group. A logical volumes
can then be created which would span across these physical disks
i.e. volume group. The operating system sees the multiple physical disk as
one big logical volume.

Check the following link -
* VxVM and LVM-Conceptual Comparison
http://docs.hp.com/en/5187-1372/ch01s02.html

Hope this helps.

Regards,
Murali
Let There Be Rock - AC/DC
iinfi1
Super Advisor

Re: fdisk -l doubt

nope ... sorry i think i was not clear .. i know the diff between an lvm and a hdd disk.

but in the current case

Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 26 208813+ 83 Linux
/dev/sda2 27 288 2104515 82 Linux swap / Solaris
/dev/sda3 289 2610 18651465 f W95 Ext'd (LBA)
/dev/sda5 289 2610 18651433+ 8e Linux LVM

Disk /dev/dm-0: 19.0 GB, 19008585728 bytes
255 heads, 63 sectors/track, 2310 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/dm-0 doesn't contain a valid partition table

if this is all the info we have off a system, how do we know that /dev/dm-0 and /dev/sda are the same disks.
Matti_Kurkela
Honored Contributor

Re: fdisk -l doubt

If all the information you have is the "fdisk -l" output, you don't know!

You might be able to make some informed guesses, but you need more information to be sure.

In your case, /dev/dm-0 would most likely be a LVM logical volume.

Please run these commands:

ls -l /dev/dm-* /dev/sd*
dmsetup ls --tree

Compare the device numbers in the ls -l listing to the numbers listed in parentheses in the dmsetup output, and you'll see what's what.

The /dev/dm-* names are mostly for the device-mapper subsystem's internal use only: they are rather inconvenient for humans, and they aren't guaranteed to be persistent. If you've made changes to your disk configuration, what's /dev/dm-3 now might become /dev/dm-0 after a reboot.

Those Linux features that are built on top of the device-mapper subsystem (disk encryption, dm-multipath, LVM, software RAID) all maintain more human-readable, persistent device names that should usually be used instead of /dev/dm-* names.

MK
MK
iinfi1
Super Advisor

Re: fdisk -l doubt

thank you.