We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thanks for the great package!
I use the example program to attach one device, but seems like unable to mount it. Can you help with it?
# losetup NAME SIZELIMIT OFFSET AUTOCLEAR RO BACK-FILE DIO LOG-SEC /dev/loop0 0 0 0 0 /tmp/deploy/newimage.img 0 512 # fdisk -l Disk /dev/loop0: 4.9 GiB, 5242880000 bytes, 10240000 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 Disklabel type: dos Disk identifier: 0x9f0032d8 Device Boot Start End Sectors Size Id Type /dev/loop0p1 * 2048 2099199 2097152 1G 83 Linux /dev/loop0p2 2099200 3123199 1024000 500M 82 Linux swap / Solaris /dev/loop0p3 3123200 10239999 7116800 3.4G 83 Linux # mount /dev/loop0p1 ./tt/ mount: /tmp/deploy/tt: special device /dev/loop0p1 does not exist.
The text was updated successfully, but these errors were encountered:
example codes:
import ( "fmt" "log" "os" "github.com/freddierice/go-losetup/v2" ) func main() { // attach a raw file to a loop device dev, err := losetup.Attach(os.Args[1], 0, false) if err != nil { // error checking log.Fatal(err) } fmt.Printf("attached %s to %v\n", os.Args[1], dev.Path()) /* err = dev.Detach() if err != nil { // error checking log.Fatal(err) } */ }
Sorry, something went wrong.
Seems like missing -P scan option. Maybe set it as default?
-P
Successfully merging a pull request may close this issue.
Thanks for the great package!
I use the example program to attach one device, but seems like unable to mount it. Can you help with it?
The text was updated successfully, but these errors were encountered: