Welcome to the Linux Foundation Forum!

Using a File as a Disk Partition Image

olivieraf
olivieraf Posts: 8

hi!

i encountered a problem when trying this lab 17.1 on the VM...thus is it impossible to create loop partition in a Virtual Machine?

i got this error:

mount: /tmp/imagefile: failed to setup loop device: No such file or directory

regards,

Comments

  • i re-take the same labs with a RHEL Virtual Machine with success!

    maybe the problem is about the Centos VM i get from lftraining

     

  • coop
    coop Posts: 916
    edited December 2017

    not enough information.  The labs were developed on VMs do that is not a problem.  If you want help, post the actual commands you used and the actual output.

  • coop
    coop Posts: 916

    I did not see your successful comment.  One thing to check is what kernel you are running.  Other that that it should make no difference whether it is RHEL and CentOS

  • olivieraf
    olivieraf Posts: 8
    edited December 2017

    #uname -a

    Linux CentOS7 3.10.0-123.el7.x86_64

    #dd if=/dev/zero of=imagefile bs=1M count=512

    #mkfs.ext4 imagefile

    #mkdir mntpoint

    #mount -o loop imagefile mntpoint/

    and for the last commands i got this output:

    mount: /imagefile: failed to setup loop device: No such file or directory

     

    #losetup -f    give the following output:

    /dev/loop0

    #losetup /dev/loop1 imagefile

    losetup: /imagefile: failed to set up loop device: No such file or directory

    that is the issue!

  • coop
    coop Posts: 916
    edited December 2017

    I don't have to debug on a centos VM right now, tbut the message is tell ing you it can't find /imagesfile, not just imagefile.  So maybe you are sitting in / instead of wherever you made the imagefile?  Try giving the full path to the iamge file like /tmp/imagesfile etc.

Categories

Upcoming Training