qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-discuss] Issue related to mounting /dev/nbd0p1


From: Pascal
Subject: Re: [Qemu-discuss] Issue related to mounting /dev/nbd0p1
Date: Thu, 16 May 2019 11:50:07 +0200

1. probably that using kpartx makes lvm react to the second partition...
1. dm-X partitions are related to device mapper : lvm uses device mapper.
2. maybe it is related to the automatic mounting of the first partition
when it appears...
in any case, a glance at the system log (journalctl -f) will probably give
you a lot of explanations...
regards, lacsaP.

Le lun. 13 mai 2019 à 13:05, ramakanth varala <address@hidden>
a écrit :

> Hi Pascal,
>
> thanks for the information.  I had to do some changes to make that work.
>
> I was using RHEL 5.7 , no  partitions visible in  /proc/partitions . I
> moved to Ubuntu 16.04 (xenial) , now once i do partx -a /dev/nbd0 i am able
> to see partitions in  /proc/partitions
>
> Here i am trying to use a raw image and write some content into that and
> then generate the vmkd files .
> While mouting the raw image , i use the lvm .
>
> Some queries are stil unanswered for me.
>
> 1. I had to do kpartx -a /dev/nbd0 to make lvm work. what i mean here is
> , as i mount to /home/dev1users/test/mnt , i can see all the file system .
> With out kpartx , no file system got mapped.
>
> When i do this kpartx,  i can see some more partitions like below.
>
>  252        2     104391 dm-2
>  252        3   20860402 dm-3
>  252        4   18743296 dm-4
>  252        5    2097152 dm-5
>
> what exactly these new partitions?.
>
> 2.  When i connect /dev/nbd0 ( which has two partitions nbd0p1 type linux
> and nbd0p2 type is Linux LVM) and try to mount /dev/nb0p1 to
> /home/dev1user/test/mnt/boot
> This gives error as "mount: /dev/nbd0p1 is already mounted or
> /home/dev1user/test/mnt/boot busy"
>
> Where as i only mounted /dev/nbd0 not /dev/nbd0p1.  I had to use another
> /dev/nbd2 only with partition=1 to make changes on to /boot partition.
>
>
> Thanks
> RK
>
>
> On Fri, May 3, 2019 at 12:46 PM Pascal <address@hidden> wrote:
>
>> no :
>> with  qemu-nbd --connect /dev/nbd0 $temp_raw  you will have access to
>> /dev/nbd0 for the device, /dev/nbd0p1 for the first partition of this
>> device, /dev/nbd0p2 for the second partition of this device, etc...
>> with  qemu-nbd --partition=1 --connect /dev/nbd0 $temp_raw  you will
>> only have access to /dev/nbd0 for the first partition of the device.
>> note that  --partition=1  will only run with intel partition table (not
>> gpt).
>> regards, lacsaP.
>>
>> Le jeu. 18 avr. 2019 à 15:02, ramakanth varala <
>> address@hidden> a écrit :
>>
>>> Hi ,
>>>
>>> Are these two commands same.
>>>
>>> 1)    qemu-nbd --connect /dev/nbd0 $temo_raw
>>>
>>>  2)    qemu-nbd --partition=1 --connect /dev/nbd0 $temp_raw
>>>
>>>
>>>
>>> Thanks
>>>
>>>
>>> On Thu, Jan 17, 2019 at 6:50 PM Pascal <address@hidden> wrote:
>>>
>>>> hi,
>>>>
>>>> your /home/pnsc/nsc.3.5.1b.debug/nsc.3.5.1b.debug.raw is a raw disk
>>>> image, is that right ?
>>>> before returning to nbd, is it possible to check with loop ?
>>>>
>>>> # qemu-nbd -d /dev/nbd0
>>>> # modprobe -rv nbd
>>>> # fdisk -l /home/pnsc/nsc.3.5.1b.debug/nsc.3.5.1b.debug.raw
>>>> # modprobe -rv loop    *# I assume/hope the module is not being used*
>>>> # modprobe -v loop max_part=16
>>>> # losetup -f /home/pnsc/nsc.3.5.1b.debug/nsc.3.5.1b.debug.raw
>>>> # losetup -l    # theoretically /dev/loop0
>>>> # fdisk -l /dev/loop0    *# change loop0 if the theory is not
>>>> respected*
>>>> # ls -l /dev/loop0*    *# we should theoretically find out loop0p1 and
>>>> loop0p2*
>>>> # mount /dev/loop0p1 /mount/point
>>>>
>>>> Le jeu. 17 janv. 2019 à 03:52, ramakanth varala <
>>>> address@hidden> a écrit :
>>>>
>>>>> Hi ,
>>>>>
>>>>> I moved to RHEL 7.1 , now in my /proc/partitions i am able to see like
>>>>> below
>>>>>
>>>>>
>>>>> address@hidden ~]# cat /proc/partitions
>>>>> major minor  #blocks  name
>>>>>
>>>>>    8        0   62914560 sda
>>>>>    8        1     512000 sda1
>>>>>    8        2   62401536 sda2
>>>>>   11        0    3799040 sr0
>>>>>  253        0    4063232 dm-0
>>>>>  253        1   39153664 dm-1
>>>>>  253        2   19116032 dm-2
>>>>>   43        0   20971520 nbd0
>>>>>
>>>>>
>>>>> address@hidden ~]# fdisk /dev/nbd0  -l
>>>>>
>>>>> Disk /dev/nbd0: 21.5 GB, 21474836480 bytes, 41943040 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
>>>>> Disk label type: dos
>>>>> Disk identifier: 0x00010c17
>>>>>
>>>>>      Device Boot      Start         End      Blocks   Id  System
>>>>> /dev/nbd0p1   *          63      208844      104391   83  Linux
>>>>> /dev/nbd0p2          208845    41929649    20860402+  8e  Linux LVM
>>>>>
>>>>>
>>>>> address@hidden qemu-3.0.0]# ./qemu-nbd -vc /dev/nbd0 --format=raw
>>>>> /home/pnsc/nsc.3.5.1b.debug/nsc.3.5.1b.debug.raw
>>>>> NBD device /dev/nbd0 is now connected to
>>>>> /home/pnsc/nsc.3.5.1b.debug/nsc.3.5.1b.debug.raw
>>>>>
>>>>> still i get the same issue as below... when i try to mount /dev/nbd0p1
>>>>>
>>>>> address@hidden ~]# mount /dev/nbd0p1
>>>>> /home/pnsc/nsc.3.5.1b.debug/mnt/boot/
>>>>> mount: special device /dev/nbd0p1 does not exist
>>>>>
>>>>>
>>>>> On Wed, Dec 5, 2018 at 6:22 AM ramakanth varala <
>>>>> address@hidden> wrote:
>>>>>
>>>>>> I don't see any --format..option
>>>>>>
>>>>>>
>>>>>>
>>>>>> address@hidden ~]# qemu-nbd --help
>>>>>> Usage: qemu-nbd [OPTIONS] FILE
>>>>>> QEMU Disk Network Block Device Server
>>>>>>
>>>>>>   -p, --port=PORT      port to listen on (default `10809')
>>>>>>   -o, --offset=OFFSET  offset into the image
>>>>>>   -b, --bind=IFACE     interface to bind to (default `0.0.0.0')
>>>>>>   -k, --socket=PATH    path to the unix socket
>>>>>>                        (default '/var/lock/qemu-nbd-DEVICE')
>>>>>>   -r, --read-only      export read-only
>>>>>>   -P, --partition=NUM  only expose partition NUM
>>>>>>   -s, --snapshot       use snapshot file
>>>>>>   -n, --nocache        disable host cache
>>>>>>   -c, --connect=DEV    connect FILE to the local NBD device DEV
>>>>>>   -d, --disconnect     disconnect the specified device
>>>>>>   -e, --shared=NUM     device can be shared by NUM clients (default
>>>>>> '1')
>>>>>>   -t, --persistent     don't exit on the last connection
>>>>>>   -v, --verbose        display extra debugging information
>>>>>>   -h, --help           display this help and exit
>>>>>>   -V, --version        output version information and exit
>>>>>>
>>>>>> Report bugs to <address@hidden>
>>>>>> address@hidden ~]# qemu-nbd --version
>>>>>> qemu-nbd version 0.0.1
>>>>>> Written by Anthony Liguori.
>>>>>>
>>>>>> Copyright (C) 2006 Anthony Liguori <address@hidden>.
>>>>>> This is free software; see the source for copying conditions.  There
>>>>>> is NO
>>>>>> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
>>>>>> PURPOSE.
>>>>>>
>>>>>>
>>>>>>
>>>>>> should i install any other version to get that..?
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Tue, Dec 4, 2018 at 7:14 PM Pascal <address@hidden> wrote:
>>>>>>
>>>>>>> disconnect and reconnect with *-f raw* option...
>>>>>>>
>>>>>>> qemu-nbd --connect /dev/nbd0* --format=raw*
>>>>>>> /home/test/test.3.5.1b.debug/test.3.5.1b.debug.raw
>>>>>>>
>>>>>>>
>>>>>>> Le mar. 4 déc. 2018 à 14:32, ramakanth varala <
>>>>>>> address@hidden> a écrit :
>>>>>>>
>>>>>>>> address@hidden ~]# file
>>>>>>>> /home/test/test.3.5.1b.debug/test.3.5.1b.debug.raw
>>>>>>>> /home/test/test.3.5.1b.debug/test.3.5.1b.debug.raw: x86 boot
>>>>>>>> sector; partition 1: ID=0x83, starthead 1, startsector 63, 208782 
>>>>>>>> sectors;
>>>>>>>> partition 2: ID=0x83, starthead 254, startsector 41913585, 16065 
>>>>>>>> sectors,
>>>>>>>> code offset 0x48
>>>>>>>>
>>>>>>>>
>>>>>>>> On Tue, Dec 4, 2018 at 6:48 PM Pascal <address@hidden> wrote:
>>>>>>>>
>>>>>>>>> the partition does not appear and so, cannot be mounted.
>>>>>>>>> moreover, if it appeared, it would have to be formatted before it
>>>>>>>>> could be mounted...
>>>>>>>>>
>>>>>>>>> what is the result of the "file /home/test/test.3.5.1b.debug/
>>>>>>>>> test.3.5.1b.debug.raw" command ?
>>>>>>>>>
>>>>>>>>> Le mar. 4 déc. 2018 à 13:51, ramakanth varala <
>>>>>>>>> address@hidden> a écrit :
>>>>>>>>>
>>>>>>>>>> Hi Pascal..
>>>>>>>>>>
>>>>>>>>>> this works fine ....
>>>>>>>>>>
>>>>>>>>>> address@hidden ~]# qemu-nbd --connect /dev/nbd0
>>>>>>>>>> /home/test/test.3.5.1b.debug/test.3.5.1b.debug.raw
>>>>>>>>>>
>>>>>>>>>> after this when i try to do mount like below...it fails..
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> address@hidden ~]# mount /dev/nbd0p1
>>>>>>>>>> /home/test/test.3.5.1b.debug/mnt/boot/
>>>>>>>>>> mount: special device /dev/nbd0p1 does not exist
>>>>>>>>>>
>>>>>>>>>> but fdisk -l shows me this..
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> address@hidden ~]# fdisk -l /dev/nbd0
>>>>>>>>>>
>>>>>>>>>> Disk /dev/nbd0: 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/nbd0p1               1          13      104391   83  Linux
>>>>>>>>>> /dev/nbd0p2            2610        2610        8032+  83  Linux
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Hope we have some way ..which i can mount to partition .
>>>>>>>>>>
>>>>>>>>>> Thanks
>>>>>>>>>> Rama Kanth
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Tue, Dec 4, 2018 at 5:07 PM Pascal <address@hidden>
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>>> # qemu-nbd --connect */dev/nbd0* /home/test/test.3.5.1b.debug/
>>>>>>>>>>> test.3.5.1b.debug.raw
>>>>>>>>>>>
>>>>>>>>>>> Le mar. 4 déc. 2018 à 12:32, ramakanth varala <
>>>>>>>>>>> address@hidden> a écrit :
>>>>>>>>>>>
>>>>>>>>>>>> Hi  Pascal..
>>>>>>>>>>>>
>>>>>>>>>>>> I tried like below..
>>>>>>>>>>>>
>>>>>>>>>>>> address@hidden ~]# qemu-nbd -d /dev/nbd0
>>>>>>>>>>>> /dev/nbd0 disconnected
>>>>>>>>>>>>
>>>>>>>>>>>> address@hidden ~]# qemu-nbd --connect /dev/nbd0p1
>>>>>>>>>>>> /home/test/test.3.5.1b.debug/test.3.5.1b.debug.raw
>>>>>>>>>>>> qemu-nbd: Could not access '/dev/nbd0p1': No such file or
>>>>>>>>>>>> directory
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> On Tue, Dec 4, 2018 at 4:55 PM ramakanth varala <
>>>>>>>>>>>> address@hidden> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>> first time i got below..
>>>>>>>>>>>>>
>>>>>>>>>>>>> address@hidden ~]# kpartx -a /dev/ndb0
>>>>>>>>>>>>> failed to stat() /dev/ndb0
>>>>>>>>>>>>>
>>>>>>>>>>>>> from second time onwards like below..
>>>>>>>>>>>>>
>>>>>>>>>>>>> address@hidden ~]# kpartx -a /dev/nbd0
>>>>>>>>>>>>> device-mapper: resume ioctl failed: Invalid argument
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> On Tue, Dec 4, 2018 at 4:23 PM Jan Schermer <address@hidden>
>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>> Partigion is missing :-)
>>>>>>>>>>>>>> try:
>>>>>>>>>>>>>> kpartx -a /dev/ndb0
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> > On 4 Dec 2018, at 11:35, ramakanth varala <
>>>>>>>>>>>>>> address@hidden> wrote:
>>>>>>>>>>>>>> >
>>>>>>>>>>>>>> > Hi Pascal..
>>>>>>>>>>>>>> >
>>>>>>>>>>>>>> > yes its RW ...
>>>>>>>>>>>>>> >
>>>>>>>>>>>>>> > address@hidden ~]# fdisk -l /dev/nbd0
>>>>>>>>>>>>>> >
>>>>>>>>>>>>>> > Disk /dev/nbd0: 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/nbd0p1               1          13      104391   83
>>>>>>>>>>>>>> Linux
>>>>>>>>>>>>>> > /dev/nbd0p2            2610        2610        8032+  83
>>>>>>>>>>>>>> Linux
>>>>>>>>>>>>>> >
>>>>>>>>>>>>>> > address@hidden ~]# ls -ltr /dev/nbd0*
>>>>>>>>>>>>>> > brw-r----- 1 root disk 43, 0 Dec  4 11:06 /dev/nbd0
>>>>>>>>>>>>>> >
>>>>>>>>>>>>>> > address@hidden ~]# mount /dev/nbd0p1
>>>>>>>>>>>>>> /home/test/test.3.5.1b.debug/mnt/boot/
>>>>>>>>>>>>>> > mount: special device /dev/nbd0p1 does not exist
>>>>>>>>>>>>>> >
>>>>>>>>>>>>>> > address@hidden ~]# cat /proc/partitions
>>>>>>>>>>>>>> > major minor  #blocks  name
>>>>>>>>>>>>>> >
>>>>>>>>>>>>>> >   8     0   62914560 sda
>>>>>>>>>>>>>> >   8     1     104391 sda1
>>>>>>>>>>>>>> >   8     2   62806117 sda2
>>>>>>>>>>>>>> > 253     0   56655872 dm-0
>>>>>>>>>>>>>> > 253     1    6127616 dm-1
>>>>>>>>>>>>>> > 253     2     104391 dm-2
>>>>>>>>>>>>>> > 253     3   20860402 dm-3
>>>>>>>>>>>>>> >
>>>>>>>>>>>>>> >
>>>>>>>>>>>>>> > --Not sure..what's missing..
>>>>>>>>>>>>>> >
>>>>>>>>>>>>>> > Thanks
>>>>>>>>>>>>>> > Rama Kanth
>>>>>>>>>>>>>> >
>>>>>>>>>>>>>> > On Tue, Dec 4, 2018 at 3:07 PM Pascal <address@hidden>
>>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>> >
>>>>>>>>>>>>>> >> hi,
>>>>>>>>>>>>>> >>
>>>>>>>>>>>>>> >> you left fdisk without saving the changes (w before q), so
>>>>>>>>>>>>>> there can't be
>>>>>>>>>>>>>> >> two partitions.
>>>>>>>>>>>>>> >> on the other hand, we should find the existing partition...
>>>>>>>>>>>>>> >> there is a strange warning when fdisk starts: what is on
>>>>>>>>>>>>>> the over side of
>>>>>>>>>>>>>> >> nbd0 ?
>>>>>>>>>>>>>> >> is /dev/nbd0 rw ?
>>>>>>>>>>>>>> >> if you can't re-read the partitions table, can you
>>>>>>>>>>>>>> disconnect /dev/nbd0 and
>>>>>>>>>>>>>> >> then reconnect it ?
>>>>>>>>>>>>>> >>
>>>>>>>>>>>>>> >>
>>>>>>>>>>>>>> >> Le lun. 3 déc. 2018 à 16:17, ramakanth varala <
>>>>>>>>>>>>>> address@hidden>
>>>>>>>>>>>>>> >> a écrit :
>>>>>>>>>>>>>> >>
>>>>>>>>>>>>>> >>> Hi ,
>>>>>>>>>>>>>> >>>
>>>>>>>>>>>>>> >>> I tried below steps .. still with some errors..
>>>>>>>>>>>>>> >>>
>>>>>>>>>>>>>> >>>
>>>>>>>>>>>>>> >>> address@hidden ~]# fdisk /dev/nbd0
>>>>>>>>>>>>>> >>>
>>>>>>>>>>>>>> >>> The number of cylinders for this disk is set to 2610.
>>>>>>>>>>>>>> >>> There is nothing wrong with that, but this is larger than
>>>>>>>>>>>>>> 1024,
>>>>>>>>>>>>>> >>> and could in certain setups cause problems with:
>>>>>>>>>>>>>> >>> 1) software that runs at boot time (e.g., old versions of
>>>>>>>>>>>>>> LILO)
>>>>>>>>>>>>>> >>> 2) booting and partitioning software from other OSs
>>>>>>>>>>>>>> >>>   (e.g., DOS FDISK, OS/2 FDISK)
>>>>>>>>>>>>>> >>>
>>>>>>>>>>>>>> >>> Command (m for help): n
>>>>>>>>>>>>>> >>> Command action
>>>>>>>>>>>>>> >>>   e   extended
>>>>>>>>>>>>>> >>>   p   primary partition (1-4)
>>>>>>>>>>>>>> >>> p
>>>>>>>>>>>>>> >>> Partition number (1-4): 1
>>>>>>>>>>>>>> >>> Partition 1 is already defined.  Delete it before
>>>>>>>>>>>>>> re-adding it.
>>>>>>>>>>>>>> >>>
>>>>>>>>>>>>>> >>> Command (m for help): d
>>>>>>>>>>>>>> >>> Partition number (1-4): 1
>>>>>>>>>>>>>> >>>
>>>>>>>>>>>>>> >>> Command (m for help): d
>>>>>>>>>>>>>> >>> Selected partition 2
>>>>>>>>>>>>>> >>>
>>>>>>>>>>>>>> >>> Command (m for help): p
>>>>>>>>>>>>>> >>>
>>>>>>>>>>>>>> >>> Disk /dev/nbd0: 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
>>>>>>>>>>>>>> >>>
>>>>>>>>>>>>>> >>> Command (m for help): n
>>>>>>>>>>>>>> >>> Command action
>>>>>>>>>>>>>> >>>   e   extended
>>>>>>>>>>>>>> >>>   p   primary partition (1-4)
>>>>>>>>>>>>>> >>> p
>>>>>>>>>>>>>> >>> Partition number (1-4): 1
>>>>>>>>>>>>>> >>> First cylinder (1-2610, default 1):
>>>>>>>>>>>>>> >>> Using default value 1
>>>>>>>>>>>>>> >>> Last cylinder or +size or +sizeM or +sizeK (1-2610,
>>>>>>>>>>>>>> default 2610): 4
>>>>>>>>>>>>>> >>>
>>>>>>>>>>>>>> >>> Command (m for help): n
>>>>>>>>>>>>>> >>> Command action
>>>>>>>>>>>>>> >>>   e   extended
>>>>>>>>>>>>>> >>>   p   primary partition (1-4)
>>>>>>>>>>>>>> >>> p
>>>>>>>>>>>>>> >>> Partition number (1-4): 2
>>>>>>>>>>>>>> >>> First cylinder (5-2610, default 5):
>>>>>>>>>>>>>> >>> Using default value 5
>>>>>>>>>>>>>> >>> Last cylinder or +size or +sizeM or +sizeK (5-2610,
>>>>>>>>>>>>>> default 2610):
>>>>>>>>>>>>>> >>> Using default value 2610
>>>>>>>>>>>>>> >>>
>>>>>>>>>>>>>> >>> Command (m for help): p
>>>>>>>>>>>>>> >>>
>>>>>>>>>>>>>> >>> Disk /dev/nbd0: 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/nbd0p1               1           4       32098+  83
>>>>>>>>>>>>>> Linux
>>>>>>>>>>>>>> >>> /dev/nbd0p2               5        2610    20932695   83
>>>>>>>>>>>>>> Linux
>>>>>>>>>>>>>> >>>
>>>>>>>>>>>>>> >>> Command (m for help): q
>>>>>>>>>>>>>> >>>
>>>>>>>>>>>>>> >>> address@hidden ~]# blockdev --rereadpt /dev/nbd0
>>>>>>>>>>>>>> >>> BLKRRPART: Invalid argument
>>>>>>>>>>>>>> >>> address@hidden ~]# ls /dev/nbd0
>>>>>>>>>>>>>> >>> /dev/nbd0
>>>>>>>>>>>>>> >>> address@hidden ~]# ls /dev/nbd0*
>>>>>>>>>>>>>> >>> /dev/nbd0
>>>>>>>>>>>>>> >>>
>>>>>>>>>>>>>> >>>
>>>>>>>>>>>>>> >>>
>>>>>>>>>>>>>> >>> Thanks
>>>>>>>>>>>>>> >>> Rama Kanth
>>>>>>>>>>>>>> >>>
>>>>>>>>>>>>>> >>> On Fri, Nov 30, 2018 at 6:48 PM Pascal <
>>>>>>>>>>>>>> address@hidden> wrote:
>>>>>>>>>>>>>> >>>
>>>>>>>>>>>>>> >>>> do not create nodes manually but with fdisk on nbd0 :
>>>>>>>>>>>>>> >>>>
>>>>>>>>>>>>>> >>>> # fdisk /dev/nbd0
>>>>>>>>>>>>>> >>>> ## now create your partitions in fdisk
>>>>>>>>>>>>>> >>>> ## use w to write changes and q to quit fdisk
>>>>>>>>>>>>>> >>>>
>>>>>>>>>>>>>> >>>> # blocdev --rereadpt /dev/nbd0
>>>>>>>>>>>>>> >>>>
>>>>>>>>>>>>>> >>>> # ls /dev/nbd0*
>>>>>>>>>>>>>> >>>> ## you will now have /dev/nbd0, /dev/nbd0p1 and
>>>>>>>>>>>>>> /dev/nbd0p2
>>>>>>>>>>>>>> >>>>
>>>>>>>>>>>>>> >>>> if this is not the case while the fdisk command ended
>>>>>>>>>>>>>> without error :
>>>>>>>>>>>>>> >>>>
>>>>>>>>>>>>>> >>>> # sync
>>>>>>>>>>>>>> >>>> # qemu-nbd -d /dev/nbd0
>>>>>>>>>>>>>> >>>> # qemu-nbd -c /dev/nbd0 /the/target
>>>>>>>>>>>>>> >>>>
>>>>>>>>>>>>>> >>>>
>>>>>>>>>>>>>> >>>> Le ven. 30 nov. 2018 à 14:04, ramakanth varala <
>>>>>>>>>>>>>> >>>> address@hidden>
>>>>>>>>>>>>>> >>>> a écrit :
>>>>>>>>>>>>>> >>>>
>>>>>>>>>>>>>> >>>>> Hi Pascal & Jakob,
>>>>>>>>>>>>>> >>>>>
>>>>>>>>>>>>>> >>>>> I started from first .
>>>>>>>>>>>>>> >>>>>
>>>>>>>>>>>>>> >>>>> I created manully the partitions as below
>>>>>>>>>>>>>> >>>>>
>>>>>>>>>>>>>> >>>>>   27  mknod /dev/nbd0p1 b 1 4
>>>>>>>>>>>>>> >>>>>   28  mknod /dev/nbd0p2 b 1 4
>>>>>>>>>>>>>> >>>>>
>>>>>>>>>>>>>> >>>>> still in /proc/partitions i don't see any info , it
>>>>>>>>>>>>>> shows as below
>>>>>>>>>>>>>> >>>>>
>>>>>>>>>>>>>> >>>>> address@hidden ~]# cat /proc/partitions
>>>>>>>>>>>>>> >>>>> major minor  #blocks  name
>>>>>>>>>>>>>> >>>>>
>>>>>>>>>>>>>> >>>>>   8     0   62914560 sda
>>>>>>>>>>>>>> >>>>>   8     1     104391 sda1
>>>>>>>>>>>>>> >>>>>   8     2   62806117 sda2
>>>>>>>>>>>>>> >>>>> 253     0   56655872 dm-0
>>>>>>>>>>>>>> >>>>> 253     1    6127616 dm-1
>>>>>>>>>>>>>> >>>>>
>>>>>>>>>>>>>> >>>>> address@hidden ~]# fdisk  -l /dev/nbd0
>>>>>>>>>>>>>> >>>>>
>>>>>>>>>>>>>> >>>>> Disk /dev/nbd0: 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/nbd0p1   *           1          13      104391
>>>>>>>>>>>>>>  83  Linux
>>>>>>>>>>>>>> >>>>> /dev/nbd0p2              14        2610    20860402+
>>>>>>>>>>>>>> 8e  Linux LVM
>>>>>>>>>>>>>> >>>>>
>>>>>>>>>>>>>> >>>>>
>>>>>>>>>>>>>> >>>>> when i try for mount , i see below error
>>>>>>>>>>>>>> >>>>>
>>>>>>>>>>>>>> >>>>>
>>>>>>>>>>>>>> >>>>> address@hidden ~]# mount /dev/nbd0p1
>>>>>>>>>>>>>> >>>>> /home/test/test.3.5.1b.debug/mnt/boot
>>>>>>>>>>>>>> >>>>> mount: you must specify the filesystem type
>>>>>>>>>>>>>> >>>>>
>>>>>>>>>>>>>> >>>>> i tried to give file system type as below, still issues.
>>>>>>>>>>>>>> >>>>>
>>>>>>>>>>>>>> >>>>> address@hidden ~]# mount -t ext3 /dev/nbd0p1
>>>>>>>>>>>>>> >>>>> /home/test/test.3.5.1b.debug/mnt/boot
>>>>>>>>>>>>>> >>>>> mount: wrong fs type, bad option, bad superblock on
>>>>>>>>>>>>>> /dev/nbd0p1,
>>>>>>>>>>>>>> >>>>>       missing codepage or other error
>>>>>>>>>>>>>> >>>>>       In some cases useful info is found in syslog - try
>>>>>>>>>>>>>> >>>>>       dmesg | tail  or so
>>>>>>>>>>>>>> >>>>>
>>>>>>>>>>>>>> >>>>>
>>>>>>>>>>>>>> >>>>> Any inputs would be really helpfull..
>>>>>>>>>>>>>> >>>>>
>>>>>>>>>>>>>> >>>>>
>>>>>>>>>>>>>> >>>>> Thanks
>>>>>>>>>>>>>> >>>>> Rama Kanth
>>>>>>>>>>>>>> >>>>>
>>>>>>>>>>>>>> >>>>> On Fri, Nov 30, 2018 at 1:50 PM Pascal <
>>>>>>>>>>>>>> address@hidden> wrote:
>>>>>>>>>>>>>> >>>>>
>>>>>>>>>>>>>> >>>>>> restart from zero if possible...
>>>>>>>>>>>>>> >>>>>>
>>>>>>>>>>>>>> >>>>>> # qemu-nbd -d /dev/nbd0
>>>>>>>>>>>>>> >>>>>> # modprobe -rv nbd
>>>>>>>>>>>>>> >>>>>>
>>>>>>>>>>>>>> >>>>>> # modprobe nbd
>>>>>>>>>>>>>> >>>>>> # qemu-nbd -c /dev/nbd0 /the/file
>>>>>>>>>>>>>> >>>>>> # blockdev --rereadpt /dev/nbd0
>>>>>>>>>>>>>> >>>>>> # fdisk -l /dev/nbd0
>>>>>>>>>>>>>> >>>>>> # mount /dev/nbd0p1 /mount/point
>>>>>>>>>>>>>> >>>>>>
>>>>>>>>>>>>>> >>>>>> Le jeu. 29 nov. 2018 à 17:32, Jakob Bohm <
>>>>>>>>>>>>>> address@hidden> a
>>>>>>>>>>>>>> >>>>>> écrit :
>>>>>>>>>>>>>> >>>>>>
>>>>>>>>>>>>>> >>>>>>> Check
>>>>>>>>>>>>>> >>>>>>>
>>>>>>>>>>>>>> >>>>>>>    cat /proc/partitions
>>>>>>>>>>>>>> >>>>>>>
>>>>>>>>>>>>>> >>>>>>> If the partitions are not listed there, the kernel
>>>>>>>>>>>>>> does not
>>>>>>>>>>>>>> >>>>>>> recognize them, perhaps the kernel doesn't recognize
>>>>>>>>>>>>>> that
>>>>>>>>>>>>>> >>>>>>> nbd0 is a "partitionable disk", and thus does not
>>>>>>>>>>>>>> create the
>>>>>>>>>>>>>> >>>>>>> internal nbd0p1 and ndb0p2 devices.
>>>>>>>>>>>>>> >>>>>>>
>>>>>>>>>>>>>> >>>>>>> If the partitions are listed there, you just need to
>>>>>>>>>>>>>> create the
>>>>>>>>>>>>>> >>>>>>> actual /dev/nbd0p1 and /dev/nbd0p2 file names with
>>>>>>>>>>>>>> mknod or
>>>>>>>>>>>>>> >>>>>>> figure out why your "/dev/" management software
>>>>>>>>>>>>>> (maybe udev,
>>>>>>>>>>>>>> >>>>>>> maybe something better) doesn't do that for you.
>>>>>>>>>>>>>> >>>>>>>
>>>>>>>>>>>>>> >>>>>>> On 29/11/2018 12:46, ramakanth varala wrote:
>>>>>>>>>>>>>> >>>>>>>> Still with some errors..
>>>>>>>>>>>>>> >>>>>>>>
>>>>>>>>>>>>>> >>>>>>>> address@hidden ~]# kpartx -a /dev/nbd0
>>>>>>>>>>>>>> >>>>>>>> read error, sector 0
>>>>>>>>>>>>>> >>>>>>>> read error, sector 1
>>>>>>>>>>>>>> >>>>>>>> read error, sector 29
>>>>>>>>>>>>>> >>>>>>>> address@hidden ~]# ls /dev/nbd
>>>>>>>>>>>>>> >>>>>>>> nbd0   nbd1   nbd10  nbd11  nbd12  nbd13  nbd14
>>>>>>>>>>>>>> nbd15  nbd2
>>>>>>>>>>>>>> >> nbd3
>>>>>>>>>>>>>> >>>>>>> nbd4
>>>>>>>>>>>>>> >>>>>>>>  nbd5   nbd6   nbd7   nbd8   nbd9
>>>>>>>>>>>>>> >>>>>>>>
>>>>>>>>>>>>>> >>>>>>>>
>>>>>>>>>>>>>> >>>>>>>>
>>>>>>>>>>>>>> >>>>>>>> On Thu, Nov 29, 2018 at 4:22 PM Nerijus Baliūnas <
>>>>>>>>>>>>>> >>>>>>>> address@hidden> wrote:
>>>>>>>>>>>>>> >>>>>>>>
>>>>>>>>>>>>>> >>>>>>>>> Please try kpartx -a /dev/nbd0
>>>>>>>>>>>>>> >>>>>>>>>
>>>>>>>>>>>>>> >>>>>>>>> 2018-11-29 12:38, ramakanth varala rašė:
>>>>>>>>>>>>>> >>>>>>>>>> thanks for the reply ..
>>>>>>>>>>>>>> >>>>>>>>>>
>>>>>>>>>>>>>> >>>>>>>>>> But i get below error when i do ..
>>>>>>>>>>>>>> >>>>>>>>>>
>>>>>>>>>>>>>> >>>>>>>>>>
>>>>>>>>>>>>>> >>>>>>>>>> address@hidden ~]# partx -a /dev/nbd0
>>>>>>>>>>>>>> >>>>>>>>>> HDIO_GETGEO: Inappropriate ioctl for device
>>>>>>>>>>>>>> >>>>>>>>>>
>>>>>>>>>>>>>> >>>>>>>>>> On Thu, Nov 29, 2018 at 4:04 PM Nerijus Baliūnas <
>>>>>>>>>>>>>> >>>>>>>>>> address@hidden> wrote:
>>>>>>>>>>>>>> >>>>>>>>>>
>>>>>>>>>>>>>> >>>>>>>>>>> 2018-11-29 12:10, ramakanth varala rašė:
>>>>>>>>>>>>>> >>>>>>>>>>>> address@hidden ~]# mount /dev/nbd0p1
>>>>>>>>>>>>>> >>>>>> /home/test.1.3.debug/mnt/boot
>>>>>>>>>>>>>> >>>>>>>>>>>> mount: special device /dev/nbd0p1 does not exist
>>>>>>>>>>>>>> >>>>>>>>>>> partx -a /dev/nbd0
>>>>>>>>>>>>>> >>>>>>>>>>>
>>>>>>>>>>>>>> >>>>>>>
>>>>>>>>>>>>>> >>>>>>>
>>>>>>>>>>>>>> >>>>>>> Enjoy
>>>>>>>>>>>>>> >>>>>>>
>>>>>>>>>>>>>> >>>>>>> Jakob
>>>>>>>>>>>>>> >>>>>>> --
>>>>>>>>>>>>>> >>>>>>> Jakob Bohm, CIO, Partner, WiseMo A/S.
>>>>>>>>>>>>>> https://www.wisemo.com
>>>>>>>>>>>>>> >>>>>>> Transformervej 29, 2860 Søborg, Denmark.  Direct +45
>>>>>>>>>>>>>> 31 13 16 10
>>>>>>>>>>>>>> >>>>>>> This public discussion message is non-binding and may
>>>>>>>>>>>>>> contain
>>>>>>>>>>>>>> >> errors.
>>>>>>>>>>>>>> >>>>>>> WiseMo - Remote Service Management for PCs, Phones
>>>>>>>>>>>>>> and Embedded
>>>>>>>>>>>>>> >>>>>>>
>>>>>>>>>>>>>> >>>>>>>
>>>>>>>>>>>>>> >>>>>>>
>>>>>>>>>>>>>> >>>>>>
>>>>>>>>>>>>>> >>>>>
>>>>>>>>>>>>>> >>>>
>>>>>>>>>>>>>> >>>
>>>>>>>>>>>>>> >>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]