[Q] Question about how to mount a virtual disk - Android Software/Hacking General [Developers Only]

I have a rooted andriod phone v2.3.2.
Can I mount a virtual disk using something like 'mount -o loop ....' ?
I opened a terminal , then
# su
# cd /data
# install -d test_mnt
# mount -o loop -t vfat /mnt/sdcard/a_vfat.img /mnt/data/test_mnt
I got this error
ioctl LOOP_SET_FD failed: Device or resource busy
Does anyone have solution ?

Related

debian install help

in the debian install method, i get a problem with the second of these two commands.
_ mkdir -p $mnt
_ mount -o loop,noatime $kit/debian.img $mnt
i enter it exactly as on screen, and i get this error message:
mount: mounting /dev/block/loop2 on /data/local/mnt failed: Invalid argument
i am lost and confused as to what is causing this. any ideas?
Try:
modprobe ext2
Do this before mounting the debian.img.
Many thanks. Worked a treat​

Debian in Haykuro/Cupcake builds

Hello all,
I've been trying for some time now to get Debian to work on the Haykuro bulds, but I can't seem to get things to mount. Anybody have any ideas?
This is the script that is supposed to start it up:
=============SCRIPT START==============
clear
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
echo "Android Filesytem remounted as read/write"
export kit=/sdcard/debian
export bin=/system/xbin/bb
export mnt=/data/local/mnt
export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
busybox insmod ext2
mknod /dev/loop2 b 7 0
clear
mount -o loop,noatime $kit/debian.img $mnt
mount -t devpts devpts $mnt/dev/pts
mount -t proc proc $mnt/proc
mount -t sysfs sysfs $mnt/sys
sleep 1
echo "Starting init process"
sleep 1
echo "INIT: Debian booting....."
sleep 1
echo "Running Linux Kernel"
sysctl -w net.ipv4.ip_forward=1
sleep 1
echo "AutoMounter started"
sleep 1
echo "Type EXIT to end session"
echo "Make sure you do a proper EXIT for a clean kill of Debian!"
echo " "
chroot $mnt /bin/bash
busybox umount -f /data/local/mnt/dev/pts /data/local/mnt/proc /data/local/mnt/sys /data/local/mnt
echo "Filesystems have unmounted"
sleep 3
busybox losetup -d /dev/block/loop2
===============END SCRIPT==================
This is the result I get when I run it:
===============RUN SCRIPT START=============
←[H←[JAndroid Filesytem remounted as read/write
insmod: /lib/modules/2.6.27-04102009-daproy: No such file or directory
insmod: /lib/modules: No such file or directory
insmod: ext2.ko: module not found
mknod: /dev/loop2: File exists
←[H←[J
mount: mounting /sdcard/debian/debian.img on /data/local/mnt failed: Block devic
e required
mount: mounting devpts on /data/local/mnt/dev/pts failed: No such file or direct
ory
mount: mounting proc on /data/local/mnt/proc failed: No such file or directory
mount: mounting sysfs on /data/local/mnt/sys failed: No such file or directory
Custom Linux Pseudo Bootstrapper V1.0 - by Mark Walker
WEB: http://www.androidfanatic.com
EML: [email protected]
Starting init process
INIT: Debian booting.....
Running Linux Kernel
net.ipv4.ip_forward = 1
AutoMounter started
Type EXIT to end session
Make sure you do a proper EXIT for a clean kill of Debian!
chroot: cannot execute /bin/bash: No such file or directory
umount: forced umount of /data/local/mnt/dev/pts failed!
umount: cannot umount /data/local/mnt/dev/pts: No such file or directory
umount: forced umount of /data/local/mnt/proc failed!
umount: cannot umount /data/local/mnt/proc: No such file or directory
umount: forced umount of /data/local/mnt/sys failed!
umount: cannot umount /data/local/mnt/sys: No such file or directory
umount: forced umount of /data/local/mnt failed!
umount: cannot umount /data/local/mnt: Invalid argument
Filesystems have unmounted
losetup: : No such file or directory
Loopback device shutdown - success
==============End===============
I was hoping someone could help me out with this. I would really appreciate it. I am running 5.0.1G (Haykuro's build). I have tried asking him, but neither of us have the knowledge of how to fix the problems.
Thanks.
Check the first lines in the script that begin with "export..." .
For example if your debian image is located like defined in "export kit..."
Or if the binary paths are all correct. I think the problem is that there is probably no /system/xbin within your image like in the JF image. So the script can't find the tools it needs.
EDIT//
You can probably ignore the above part....
The problem is that the script doesn't load the "ext2" filesystem kernelmodule which is needed to mount Debian.
But i don't know if the script only look at the wrong place or if the ext2.ko module isn't available within your image.
You can search for the module by typing the following into a terminal:
find / -name "ext2.ko"
check if /data/local/mnt exists, if not , mkdir /data/local/mnt.
xbin is there. There is no need for ext2.ko because it is built into the kernel already (asked haykuro himself). /data/local/mnt exists. The export statement is right, my debian image is in /sdcard/debian.img.
Any other ideas?
I am running haykuro's 4.5g build. The latest one.
damageless said:
..... is right, my debian image is in /sdcard/debian.img.
Click to expand...
Click to collapse
Mhm. But that would be wrong...
Has to be in /sdcard/debian/debian.img
So try to create debian subfolder.
Okay, my bad. It's in /sdcard/debian/debian.img.
Any ideas?
I will try to help with this in a few hours. I have the 5.0.2Hr2-appstosd-signed image on my phone, a 1.2 GB ext2 filesystem partition on my SD Card (only a Class-4, it's really dog slow for most apps!), and I am working on getting debian functional within /system/sd.
I don't like the idea of having 3 "different" filesystems on my SD card, so I wanted to utilize the ext2 partition I use for apps/cache for Debian also, this would ensure that I could leave it mounted all the time without worrying about Debian dying if I mount the FAT32 partition onto my computer.
Praeluceo said:
I will try to help with this in a few hours.
Click to expand...
Click to collapse
I would really appreciate that. I was thinking the same thing, but I don't know how to do it.
Well that got nowhere quick. Any other ideas?
modprobe ext2
ok i just tried that, that was the solution previously when running debian, yu had to load the ext2 module, but something must be missing in the new build as i get
cannot parse modules.dep
Got the same error
I receive the same error message. Found a solution at the bottom of the first post:
http://forum.xda-developers.com/showthread.php?t=507291&highlight=debian
download updated scripts
it seems to be ok for me
----------------------------------
In fact, i cannot achieve any apt-get.
Phone block before and i'm unable to do anything in terminal, neither shutingdown.
I've tried with "terminal emulator" on phone and with adb shell.
HTC Orange
1.5G
---------------------------------
new image from duke
-> ok

[Q] spending lots of time with segmentation fault error (chroot)

spending lots of time with segmentation fault error (chroot)
I success to open up ubuntu GUI on my android
with following site
(first googled site with "cyanogenmod ubuntu")
but fail with other imgs(such as img in nexusonehack)
for now, I am trying to bootup ubuntu 10.10 on my gw620(smart phone whose cpu is ARMv6 Qualcomm MSM7200)
by my self.
with selfmade rootstock img and busybox and chroot
I made img my self withroot stock with following option
rootstock -f kty1104-Notebook -l kty1104 -p 1 --imagesize 2047M --notarball --seed linux-image-omap,lxde,build-essential,openssh-server,tightvncserver,x11-xserver-utils
and change name to ubuntu.img and place to /sdcard/
and apply to bootubuntu.sh
bootubuntu.sh contents is this
===============================================
#!/system/bin/sh
# Original script by Paolo Sammicheli xdatap1
#
# Based on Saurik's remount.sh modified version by Mark Walker of
# URL is here but I can't write url b/c of my account privilege
# Modified version for Cyanogenmod by potoc samdroid
mkdir /mnt/ubuntu
#remount system as read/write
remount rw
export mnt=/mnt/ubuntu
export PATH=/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
export kit=/sdcard
export loopdev=/dev/block/loop4
losetup $loopdev $kit/ubuntu.img
mount -t ext2 $loopdev $mnt
mount -t devpts devpts $mnt/dev/pts
mount -t proc proc $mnt/proc
mount -t sysfs sysfs $mnt/sys
cat $mnt/root/logo.txt
echo " "
echo "Type EXIT to end session"
echo "Make sure you do a proper EXIT for a clean umount!"
echo " "
echo "Please reboot your device when you finished your work."
chroot $mnt /bin/bash
busybox umount -f /mnt/ubuntu/dev/pts /mnt/ubuntu/proc /mnt/ubuntu/sys /mnt/ubuntu
===============================================
do I need more option for rootstock?
or do I need special sh file for it?
I can mount ubuntu.img with
# mknod -m640 /dev/loop0 b 7 8
losetup /dev/loop0 /sdcard/ubuntu.img
mount -t ext2 /dev/loop0 /mnt/ubuntu
but when it comes to chroot, it sprit [1] segmentation fault chroot ${mnt} /b...#
if there are missing information please let me know, I will write it down
Regards.
Taeyun
I know I musn't revive old threads... but the question and the problem is already set up here.
I'm having the same problem with my HTC Magic 32A. Anybody knows what's up with the segfault?
Thanks!
I've spent a lot of time on this issue too, and as far as I can tell it's because Ubuntu versions over 9.04 (jerking jackalope or whatever idiot name they use) no longer support ARMv6. This means I can't run BT5, which is based on 10.x, but I believe Debian still supports v6.

[Q] Moto G (XT1032) Internal partition formatted problem

My first gen moto g is stuck in a bootloop, everything i have done so far has not worked.I have tried to flash using fastboot and mfastboot with different stock images in all I get failed to erase partition, remote failure.
The internal storage says it has 0 mb of space. I have Twrp installed and using cat /proc/partitions finds no partitions
~ # ←[6ncat /proc/partitions cat /proc/partitions major minor #blocks name
I have managed to push a Stock rom but can´t flash it with mount data error,mount sd card error, mount system error and mount cache error..
I have tried to use Adb remount but it fails
remount failed: Success
I also tried the following commands
adb shell
su
mount -o rw,remount -t yaffs2 /system
mount -o rw,remount -t yaffs2 /data
mount -o rw,remount -t yaffs2 /cache
And they give the following error
adb shell ~ # ←[6nsu su /sbin/sh: su: not found ~ # ←[6nmount -o rw,remount -t yaffs2 /system mount -o rw,remount -t yaffs2 /system mount: can't find /system in /proc/mounts ~ # ←[6nmount -o rw,remount -t yaffs2 /data mount -o rw,remount -t yaffs2 /data mount: can't find /data in /proc/mounts
In recovery mode, i went to advanced, then Terminal Command, then entered the command df and it listed
Filesystem 1K BLocks Used Available %Use
tmpfs/dev 443852 48 443804 0
tmpfs/tmp 443852 24 443828 0
I have also uploaded a recovery.log
Any help would be greatly appreciated
I have found this xda post with the partition table and sizes of the moto g. http://forum.xda-developers.com/showpost.php?p=48855450&postcount=35
I also found this xda post where they partition the emmc http://forum.xda-developers.com/showthread.php?t=2596521 , if someone could help me identify what should I put in adb.
I think the solution is to reformat using adb but i dont know how.
I have the exact same problem and would love to know if you have fixed it please.

[Q]android M,adb shell can't mount partition.Permission denied

Hi there,Since my M9 update to android M.I want to deodex RUU like what I did in android 5.0.
Code:
adb shell
su
stop
mount -o rw,remount -t ext3 /dev/block/mmcblk1p21 /system
this is what I did.and shows like this
Code:
[email protected]_himaulatt:/ $ su
[email protected]_himaulatt:/ # stop
mount -o rw,remount -t ext3 /dev/block/mmcblk1p21 /system
mount: Permission denied
I don't know what should I do. I use charge only option when I plug to USB.
if there any solution.I will be very happy:silly:

Categories

Resources