chroot repair of ubuntu partition, /dev/pts and "openpty" - EVO 4G Q&A, Help & Troubleshooting

I have succsessfully setup ubuntu on my phone with the everyday (ubuntu1.1) image. http://forum.xda-developers.com/showthread.php?t=823370
I got Hamachi (networking) working with it, however it was never able to mount windows shares. It would mount linux however.
Anyway I was playing with rootstock https://wiki.ubuntu.com/ARM/RootfsFromScratch
to make my own maveric image
Its really much better ,faster and cheaper than the above mentioned.
Have hamachi networked to home computer reading and writing to windows 7 nicely.
Running many programs
Just one problem :[ the terminal I does not work. I have to use adb shell
my reaserch says if system cannot write to /dev/pts terminal wont work.
I get "Can not write log, openpty() failed (/dev/pts not mounted?)" when using apt-get(which i never had an issue with, with the old image)
Could this be of any help: "I have learned that some things, especially grub and update-initramfs, need to have more of a running system to operate than chroot can provide, including having a "real" /dev tree active.
SO before you chroot, you need to mount some things from your running system into the place you're going to chroot into. If your target system is mounted onto /mnt, here's what you do
Code:
$ sudo mount --bind /dev /mnt/dev
$ sudo mount --bind /proc /mnt/proc
$ sudo mount --bind /sys /mnt/sys
NOW chroot into /mnt and hopefully you can successfully apply your updates
If you would like to help me the scripts are here if you care to look http://forum.xda-developers.com/showthread.php?t=823370

Related

[Q] Correct path in Terminal Emulator?

I have spent hours trying to find an answer to what I thought was a simple question, but I just can't seem to find it...
I wanted to familiarize myself more with Terminal Emulator, so I used it to delete a system app that needed to go.
I used these commands:
$ su
# mount -o remount,rw -t yaffs2 /dev/block/mtdblk3 /system
# rm /system/app/xxx.apk
It appears to have worked perfectly after a reboot, but my question is: what is the correct code to mount your system partition in TE? I have seen several variations of the line I used. Often they vary at 'mtdblk3.' I have seen it 'mtdblock5,' for example. Is there a particular line I should use for my specific device? Is it dependent on what I am specifically trying to do?
Any information is greatly appreciated; even/especially a link toward my answer. Thank you very much.
I've always used 'mount -o remount,rw /dev/block/mmcblk0p25 /system'
as far as 'correct' code I don't think there is as such. But I think different devices would have different partitions and mount points for system.
-Nipqer
I think it will depend on where your system is mounted, although I don't know why that would vary for the G2. It might be different for the DZ and certainly for other devices.
You can type "mount" in the terminal to see where everything is mounted.
Ditamae said:
I have spent hours trying to find an answer to what I thought was a simple question, but I just can't seem to find it...
I wanted to familiarize myself more with Terminal Emulator, so I used it to delete a system app that needed to go.
I used the code:
$ su
# mount -o remount,rw -t yaffs2 /dev/block/mtdblk3 /system
# rm /system/app/xxx.apk
It appears to have worked perfectly after a reboot, but my question is: what is the correct code to mount your system partition in TE? I have seen several variations of the line I used. Often they vary at 'mtdblk3.' I have seen it 'mtdblock5,' for example. Is there a particular line I should use for my specific device? Is it dependent on what I am specifically trying to do?
Any information is greatly appreciated; even/especially a link toward my answer. Thank you very much.
Click to expand...
Click to collapse
i use this command:
# mount -w -o remount /dev/block/mmcblk0p25 /system
Thanks for the replies... I see now, that the path I should have used is: /dev/block/mmcblk0p25 /system. And that "code" was the wrong word. I was asking about commands & paths not code. Sorry - still learning.
edit: If anyone knows of a good and thorough resource of Terminal commands, I'd love it if you'd share... I've found bits and pieces of info, but something more comprehensive would be great. Thanks again.
Wow you guys are going about it using the long hand method. If you're just deleting a system app, to mount the /system as rw just enter:
Code:
$su
#mount -o remount,rw /system
#rm -f /system/app/xxxx.apk
The -f command isn't really needed but I use it to make sure the job gets done. Not sure if the pm uninstall command is used anymore. I'll have to look into that. I know some phones required you to mount yaffs and mmcblockXX but for just deleting an app I don't believe it's required. Never had an issue not typing that.
Here's the correct way to delete the app:
mount -o rw,remount /system
rm /path/to/app
reboot
Click to expand...
Click to collapse
Or you could use remount,rw. It's the same command. I threw reboot in there to reload the app list in your launcher correctly.

Calibre in Nook Touch

I installed Calibre on my Nook Touch to fetch news and serve contents to reader programs in my Nook Touch. The method can be used with other Android devices. In short, Calibre is installed in Debian 6.0.0 chroot environment in Android 2.1. The steps are as follows:
1. Prepare a Debian 6.0.0 package for an ARM-based CPU using this command in a PC with Debian 6.0.0:
Code:
debootstrap --arch armel --foreign squeeze debian --verbose http://ftp.debian.org/debian
Instead of making the package by yourself, you can download my package from http://www.4shared.com/file/RRuFfjRf/debiantar.html
and uncompress it to the folder “debian”
2. Make an EXT2 partition on an SD card. The partition size should be larger than 1 GB. On a Windows PC, you can use MiniTool Partition Wizard Home Edition. Then use a Debian Live CD or Linux in a virtual machine to copy the folder (in Step 1) to the new partition.
3. Connect to the device
Code:
adb connect 192.168.XXX.XXX
adb shell
4. Mount partition of the SD card to a directory. In my case, I use /data/local/mnt as a mounting point. Note that my partition is at /dev/block/vold/179:21. You may need to find your partition by trial-and-error.
Code:
cd /data/local/
mkdir mnt
mount -t ext2 -o noatime /dev/block/vold/179:21 /data/local/mnt
5. Setup the chroot environment. Read References at the end of this post for details.
Code:
cd /data/local/mnt
chroot debian /bin/bash
export PATH=/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
export USER=root
mount -t devpts devpts /dev/pts
mount -t proc proc /proc
mount -t sysfs sysfs /sys
/debootstrap/debootstrap --second-stage
echo 'nameserver 8.8.8.8' > /etc/resolv.conf
echo 'deb http://ftp.debian.org/debian squeeze main' > /etc/apt/sources.list
apt-get update
6. Install calibre 0.7.7 (larger than 400 MB). The program is installed to /usr/share/calibre/
Code:
apt-get install calibre
apt-get install python-routes
7. Set environment variables in .bashrc
7.1 Copy .bashrc to the local PC.
Code:
adb pull /data/local/mnt/debian/root/.bashrc
7.2 Add the following commands to .bashrc
Code:
export LANG=en_US.UTF-8
export TZ=Asia/Bangkok
export PATH=/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
export USER=root
7.3 Send .bashrc to the device
Code:
adb push .bashrc /data/local/mnt/debian/root/
8. To use Calibre, enter the chroot environment:
Code:
chroot /data/local/mnt/debian /bin/bash
Try the following commands: (My epup files are in /usr/share/calibre/serve/)
Code:
ebook-convert /usr/share/calibre/recipes/cnn.recipe /usr/share/calibre/serve/cnn.epub
calibredb add --duplicates --with-library /var/www/ /usr/share/calibre/serve/cnn.epub
calibre-server --with-library /var/www/ --daemonize
9. There are several ways to access epub files to use in CoolReader, Aldiko, or other readers for Android
- calibre server
- lighttpd webserver
- mounting the directory in the chroot to the SD card
I prefer the third option because I don't need to run the server all the time.To mount the directory in chroot to a mounting point in the SD card, do this:
Code:
mount -o bind /data/local/mnt/debian/usr/share/calibre/serve/ /sdcard/eBooks/Calibre
In Coolreader/Aldiko, epub files can be accessed from /sdcard/eBooks/Calibre.
10. SUMMARY
10.1 When rebooting your device, you will need to input the following commands to mount the partition and directory, and setup chroot. You can use "Terminal Emulator" to do it on your Nook Touch.
Code:
mount -t ext2 -o noatime /dev/block/vold/179:21 /data/local/mnt
mount -o bind /data/local/mnt/debian/usr/share/calibre/serve/ /sdcard/eBooks/Calibre
chroot /data/local/mnt/debian /bin/bash -c "/bin/mount -t devpts devpts /dev/pts"
chroot /data/local/mnt/debian /bin/bash -c "/bin/mount -t proc proc /proc"
chroot /data/local/mnt/debian /bin/bash -c "/bin/mount -t sysfs sysfs /sys"
10.2 Every morning you can fetch news by running Terminal Emulator and enter the following command. When opening CoolReader, the morning news is there
Code:
su
chroot /data/local/mnt/debian /bin/bash
ebook-convert /usr/share/calibre/cnn.recipe /usr/share/calibre/serve/cnn.epub
If you have a cleaner solution for this step (10.2), please share
References
http://kristof.vanhertum.be/?p=132
http://www.nslu2-linux.org/wiki/DS101/Debian
http://evilzone.org/android/debian-on-android/
http://www.saurik.com/id/10
http://packages.python.org/APScheduler/
http://www.read.in.th/node/1164
Hello, I cannot go on after the last line:
cd /data/local/mnt
chroot debian /bin/bash
export PATH=/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
export USER=root
Click to expand...
Click to collapse
When I try to:
mount -t devpts devpts /dev/pts
Click to expand...
Click to collapse
I receive: mount: only root can do that (effective UID is 1000)
If I type "mount" I receive: warning: can't open /etc/mtab: no such file or directory
If I try to skip mount devpts, proc and sysfs and start debootstrap second stage I receive:
W: Failure trying to run: mount -t proc proc /proc
Update:
I used debian.tar.gz. Then I decided to prepare a debian package by myself.
I skip mount devpts, proc and sysfs and start debootstrap second stage:
Code:
/debootstrap/debootstrap --second-stage
The out put is:
I: Installing core packages...
W: Failure trying to run: dpkg --force-depends --install /var/cache/apt/archives/base-files_6.0squeeze5_armel.deb /var/cache/apt/archives/base-passwd_3.5.22_armel.deb
Update2:
Finaly I run: export PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin
and second stage started.

[HOW TO] Check your filesystem (a la 'fsck')

I've been having lots of trouble with my SD and local filesystems getting corrupted, which in turn has been causing the flush-179 process to go ballistic (100% CPU loop, reboot hangs, etc.). If only there was a way to run a quick FSCK(8) on my Android's unmounted filesystems to check for problems. Well, there is!
This may be old, old news to some of the more seasoned OS hackers, so please be kind with any negative feedback about it being intuitively obvious. It wasn't to me, but after some research and testing, I've come up with these simple steps:
Boot into Recovery
Connect via USB to ADB shell
Code:
C:\Scratch\Android> [B]adb devices[/B]
C:\Scratch\Android> [B]adb shell[/B]
Mount /system and /data to determine the /dev/block names, then umount each
Code:
~ # [B]mount /system[/B]
~ # [B]mount /data[/B]
~ # [B]df[/B]
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 308620 64 308556 0% /dev
/dev/block/mmcblk0p27
295509 121021 159231 43% /cache
/dev/block/mmcblk0p26
1184268 848052 276060 75% /data
/dev/block/mmcblk0p25
562384 461416 72400 86% /system
~ # [B]umount /system[/B]
~ # [B]umount /data[/B]
Run e2fsck against each /dev/block filesystem
Code:
~ # [B]e2fsck -n /dev/block/mmcblk0p25[/B]
e2fsck 1.41.6 (30-May-2009)
/dev/block/mmcblk0p25: clean, 4168/35760 files, 117605/142847 blocks
~ # [B]e2fsck -n /dev/block/mmcblk0p26[/B]
e2fsck 1.41.6 (30-May-2009)
/dev/block/mmcblk0p26: clean, 7173/75200 files, 216745/300799 blocks
~ #
The 'e2fsck' command takes the same command-line switches as UNIX FSCK(8), so you can be as creative and daring as you need.
- Dave
some help
ViperGeek said:
I've been having lots of trouble with my SD and local filesystems getting corrupted, which in turn has been causing the flush-179 process to go ballistic (100% CPU loop, reboot hangs, etc.). If only there was a way to run a quick on my Android's unmounted filesystems to check for problems. Well, there is!
This may be old, old news to some of the more seasoned OS hackers, so please be kind with any negative feedback about it being intuitively obvious. It wasn't to me, but after some research and testing, I've come up with these simple steps:
Boot into Recovery
Connect via USB to ADB shell
Code:
C:\Scratch\Android> [B]adb devices[/B]
C:\Scratch\Android> [B]adb shell[/B]
Mount /system and /data to determine the /dev/block names, then umount each
Code:
~ # [B]mount /system[/B]
~ # [B]mount /data[/B]
~ # [B]df[/B]
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 308620 64 308556 0% /dev
/dev/block/mmcblk0p27
295509 121021 159231 43% /cache
/dev/block/mmcblk0p26
1184268 848052 276060 75% /data
/dev/block/mmcblk0p25
562384 461416 72400 86% /system
~ # [B]umount /system[/B]
~ # [B]umount /data[/B]
Run e2fsck against each /dev/block filesystem
Code:
~ # [B]e2fsck -n /dev/block/mmcblk0p25[/B]
e2fsck 1.41.6 (30-May-2009)
/dev/block/mmcblk0p25: clean, 4168/35760 files, 117605/142847 blocks
~ # [B]e2fsck -n /dev/block/mmcblk0p26[/B]
e2fsck 1.41.6 (30-May-2009)
/dev/block/mmcblk0p26: clean, 7173/75200 files, 216745/300799 blocks
~ #
The 'e2fsck' command takes the same command-line switches as UNIX FSCK(8), so you can be as creative and daring as you need.
- Dave
Click to expand...
Click to collapse
on my phone i have a fiel called fsck.exfat and fsck_msod i think and im trying to run one (though not sure what the difference is) to fix some corrupted files in data internally. im trying to see if the file can be run through recovery without putting it through adb to unmount the data. im not too sure how to figure out what the data block is called because when i rum the mount i get a ton of different blocks (about 32 of them).
im trying to clean up the lost+found files i have and i have 3 of from a corrupted nandroid
robcop19 said:
on my phone i have a fiel called fsck.exfat and fsck_msod i think and im trying to run one (though not sure what the difference is) to fix some corrupted files in data internally. im trying to see if the file can be run through recovery without putting it through adb to unmount the data. im not too sure how to figure out what the data block is called because when i rum the mount i get a ton of different blocks (about 32 of them).
im trying to clean up the lost+found files i have and i have 3 of from a corrupted nandroid
Click to expand...
Click to collapse
Hi Rob.
I'm not sure if I can be of any specific assistance. exFAT is a type of filesystem format, like UNIX/Android ext3 and ext4, but beyond that, I couldn't tell you what those programs do. I do know that on some operating systems, the only way to fix the file chains and blocks is to make sure it's unmounted in single user mode. ADB is the closest we Android guys can get to UNIX single user mode without some clever Recovery Mode ZIP file programming.
– Dave
alrighty
ViperGeek said:
Hi Rob.
I'm not sure if I can be of any specific assistance. , but beyond that, I couldn't tell you what those programs do. I do know that on some operating systems, the only way to fix the file chains and blocks is to make sure it's unmounted in single user mode. ADB is the closest we Android guys can get to UNIX single user mode without some clever Recovery Mode ZIP file programming.
– Dave
Click to expand...
Click to collapse
well thank you for at least writing back on it. im not sure how to run adb let alone run the progrma to try and fix this but i will be learning up on it
robcop19 said:
well thank you for at least writing back on it. im not sure how to run adb let alone run the progrma to try and fix this but i will be learning up on it
Click to expand...
Click to collapse
ADB isn't all that difficult to use. Here's a good primer on it:
http://droidlessons.com/how-to-install-adb-on-a-windows-7-pc/
Once installed, just boot your phone into Recovery (power off completely, then power on with the Vol Down key held, then select RECOVERY). Once it's sitting there, connect your phone to the PC via USB, wait for Windows to find the right drivers, and you're connected. 'adb devices' should list your phone in the "List of devices attached", after which you're good to go.
– Dave
ps. I've not tried it personally, but there's supposedly a "universal USB driver" available here:
https://plus.google.com/103583939320326217147/posts/BQ5iYJEaaEH
wow
ViperGeek said:
ADB isn't all that difficult to use. Here's a good primer on it:
Once installed, just boot your phone into Recovery (power off completely, then power on with the Vol Down key held, then select RECOVERY). Once it's sitting there, connect your phone to the PC via USB, wait for Windows to find the right drivers, and you're connected. 'adb devices' should list your phone in the "List of devices attached", after which you're good to go.
– Dave
ps. I've not tried it personally, but there's supposedly a "universal USB driver" available here:
Wow thank you very much for the help youre giving me I will see if i can go and start finding a solution
Click to expand...
Click to collapse
ViperGeek said:
The 'e2fsck' command takes the same command-line switches as UNIX FSCK(8), so you can be as creative and daring as you need.
- Dave
Click to expand...
Click to collapse
I figured this out about a week ago now I guess and did indeed find that there were corrupted partitions. My phone had been acting up for several weeks before and it pretty much unusable now. I do manage to clean system and data up, and was even able to flash a new ROM which I hadn't been able to, they'd always abort.
I have a question though, is this only good for ext2 partitions? I have the same version as shown in the tutorial and if you run 'e2fsck -V' the output makes me think that maybe it's not happy checking ext3 and ext4 partitions and that's why i was popping up errors, or at least that's why even when i fixed errors it maybe wasn't really fixing the issue.
Thanks.
I've got a different phone, but a search brought me here to this thread. I think my issues though are more corrupted memory rather than device specific so hope you don't mind my post here.
I think this will answer your question
http://linux.die.net/man/8/fsck.ext3
(It should be good for all ext partitions)
Sent from my Galaxy Nexus using Xparent Cyan Tapatalk 2
ahh the good old fsck
glad i found this thread
thanks a lot mannnn
One more helpful tidbit.
Even if you run 'e2fsck -n' and find a "clean" file system, it may be useful to force a scan via 'e2fsck -f'. This just happened to me. I had something funny going on, and so rebooted into recovery and checked my file systems. Everything was cool like Fonzie, which I didn't believe, and so I used 'e2fsck -f' and found lots of fuglies that got fixed.
Be careful running -f on a cross-linked file system like the /data partition on a Galaxy S3/S4. It can have the tendency to unlink the elfin magic Samsung used and make a mess.
- Dave
(Double-tap post deleted)
This will not work with stock Android - default boot to recovery doesn't enable adb - you have to have CWM for that.
So, the questions remains - how can I run e2fsck without rooting my phone (and possibly voiding its warranty)?
How do I get the Moto X in Recovery mode to accept the adb command?
Because when I put in Recovery (Android Robot lying down) mode, the command adb and fastboot are not recognized.
Can this be done in terminal? And would I need su?
PRose61 said:
Can this be done in terminal? And would I need su?
Click to expand...
Click to collapse
Yes, this can be done in terminal on the phone itself. You do need root/su.
ApTeM said:
This will not work with stock Android - default boot to recovery doesn't enable adb - you have to have CWM for that.
So, the questions remains - how can I run e2fsck without rooting my phone (and possibly voiding its warranty)?
Click to expand...
Click to collapse
Is this why I get can't read '/etc/fstab': No such file or directory?
I'm using a stock Samsung S2, but it is rooted and has superuser and busybox.
Code:
ViperGeek said:
I've been having lots of trouble with my SD and local filesystems getting corrupted, which in turn has been causing the flush-179 process to go ballistic (100% CPU loop, reboot hangs, etc.). If only there was a way to run a quick on my Android's unmounted filesystems to check for problems. Well, there is!
This may be old, old news to some of the more seasoned OS hackers, so please be kind with any negative feedback about it being intuitively obvious. It wasn't to me, but after some research and testing, I've come up with these simple steps:
Boot into Recovery
Connect via USB to ADB shell
Code:
C:\Scratch\Android> [B]adb devices[/B]
C:\Scratch\Android> [B]adb shell[/B]
Mount /system and /data to determine the /dev/block names, then umount each
Code:
~ # [B]mount /system[/B]
~ # [B]mount /data[/B]
~ # [B]df[/B]
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 308620 64 308556 0% /dev
/dev/block/mmcblk0p27
295509 121021 159231 43% /cache
/dev/block/mmcblk0p26
1184268 848052 276060 75% /data
/dev/block/mmcblk0p25
562384 461416 72400 86% /system
~ # [B]umount /system[/B]
~ # [B]umount /data[/B]
Run e2fsck against each /dev/block filesystem
Code:
~ # [B]e2fsck -n /dev/block/mmcblk0p25[/B]
e2fsck 1.41.6 (30-May-2009)
/dev/block/mmcblk0p25: clean, 4168/35760 files, 117605/142847 blocks
~ # [B]e2fsck -n /dev/block/mmcblk0p26[/B]
e2fsck 1.41.6 (30-May-2009)
/dev/block/mmcblk0p26: clean, 7173/75200 files, 216745/300799 blocks
~ #
The 'e2fsck' command takes the same command-line switches as UNIX FSCK(8), so you can be as creative and daring as you need.
- Dave
Click to expand...
Click to collapse
Thank you for your very well done post. I also realize that this thread is very old. Still it is the best I have found after days of looking. And finally, I have a different phone. Having said that perhaps someone might help.
My phone is a Galaxy S5 Verizon SM-G900V running KitKat 4.4.4. I have root on the phone, but am running stock Verizon Kitkat with stock recovery.
So I have used ADB by plugging in my phone via USB to my Windows computer. I can get root in ADB and find the /data filesystem and its /dev/block/... device. But when I try to
Code:
umount /data
I get a response that the filesystem is busy. This makes sense.
I have booted into recovery via VOL UP + HOME + POWER and it takes me to the RECOVERY menu. But the only option that connects with my ADB shell is "apply update from ADB". When you use the command
Code:
ADB devices
, my phone shows up, but as "phoneid" sideload, and
Code:
ADB shell
exits immediately.
I have also tried to use a terminal shell and then su to root. Again I cannot umount /data since it is busy. (Of course it is, I am using it...)
And finally I have tried
Code:
touch /forcefsck
to create that file in the root directory. This is supposed to force a fsck during boot up. But the root directory (/) is read only. So you can't write the file to it.
I am at my wits end. What I really need to do is mark the /data filesystem as dirty and have the system check it on reboot. But I can't find anyway to do it.
So if anyone can help, I would be very grateful
Joe

[Q] example command to cifs or nfs mount?

I finally looked at /proc/filesystems on my new Nexus 7, and it claims to have support for cifs, nfs, and nfs4 available (out of the box, I didn't have to do anything or load a special kernel).
Unfortunately, absolutely nothing I try seems to be able to actually get a mount to work. 99% of the commands I try get the helpful error "invalid argument", when I try an nfs4 mount, I get "connection refused" (that's almost hopeful). I never find the slightest trace of anything in any logs on the server to indicate the tablet tried to talk to it.
I'm running fedora 19 on my server, I have nfs and smb configured. I can successfully mount the samba share from a Windows 7 box and the NFS directories from other linux boxes, so I know the server is functioning. What I can't figure is how to get the mount to work on android.
Any examples of a functioning NFS or CIFS mount command on a new Nexus 7 running stock 4.3?
DOH! Success at last!
Turns out I didn't have the nfs-idmap service configured to start correctly. Once I fixed that, I actually can do an nfs4 mount of my exported filesystem on my server:
busybox mount -t nfs4 192.168.1.106:/zooty /sdcard/public
mount | grep zooty
192.168.1.106:/zooty/ /storage/emulated/legacy/public nfs4 rw,relatime,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.1.129,local_lock=none,addr=192.168.1.106 0 0
I still have no idea how to get cifs to work, but nfs will certainly do.
Claghorn said:
I finally looked at /proc/filesystems on my new Nexus 7, and it claims to have support for cifs, nfs, and nfs4 available ...
busybox mount -t nfs4 192.168.1.106:/zooty /sdcard/public
Click to expand...
Click to collapse
This is great, I didn't realize one could do that. Thanks!
Claghorn said:
I finally looked at /proc/filesystems on my new Nexus 7, and it claims to have support for cifs, nfs, and nfs4 available (out of the box, I didn't have to do anything or load a special kernel).
Unfortunately, absolutely nothing I try seems to be able to actually get a mount to work. 99% of the commands I try get the helpful error "invalid argument", when I try an nfs4 mount, I get "connection refused" (that's almost hopeful). I never find the slightest trace of anything in any logs on the server to indicate the tablet tried to talk to it.
I'm running fedora 19 on my server, I have nfs and smb configured. I can successfully mount the samba share from a Windows 7 box and the NFS directories from other linux boxes, so I know the server is functioning. What I can't figure is how to get the mount to work on android.
Any examples of a functioning NFS or CIFS mount command on a new Nexus 7 running stock 4.3?
DOH! Success at last!
Turns out I didn't have the nfs-idmap service configured to start correctly. Once I fixed that, I actually can do an nfs4 mount of my exported filesystem on my server:
busybox mount -t nfs4 192.168.1.106:/zooty /sdcard/public
mount | grep zooty
192.168.1.106:/zooty/ /storage/emulated/legacy/public nfs4 rw,relatime,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.1.129,local_lock=none,addr=192.168.1.106 0 0
I still have no idea how to get cifs to work, but nfs will certainly do.
Click to expand...
Click to collapse
Great news! How do you add u/n & p/w for windows shares? (Will NFS even connect to windows? I've always used samba in Ubuntu.) Tia
Unfortunately, it appears as though the great and powerful google has arranged things so that most things are in a separate mount namespace, so the only thing that can see the filesystem I mounted is the shell I mounted it in (which puts a crimp in the usefulness). Anyone have any clever way to make these mounts visible to everyone?
See the bottom of this web page for some probably appropriate gibberish .
http://source.android.com/devices/tech/storage/index.html
Perhaps there is a hint there about how you might make the mount visible to apps, but I can't wrap my brain around it.
I have tried to mount via terminal and keep getting 'invalid argument' returned. Also it doesn't seem to parse the whole command. Take a look at the output, does anyone get the same results?
Code:
[email protected]:/ $ su
[email protected]:/ # mount-t cifs -o \\192.168.1.3\h mnt/cifs/h
mount-t cifs -o \\192.168.1.3\h mnt/cifs/h
sh: mount-t: not found
127|[email protected]:/ # mount -t cifs -o
mount -t cifs -o
option requires an argument -- omount: invalid option -o
1|[email protected]:/ # mount -t
mount -t
option requires an argument -- tmount: invalid option -t
1|[email protected]:/ # mount -t cifs -o \\192.168.1.3\h mnt/cifs/h
mount -t cifs -o \\192.168.1.3\h mnt/cifs/h
Usage: mount [-r] [-w] [-o options] [-t type] device directory
1|[email protected]:/ # mount -t cifs -o username=hpadmin,password=--- \\192.168.1.3\h mnt/cifs/h
min,password=--- \\192.168.1.3\h mnt/cifs/h <
mount: Invalid argument
255|roo[email protected]:/ # mount -t cifs -o user=hpadmin,password=--- \\192.168.1.3\h mnt/cifs/h
,password=--- \\192.168.1.3\h mnt/cifs/h <
mount: Invalid argument
255|[email protected]:/ # mount -t cifs \\192.168.1.3\h mnt/cifs/h
mount -t cifs \\192.168.1.3\h mnt/cifs/h
mount: Invalid argument
255|[email protected]:/ #
Lmk what you guys think.
I notice on my Nexus that "mount" is a different command than "busybox mount" (I guess the "smart install" decided it wasn't a good idea to replace mount). In any case, despite "cifs" being listed in /proc/filesystems, nothing I've tried in a shell has ever produced any output other than "invalid argument" either with mount or busybox mount. However "busybox mount" does work with "-t nfs4" mounting partition from my fedora 19 box (once I setup all the services correctly on fedora). That leaves the problem of getting the mount visible to everyone else, for which I found this thread (but haven't tried it yet):
http://forum.xda-developers.com/showthread.php?t=2062768
This is great news! I mounted up my shares and I am able to access them through the terminal. Is there a reason to why I can't view the files in a filebrowser? Not even a filebrowser with root access works.
Also, is it possible to make them mount automaticly on startup?
Cheers.
I just use ES3 File Explorer to access my CIFS shares at home and call it a day.
The files are visible and I can play videos etc.
https://play.google.com/store/apps/details?id=com.estrongs.android.pop&hl=en
Hi all, if your goal is simply to play music and video from your NAS to your android device, you can use Kodi (xbmc) that can access cifs path directly!

Extremely frustrating issue with Linux on Android

I have had the absolute worst time with getting Linux on Android to work on my Nexus 7. On 4.3 and 4.4, across many different Roms and kernels, the issue has persisted. Not a single other person on earth seems to have had this problem so i am going here as a last resort. For some infuriating reason, I am being denied permission to the mount -t command. The scripts always stop at mounting the image file to the loop device. I manually run the mount command, yes I am running as su, and I get this error: "Cannot execute -t: Permission denied" Why am I being denied permission when I am su? I even chmod 777 all the files associated with this command. There is absolutely no reason for this to happen, yet it does. I even do setenforce 0 to try and stop selinux from doing anything that could interfere.
Thanks if you can help.
What's the full command you;re trying to execute?
su mount -t ext4 /sdcard/kali/kali.img /dev/block/loop255
That's the line (minus su) that was in the bootscript that it was getting stuck on.
TheDoolster said:
su mount -t ext4 /sdcard/kali/kali.img /dev/block/loop255
That's the line (minus su) that was in the bootscript that it was getting stuck on.
Click to expand...
Click to collapse
Try adding -o rw,remount?
i.e. su mount -o rw,remount -t ext4 /sdcard/kali/kali.img /dev/block/loop255
If you're trying to get kali on android to use as a pwnpad, there is a thread here which walks one through it...it's a fully functional kali distro.

Categories

Resources