LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-13-2010, 09:30 AM   #1
cartman_jp
LQ Newbie
 
Registered: Feb 2010
Posts: 3

Rep: Reputation: 0
Device Mapper and unknown device.


Hello everybody professional.
I am embarrassed.
What is this /dev/dm-1?
The cylinder is different though it is the same capacity.
And I newly made LUN.

Code:
[root@ns01 ~]# fdisk -l
This doesn't look like a partition table
Probably you selected the wrong device.
dev/sdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 1305 10482381 7 HPFS/NTFS

Disk /dev/sdc: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdc1 * 1 1305 10482381 7 HPFS/NTFS

Disk /dev/dm-0: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/dm-0p1 * 1 1305 10482381 7 HPFS/NTFS

Disk /dev/dm-1: 10.7 GB, 10733958144 bytes
255 heads, 63 sectors/track, 1304 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

This doesn't look like a partition table
Probably you selected the wrong device.

Device Boot Start End Blocks Id System
/dev/dm-1p1 ? 10499 10499 0 65 Novell Netware 386
Partition 1 does not end on cylinder boundary.
/dev/dm-1p2 ? 13578 119522 850995205 72 unknown
Partition 2 does not end on cylinder boundary.
/dev/dm-1p3 ? 45382 79243 271987362 74 unknown
Partition 3 does not end on cylinder boundary.
/dev/dm-1p4 167628 167631 25817+ 0 empty
Partition 4 does not end on cylinder boundary.

It explains the procedure.
--------------------
My Environment
/dev/sda [LocalDisk]
/dev/sdb [SAN External Disk]
/dev/sdc [SAN External Disk]

Configure Multipath
Edit /etc/multipath.conf
/etc/init.d/multipathd

Create Partition
fdisk /dev/sdb

Create Multipath block device
kpartx -a /dev/mapper/mpath0

Create File System
mke2fs -j /dev/mapper/mpath0p1

Mount
mount -t ext3 /dev/mapper/mpath0p1

Question
ls /dev/dm-1
---------------------

Regards,
 
Old 02-13-2010, 09:59 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 678Reputation: 678Reputation: 678Reputation: 678Reputation: 678Reputation: 678
Are you certain that /dev/sdb is a san drive? It looks to me that it is an internal or external drive and you mapped dm-0 to it.

Also /dev/sda has a corrupt partition table. You might want to fix that before rebooting.
You could use losetup to attach to /dev/sda at an offset to double check where /dev/sda1 starts. Make a first guess of 63 blocks (63*512 bytes) for XP and Linux, and 1024 or 2048 blocks for Vista and Windows 7.
Then you can use "df --block-size=512" to learn the size of the filesystem. The other partitions may start on cylinder boundaries, but using 512 byte blocks consistently with the df and fdisk commands will prevent rounding errors.

example:
sudo /sbin/losetup -fs /dev/sda -o $((63*512))

# some distro's versions of losetup don't have the -s option to tell you which loop device was found.
# use "sudo /sbin/losetup -a" to check in that case

# Check the filesystem before trying to mount it, or use it
sudo file -s /dev/loop0
sudo df --block-size=512

Given the filesize in blocks, you can add the size to the start of the partition to obtain what may be the start of the next partition.

If these partitions are already mounted and you just mucked up the table in the current session, then enter:
"cat /proc/partitions" to display the size of the partitions as they are mounted.
Code:
cat /proc/partitions
major minor  #blocks  name

   8        0  976762584 sda
   8        1     102400 sda1
   8        2   62918572 sda2
   8        3          1 sda3
   8        4   12933120 sda4
   8        5    8385898 sda5
   8        6   83883366 sda6
   8        7  387439573 sda7
   8       16 1953514584 sdb
   8       17 1953504000 sdb1
 253        0 1953503484 dm-0
These sizes match what you would see using "sudo /sbin/fdisk -lu" if the partition table wasn't mucked up.
 
Old 02-13-2010, 10:20 AM   #3
cartman_jp
LQ Newbie
 
Registered: Feb 2010
Posts: 3

Original Poster
Rep: Reputation: 0
"kpartx -a /dev/mapper/mpath0", /dev/dm-1 was created.

Reply thank you,jschiwal.
I am not so good at English.
When it is not easy to understand, I'm sorry.

[root@ns01 ~]# fdisk /dev/sda

Disk /dev/sda: 8598 MB, 8598323200 bytes
255 heads, 63 sectors/track, 1045 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 274 2096482+ 82 Linux swap / Solaris
/dev/sda3 275 1045 6193057+ 83 Linux
[root@ns01 ~]#

/dev/sdb,/dev/sdc is SAN drive.

When I executed "kpartx -a /dev/mapper/mpath0", /dev/dm-1 was created.

Regards,
 
Old 02-13-2010, 10:44 AM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 678Reputation: 678Reputation: 678Reputation: 678Reputation: 678Reputation: 678
I'm glad that the partition table for /dev/sda isn't corrupted. The first fdisk listing you posted implied it was:
Code:
fdisk -l
This doesn't look like a partition table
Probably you selected the wrong device.
dev/sdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
I thought that was for /dev/sda since /dev/sdb and /dev/sdb1 were listed.

I didn't realize a SAN device would show up as /dev/sdb, expecting entries in /dev/mapper and /dev/dm-# instead.
Could you post the results of:
ls -l /dev/disk/by-*/ | grep 'sdb$'
 
Old 02-14-2010, 02:17 AM   #5
cartman_jp
LQ Newbie
 
Registered: Feb 2010
Posts: 3

Original Poster
Rep: Reputation: 0
It will confirm it tomorrow.

Thank you!
You are reassuring.
It will confirm it tomorrow.
Is it wrong that/dev/dm-1 is create when kpartx is executed?
Regards,
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
what is device mapper? ymmij Linux From Scratch 5 07-19-2009 05:27 PM
mkrescue Fatal: device-mapper: only linear boot device supported Molly Slackware 5 01-06-2009 04:35 PM
device mapper / multipath creating extra device, won't let me talk to the one i want chakkerz Linux - Server 1 03-16-2008 05:52 PM
Showing Device Status as Unknown Device for all hardware ganesh_g1982 Linux - Hardware 1 12-02-2006 02:13 PM
device-mapper: dm-linear: Device lookup failed tajo01 Linux - Kernel 1 05-18-2006 08:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration