freddierice / go-losetup Goto Github PK
View Code? Open in Web Editor NEWA losetup implementation for go-lang
License: MIT License
A losetup implementation for go-lang
License: MIT License
hey!
it'd be great to tag a new release with the latest commits at some point :-)
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.
See https://lkml.org/lkml/2021/6/15/185, w/ the upstream util-linux maintainer agreeing to do likewise for the command-line losetup
tool.
This error can also happen while changing the block size.
It's not unreasonable to make this the caller's job (so they can make decisions about number of retries, delays between them, etc); but it's probably worth documenting the need for the caller to check for the case if that's the chosen behavior.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.