Quote:
Originally Posted by geekmaster
As far as I know, no (automatic) loop mount is used (unless I am misunderstanding something here).
But his command did not include "mount -o loop", and without the "loop", are you sure it is the same as losetup?
|
I executed exactly that command (just with
-o <offset>, without
-o loop) on KT and there was new mounted loop device in
mount output.
Quote:
Originally Posted by geekmaster
And as I see it, the whole point of your exercise is to mount a raw partition that you created instead of mounting an image file, to avoid problems experienced with out-of-memory errors while using loop mounts. Remind me again, WHY are we loop mounting here?
|
Explicit offset (and loop mounting) is required, because location of that new partition is unknown to OS (because it can't access parition table at /dev/mmcblk0p4), not because of my preference.
Quote:
Originally Posted by EternalCyclist
Code:
fdisk -l /dev/mmcblk0p4
Code:
sfdisk --force -l /dev/mmcblk0p4
When USB drive is exported to the PC:
also shows the ''secondary'' partition table.
Adding the offset to the start value in the partition table avoids the need to remember this offset.
|
I missed the point of your demonstration, sorry. I know how to look into that parition table. I'm calculating offset with looking into parition table. I'm using number just because this calculation could be done once and this number could be then remembered, written into some user file (upstart script, for example), etc.
What I don't know is how to mount with, say
mount /dev/mmcblk0p4p2 instead of using
losetup.
Quote:
Originally Posted by NiLuJe
Just a quick note to point out that (according to the PW's cramfs mount scripts), loop/1 is historically reserved for the SDCard (while loop/0 is the userstore). (And the PW uses a couple of loop devices for cramfs, too).
|
Thanks. Good note.
Quote:
Originally Posted by knc1
Notes:
There is (should be, don't know the behavior of your Busybox build) a: "find next free" loop device option.
No need to hard code which one to use, lots of reasons to not do so.
|
There is
losetup -f, but it always displays
/dev/loop0:
Code:
[root@kindle root]# mount
rootfs on / type rootfs (rw)
/dev/root on / type ext3 (ro,noatime,nodiratime,data=writeback)
none on /proc type proc (rw,nosuid,nodev,noexec,relatime)
none on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev type tmpfs (rw,relatime,mode=755)
tmpfs on /dev/shm type tmpfs (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620)
tmpfs on /var type tmpfs (rw,relatime,size=32768k)
/dev/loop/1 on /mnt/newpart type ext3 (rw,relatime,errors=continue,data=writeback)
/dev/mmcblk0p3 on /var/local type ext3 (rw,relatime,errors=continue,data=writeback)
fsp on /mnt/us type fuse.fsp (rw,nosuid,nodev,noatime,user_id=0,group_id=0)
/dev/loop/0 on /mnt/base-us type vfat (rw,noexec,noatime,nodiratime,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
[root@kindle root]# losetup -h
losetup: invalid option -- 'h'
BusyBox v1.17.1 (2012-07-17 16:29:54 PDT) multi-call binary.
Usage: losetup [-o OFS] LOOPDEV FILE - associate loop devices
losetup -d LOOPDEV - disassociate
losetup [-f] - show
Options:
-o OFS Start OFS bytes into FILE
-f Show first free loop device
[root@kindle root]# losetup -f
/dev/loop0