Mount Btrfs from shell (kernel module compiled) - General Questions and Answers

hi to all, I have a problem installing a USB stick with a btrfs system file. I recompiled the kernel with the brtfs module. however I can not mount the device:
angler:/ # mount -t btrfs /dev/block/mmcblk0p1 /mnt/media_rw
angler:/ # mount /dev/block/vold/disk:8,0 /mnt/media_rw
Device or resource busy
Any tips?

Related

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] Question about how to mount a virtual disk

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 ?

find out FUSE mountpoints

hi guys.
i'm developing the gentoo extractor of dSploit and i've found a problem.
now that user can choose a custom directory for the gentoo root,
we must ensure that we can make symlinks in that folder.
from android 4.2 and above, the storage infrastructure uses FUSE.
create symlink where the ext FS is mounted on is fine.
create symlink where the FUSE is mounted on will fail.
Code:
[email protected]:/ # ln -s /system /storage/emulated/0/gentoo/test
link failed Function not implemented
[email protected]:/ # ln -s /system /data/media/0/gentoo/test
this happens because /storage/emulated/0 is a fuse bind mount of /data/media/0.
i think that the solution is to find what is mounted where and how.
how can i get FUSE mounts ?
/proc/mount will show /dev/fuse as source block device.
i need to have something that say:
Code:
source destination
/data/media/0 /storage/emulated/0
in order to replace "/storage/emulated/0" with "/data/media/0" and got symlink to work
thanks in advance for any help and suggestion.
-- tux_mind

Can only see sdcard as root.

I have a HTC One M8. I have a sdcard with 2 partitions. /dev/block/mmcblk1p1 is vfat, /dev/block/mmcblk1p2 is ext4. I've used this to mount the sdcard:
Code:
mount -o remount,rw /
mkdir /storage/sdcard3
mount -o remount,ro /
mount -t ext4 /dev/block/mmcblk1p2 /storage/sdcard3
mkdir /storage/sdcard0/user-data
sdcard /storage/sdcard3 /storage/sdcard0/user-data 1023 1023 &
As root in a terminal, I can read and write to /storage/sdcard0/user-data no problem, however none of the apps can see it, not even file managers with root access. Maybe there is an extra step involved for KitKat? I'm also using the HandleExternalStorage Xposed module, which at least helps with the vfat partition.
Bump.

Mounted as writable external HDD EXT4 formatted, not access able for apps for read or write!

I have rooted NSTV device with Android11, when I connect my external HDD (ext4 formatted) to it, the device notify me the HHD not supported.
I can mount the HDD successfully:
Code:
mount -w -t ext4 UUID=89087942-e2b5-4f4a-99d7-9818559c6844 /mnt/media_rw
The root privileged file manager apps can read & write to HDD (Root-Explorer or Solid-Explorer)
But I can't open my movies through the VLC, MxPlayer... apps (logcat is: Access denied), also I tried to 'chown & chmod' but I'm not success.
Can you help me to solve my problem please?!
I think the mount cmd should look like shown next if dynamic mount of an external HDD is wanted
Code:
su -c "mount -o rw,remount -t ext4 UUID=89087942-e2b5-4f4a-99d7-9818559c6844 /media"
@xXx yYy
Thank you for reply...
The path /media does not exist ! So I create it and try again mounting but not success
Code:
mdarcy:/ # mount -o rw,remount -t ext4 UUID=89087942-e2b5-4f4a-99d7-9818559c6844 /media
mount: '/media' not in /proc/mounts
#up
I'm trying to investigate... So I connect fat32 formatted USB-Flash to device, the mount result is:
Code:
/dev/block/vold/public:8,1 on /mnt/media_rw/7132-BE26 type vfat (rw,dirsync,nosuid,nodev,noexec,noatime,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
/mnt/media_rw/7132-BE26 on /mnt/runtime/default/7132-BE26 type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,mask=6)
/mnt/media_rw/7132-BE26 on /mnt/runtime/read/7132-BE26 type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,mask=18)
/mnt/media_rw/7132-BE26 on /mnt/runtime/write/7132-BE26 type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,mask=18)
/mnt/media_rw/7132-BE26 on /mnt/runtime/full/7132-BE26 type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,mask=7)
/dev/fuse on /mnt/user/0/7132-BE26 type fuse (rw,lazytime,nosuid,nodev,noexec,noatime,user_id=0,group_id=0,allow_other)
/dev/fuse on /mnt/installer/0/7132-BE26 type fuse (rw,lazytime,nosuid,nodev,noexec,noatime,user_id=0,group_id=0,allow_other)
/dev/fuse on /mnt/androidwritable/0/7132-BE26 type fuse (rw,lazytime,nosuid,nodev,noexec,noatime,user_id=0,group_id=0,allow_other)
/dev/fuse on /storage/7132-BE26 type fuse (rw,lazytime,nosuid,nodev,noexec,noatime,user_id=0,group_id=0,allow_other)
/mnt/media_rw/7132-BE26 on /mnt/pass_through/0/7132-BE26 type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,mask=7)
So it seems the /dev/block/vold/ is start point:
#ls -hal /dev/block/vold/ result is:
Code:
brw------- 1 root root 8, 0 2021-11-18 01:58 disk:8,0
brw------- 1 root root 8, 1 2021-11-18 01:58 public:8,1
So I connect my external HDD (ext4 formatted) and #ls -hal /dev/block/vold/ result is:
Code:
disk:8,16
Then I try to mount it:
Code:
mdarcy:/ # busybox mount -w -t ext4 /dev/block/vold/disk:8,16 /mnt/media_rw/ext_hdd
mount: mounting /dev/block/vold/disk:8,16 on /mnt/media_rw/ext_hdd failed: Invalid argument
HOW I CAN MOUNT /dev/block/vold/disk:8,16 ?

Categories

Resources