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!
Related
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
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.
Just wanted to know if anyone knows how to disable the virtual cdrom in OOS when you plug in usb to pc. I have looked and there is no cdrom.iso like other phones i had.
Edit: Just overlooked the file.
If anyone is interested in disabling the virtual cdrom upon usb connection, navigate to /system/etc with a root filemanager and rename usb_drivers.iso to usb_drivers.iso.bak and reboot. or enter the following commands in adb shell and reboot. Phone MUST be rooted.
Code:
adb shell
su
mount -o remount,rw /system
mv /system/etc/usb_drivers.iso /system/etc/usb_drivers.iso.bak
mount -o remount,ro /system
Revert
Code:
adb shell
su
mount -o remount,rw /system
mv /system/etc/usb_drivers.iso.bak /system/etc/usb_drivers.iso
mount -o remount,ro /system
Edit: fixed a typo
for everyone getting this Error:
mount: '/dev/block/bootdevice/by-name/system_b'->'/system': Device or resource busy
Click to expand...
Click to collapse
You have to use this Command
mount -o rw,remount /system
Click to expand...
Click to collapse
instead of
mount -o remount,rw /system
Click to expand...
Click to collapse
Thanks!
That worked for my OnePlus 6.
Thanks!
That worked for my OnePlus 7 pro.
Stock ROM, oreo.
How do you execute scripts on startup? Either by init.d or some other means, doesn't matter as long as it works. The /system/etc/init.d folder isn't there. Remounting /system for me doesn't work:
mount -o remount,rw -t ext4 /dev/block/platform/hi_mci.0/by-name/system /system
I get: '/system': Device or resource busy
I reboot into TWRP, I get the same error as above. Any help please?
TouchOdeath said:
Stock ROM, oreo.
How do you execute scripts on startup? Either by init.d or some other means, doesn't matter as long as it works. The /system/etc/init.d folder isn't there. Remounting /system for me doesn't work:
mount -o remount,rw -t ext4 /dev/block/platform/hi_mci.0/by-name/system /system
I get: '/system': Device or resource busy
I reboot into TWRP, I get the same error as above. Any help please?
Click to expand...
Click to collapse
For mounting you use these command.
In local terminal
HWBND-H:/ $ su
HWBND-H:/ # mount -o rw,remount /system
In adb terminal
adb shell su -c mount -o rw,remount /system
And to see how is mounted
HWBND-H:/ # mount | grep system
It should return like this.
/dev/block/mmcblk0p51 on /system type ext4 (rw,seclabel,relatime,data=ordered)
And to go back to ro do this or reboot:
HWBND-H:/ # mount -o ro,remount /system
HWBND-H:/ # mount | grep system
/dev/block/mmcblk0p51 on /system type ext4 (ro,seclabel,relatime,data=ordered)
mrmazak said:
For mounting you use these command.
In local terminal
HWBND-H:/ $ su
HWBND-H:/ # mount -o rw,remount /system
In adb terminal
adb shell su -c mount -o rw,remount /system
And to see how is mounted
HWBND-H:/ # mount | grep system
It should return like this.
/dev/block/mmcblk0p51 on /system type ext4 (rw,seclabel,relatime,data=ordered)
And to go back to ro do this or reboot:
HWBND-H:/ # mount -o ro,remount /system
HWBND-H:/ # mount | grep system
/dev/block/mmcblk0p51 on /system type ext4 (ro,seclabel,relatime,data=ordered)
Click to expand...
Click to collapse
Thank you for your response I appreciate it. I ended up making my problem more complicated than it had to be. The solution was to open terminal and do:
adb shell
su
mkdir /system/etc/init.d
cp /storage/emulated/0/Downloads/script.sh /system/etc/init.d/script.sh
If I tried to create the folder through a rooted app (Total Commander), it didn't work. Copying the file through an app didn't work either.
I've tried these commands with root access
mount -t fifs //192.168.62.118/xyz -o username=user,password=pw /mnt/sdcard/xyz
mount -t cifs //192.168.62.118/xyz -o username=user,password=pw /mnt/sdcard/xyz
mount iocharset=utf8 -t cifs -o username=user,password=pw,rw,noperm,iocharset=utf8 //192.168.62.118/xyz /mnt/sdcard/xyz
mount -o username=user,password=pw,nodfs,rw,iocharset=utf8,noperm,dir_mode=0777,file_mode=0777 -t cifs //192.168.62.118/xyz /storage/self/primary/xyz
all of them results in "no such device". Googling around, it seems its due to the kernel not supporting CIFS. But this also happen in LineageOS 17.1 where other people reports able to mount cifs, albeit on a different device.
WHat I could do to get cifs smb mount working?
the device is google pixel 1 (sailfish)