WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: losetup: loopimage.img: No such file or directory  (Read 7569 times)

Offline halma

  • Full Member
  • ***
  • Posts: 164
losetup: loopimage.img: No such file or directory
« on: July 08, 2014, 10:13:52 AM »
Hi, i hope this is the right section to post

i am using tinycorelinux 5.3 (3.14.5-tinycore64)

i try to mount an loop image file with losetup but it fails with

tc@box: sudo losetup -f hdc.img -o 32256
losetup: hdc.img: No such file or directory

sometimes i dont know why i can mount the loop image without deleting any other loop device but most of times if i try it fails as written above

here is an strace of losetup
maybe someone knows how to fix this issue

http://pastebin.com/MeXcgHwC

moun.sh
Code: [Select]
#!/bin/sh

FILE=hdc.img
OFS=32256
LODEV=`losetup -f`
losetup -o $OFS $LODEV $FILE

thanks
best regards
« Last Edit: July 08, 2014, 10:20:56 AM by halma »
1 + 2 = 6  cause  10 - 6 = 78 ;-) lol

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: losetup: loopimage.img: No such file or directory
« Reply #1 on: July 08, 2014, 10:28:55 AM »
Use the losetup in util-linux.

Offline halma

  • Full Member
  • ***
  • Posts: 164
Re: losetup: loopimage.img: No such file or directory
« Reply #2 on: July 08, 2014, 11:39:20 AM »
ok i installed with tce the util-linux.tcz extension

after an reboot it tells me now:

tc@box: losetup -f -o 32256 hdc.img
losetup: not found unused device

and as sudo
tc@box: sudo losetup -f -o 32256 hdc.img
losetup: hdc.img: failed to setup loop device: No such file or directory
« Last Edit: July 08, 2014, 11:42:28 AM by halma »
1 + 2 = 6  cause  10 - 6 = 78 ;-) lol

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: losetup: loopimage.img: No such file or directory
« Reply #3 on: July 08, 2014, 11:58:13 AM »
Try adding "loop.max_loop=255" boot code to pre-configure the dev nodes.

Offline halma

  • Full Member
  • ***
  • Posts: 164
Re: losetup: loopimage.img: No such file or directory
« Reply #4 on: July 08, 2014, 12:14:57 PM »
i think this one works without changing anyting:

sudo /usr/local/sbin/losetup -o 32256 -f hdc.img
1 + 2 = 6  cause  10 - 6 = 78 ;-) lol

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: losetup: loopimage.img: No such file or directory
« Reply #5 on: July 08, 2014, 12:22:11 PM »
Check your $PATH variable.  /usr/local/sbin should be before /sbin.
If you loaded util-linux after booting, you may need to do a "hash -r" so ash does not pick up a previously run losetup instead of the newer one.

Offline expresspotato

  • Newbie
  • *
  • Posts: 11
Re: losetup: loopimage.img: No such file or directory
« Reply #6 on: February 28, 2015, 10:04:03 AM »
Try adding "loop.max_loop=255" boot code to pre-configure the dev nodes.

Awesome this worked adding it to uEnv.txt, thanks!