Showing posts with label mounting. Show all posts
Showing posts with label mounting. Show all posts

Wednesday, December 14, 2016

Mounting NTFS in Xperia Neo V via USB OTG Read Write both

Mounting NTFS in Xperia Neo V via USB OTG Read Write both


For newer devices (I dont know how to categorize them, maybe 2012 devices) its easy to mount any filesystem in both R/W mood for Xperia series. But a little older devices (maybe all the others?) its not so easy. Some support it partially and some dont (totally). My phone is Xperia Neo V and it doesnt seem to support that. Had a hard time to find this workaround but its effective, FINALLY !!! :D
To mount NTFS in full support you need two things. A set of modules and the mount script. How to do that follows.
Pre-requisites:
1. Rooted device (you can find tutorials on that)
2. CWM installed (you can use X-Parts from Play Store
3. Script Manager

Steps:
1. First download this file. It is the ntfs-3g modules set compiled for Android.
2. Copy the zip to your SD-Card, in a folder that you can easily recognize by name
3. Reboot into recovery, to do this first turn your phone off. Then power it up and wait for the Sony Logo. When it comes keep pressing the volume down key repeatedly (the key maybe different for another device, do a little Googling to know which).
4. Now youre in CWM (hopefully, youll see screen with a list of things). Choose install zip from sdcard. Choose the zip file from the sdcard. It will show some messages. If all goes well the last line should be something like "....done"
5. Now supposing the modules have been installed correctly copy this script and save it with the name "MountScript.sh" in your SD-card.

#!/system/bin/sh
#
# Mount USB OTG NTFS Storage device - shardul_seth@xda
# Mount point checking added by - tafhim

# load fuse support
if [ ! -e /system/lib/modules/fuse.ko ]; then
busybox echo -e "WARNING: fuse module not found! Is fuse built into kernel?"
else
insmod /system/lib/modules/fuse.ko
fi

# mount partitions
sdn=0
ls -l /dev/block/sd??
if [ $? -eq 0 ]; then
for sd in `ls /dev/block/sd??`; do
if [ -d "/sdcard/usb_drive_$sdn" ]; then
umount /sdcard/usb_drive_$sdn
rm -R /sdcard/usb_drive_$sdn
fi
if [ ! -d "/sdcard/usb_drive_$sdn" ]; then
mkdir /sdcard/usb_drive_$sdn
chmod 777 /sdcard/usb_drive_$sdn
ntfs-3g -o umask=0 $sd /sdcard/usb_drive_$sdn
if [ $? -ne 0 ]; then
busybox mount -o umask=0 $sd /sdcard/usb_drive_$sdn
echo "$sd mounted on /sdcard/usb_drive_$sdn"
else
echo "$sd (NTFS) mounted on /sdcard/usb_drive_$sdn"
fi
sdn=`expr $sdn + 1`
if [ ! -z $SM_VERSION ]; then echo showToastLong "$sdn Drives mounted!" >&$SM_GUIFD; fi
fi
done
else
echo "No drive found! Exiting.."
if [ ! -z $SM_VERSION ]; then echo showToastLong "No drive found! Exiting.." >&$SM_GUIFD; fi
exit 1
fi
exit 0
6. Connect your drive using the OTG cable.
7. If not installed download Script Manager from the Play Store. Run it and browse to the place where you saved the script. Select it
8. You dont have to change anything just select the "su" option that has an Android Skull (Pirate-ish) over it. Now select "Run" from the top-most menu.
9. If you see the message "1 drive mounted" or similar, youre done. Just go to the SD-card and drag down and youll see the folder "usb_drive_0". If you have multiple partitions, all will be mounted.

You need to do all these only the first time. From later on, you only need to follow steps 6-9 only :)

For help on rooting / CWM Installation / etc head over to XDA Developers Forum.
For help on using FlashTool in Linux read this.

Xperia Neo V specific stuff:
Some nice kernels for Xperia Neo V are the Suave Kernel, the Super Stock Kernel and the Alliance Kernel MOD.
You can download kernel .562 and kernel .587 for Xperia Neo V MT11i. You need these to root your device using this method
The DooMLord rooting kit (windows) is available here
The DooMLord rooting kit (linux) is available here
The CWM Installer (windows) is available here
X-Parts apk is available here


Go to link download

Read more »

Wednesday, November 2, 2016

Mounting MTP Android in Linux

Mounting MTP Android in Linux


Got this from : http://blog.mpshouse.com/?p=609 This is another one : http://forum.xda-developers.com/showthread.php?t=2055563
Default HOWTO: Linux and MTP

This is a quick how to get MTP working on Linux, the guide is for distros based on Debian (mintdebianubuntu) OpenSuse, Fedora AND Gentoo. If theres any missing for major distros let me know, or add them to a separate post and ill put them up here


***Debian based distros**

Code:
sudo apt-get install mtpfs
sudo mkdir /media/onex
sudo chmod 775 /media/onex
sudo mtpfs -o allow_other /media/onex
gedit /etc/udev/rules.d/51-android.rules
and add the following line:
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
and then:
sudo service udev restart
***Arch Linux***
Code:
pacman -S libmtp

After installation, you have several mtp tools available. Upon connecting your MTP device, you use:

mtp-detect

and add the following line:
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
and then reload udev rules:
udevadm control --reload
Arch Linux guide is from the ArchLinux wiki

**RedhatFedora16**
First of all, I using my computer with other people, who can come over the network, so the 0666 mode bits not a right choice for me. I make it all on a fedora 16, but the distro is really not important.

So the steps:
- add a user to the "disk" group (or whatever You want)
- make a mount point (the media doesnt work for me, across the init removes the content)
- add this mount point to the fstab, with some parameter
- create udevd rules
- restart udevd
- install fuse-mtpfs
- (re)login user
- try it

My common experience is that, the mtpfs is very very very very slow. Really slow, so I can use it only with CLI, any GUI has been coming back with time out

And the "code":
Code:
usermod -a -G disk $LOGINUSER
Code:
sudo mkdir /mnt/sgs2 ; sudo chgrp disk /mnt/sgs2; sudo chmod 0770 /mnt/sgs2
Code:
sudo echo "mtpfs /mnt/sgs2 fuse users,noauto 0 0" >> /etc/fstab
Code:
cat > /etc/udev/rules.d/51-android.rules <<EOF
SUBSYSTEM!="usb_device", GOTO="label_end"
ACTION!="add", GOTO="label_end"

# ATRRS{idVendor}== ertekei:
#Acer 0502
SUBSYSTEM=="usb",ATTRS{idVendor}=="0502",MODE="0660",GROUP="disk"
#ASUS 0b05
SUBSYSTEM=="usb",ATTRS{idVendor}=="0b05",MODE="0660",GROUP="disk"
#Dell 413c
SUBSYSTEM=="usb",ATTRS{idVendor}=="413c",MODE="0660",GROUP="disk"
#Foxconn 0489
SUBSYSTEM=="usb",ATTRS{idVendor}=="0489",MODE="0660",GROUP="disk"
#Fujitsu 04c5
SUBSYSTEM=="usb",ATTRS{idVendor}=="04c5",MODE="0660",GROUP="disk"
#Fujitsu Toshiba 04c5
SUBSYSTEM=="usb",ATTRS{idVendor}=="04c5",MODE="0660",GROUP="disk"
#Garmin-Asus 091e
SUBSYSTEM=="usb",ATTRS{idVendor}=="091e",MODE="0660",GROUP="disk"
#Google 18d1
SUBSYSTEM=="usb",ATTRS{idVendor}=="18d1",ATTRS{idProduct}=="4ee1",MODE="0660",GROUP="disk"
#Hisense 109b
SUBSYSTEM=="usb",ATTRS{idVendor}=="109b",MODE="0660",GROUP="disk"
#HTC 0bb4
SUBSYSTEM=="usb",ATTRS{idVendor}=="0bb4",MODE="0660",GROUP="disk"
#Huawei 12d1
SUBSYSTEM=="usb",ATTRS{idVendor}=="12d1",MODE="0660",GROUP="disk"
#K-Touch 24e3
SUBSYSTEM=="usb",ATTRS{idVendor}=="24e3",MODE="0660",GROUP="disk"
#KT Tech 2116
SUBSYSTEM=="usb",ATTRS{idVendor}=="2116",MODE="0660",GROUP="disk"
#Kyocera 0482
SUBSYSTEM=="usb",ATTRS{idVendor}=="0482",MODE="0660",GROUP="disk"
#Lenovo 17ef
SUBSYSTEM=="usb",ATTRS{idVendor}=="17ef",MODE="0660",GROUP="disk"
#LG 1004
SUBSYSTEM=="usb",ATTRS{idVendor}=="1004",MODE="0660",GROUP="disk"
#Motorola 22b8
SUBSYSTEM=="usb",ATTRS{idVendor}=="22b8",MODE="0660",GROUP="disk"
#NEC 0409
SUBSYSTEM=="usb",ATTRS{idVendor}=="0409",MODE="0660",GROUP="disk"
#Nook 2080
SUBSYSTEM=="usb",ATTRS{idVendor}=="2080",MODE="0660",GROUP="disk"
#Nvidia 0955
SUBSYSTEM=="usb",ATTRS{idVendor}=="0955",MODE="0660",GROUP="disk"
#OTGV 2257
SUBSYSTEM=="usb",ATTRS{idVendor}=="2257",MODE="0660",GROUP="disk"
#Pantech 10a9
SUBSYSTEM=="usb",ATTRS{idVendor}=="10a9",MODE="0660",GROUP="disk"
#Pegatron 1d4d
SUBSYSTEM=="usb",ATTRS{idVendor}=="1d4d",MODE="0660",GROUP="disk"
#Philips 0471
SUBSYSTEM=="usb",ATTRS{idVendor}=="0471",MODE="0660",GROUP="disk"
#PMC-Sierra 04da
SUBSYSTEM=="usb",ATTRS{idVendor}=="04da",MODE="0660",GROUP="disk"
#Qualcomm 05c6
SUBSYSTEM=="usb",ATTRS{idVendor}=="05c6",MODE="0660",GROUP="disk"
#SK Telesys 1f53
SUBSYSTEM=="usb",ATTRS{idVendor}=="1f53",MODE="0660",GROUP="disk"
#Samsung 04e8
SUBSYSTEM=="usb",ATTRS{idVendor}=="04e8",ATTRS{idProduct}=="6860",MODE="0660",GROUP="disk"
#Sharp 04dd
SUBSYSTEM=="usb",ATTRS{idVendor}=="04dd",MODE="0660",GROUP="disk"
#Sony 054c
SUBSYSTEM=="usb",ATTRS{idVendor}=="054c",MODE="0660",GROUP="disk"
#Sony Ericsson 0fce
SUBSYSTEM=="usb",ATTRS{idVendor}=="0fce",MODE="0660",GROUP="disk"
#Teleepoch 2340
SUBSYSTEM=="usb",ATTRS{idVendor}=="2340",MODE="0660",GROUP="disk"
#Toshiba 0930
SUBSYSTEM=="usb",ATTRS{idVendor}=="0930",MODE="0660",GROUP="disk"
#ZTE 19d2
SUBSYSTEM=="usb",ATTRS{idVendor}=="19d2",MODE="0660",GROUP="disk"

LABEL="label_end"
Code:
udevadm control --reload-rules
Code:
yum/apt-get/pacman/etc install mtpfs
Logout-login, for get in to the disk group, connect the device via usb, and try
Code:
mptfs
without any parameter, and it must write out some information:
[CODE]$LOGINUSER@mir:~$ mtpfs
Listing raw device(s)
Device 0 (VID=04e8 and PID=6860) is a Samsung Galaxy models (MTP).
Found 1 device(s):
Samsung: Galaxy models (MTP) (04e8:6860) @ bus 2, dev 4
Attempting to connect device
Android device detected, assigning default bug flags
Listing File Information on Device with name: (NULL)
fuse: missing mountpoint parameter

And finally mount /it must be working now with user account/:
Code:
mount /mnt/sgs2
or dismount:
Code:
umount /mnt/sgs2
**OpenSuse 12.2**

this method will work for music and photos access only,

Code:
sudo zypper addrepo -f http://packman.inode.at/suse/12.2/ packman
sudo zypper ref (type a to always accept the packman repo)
sudo zypper in mtpfs
sudo vim /lib/udev/rules.d/69-libmtp.rules and add the following line (replace vim with gedit if you want a gui editor)
# HTC One X+
ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0dfc", SYMLINK+="libmtp-%k", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1"

sudo cp /lib/udev/rules.d/69-libmtp.rules /etc/udev/rules.d/.
reboot

When you plug in the phone you will see android phone icon on the desktop click on it to browse your files.
*note
disable any media players from trying to read the device...

** Gentoo **

Code:
Prerequisites

If your device is not recognized by libmtp, try upgrading to latest (or even git) version.
User needs to be in group plugdev to mount device.
MTPFS

You need to add option: user_allow_other in /etc/fuse.conf
$ mkdir ~/AndroidDevice
$ mtpfs -o allow_other ~/AndroidDevice
NOTE: this can take really long time, up to several minutes. As an indication of successful mount the mtpfs will go to background.
To unmount:
$ /usr/bin/fusermount -u ~/AndroidDevice

If mtpfs doesnt work for you try updating to latest version first.
Go-MTPFS

Seems to be more stable
$ emerge -a go
$ mkdir ~/go
$ export GOPATH=/home/$USER/go
$ go get github.com/hanwen/go-mtpfs

To mount:
$ ~/go/bin/go-mtpfs ~/AndroidDevice

To unmount:
$ /usr/bin/fusermount -u ~/AndroidDevice
Troubleshooting

Sometimes (e.g. on HTC One X) USB debugging automatically turns on when device is connected to PC. You need to turn debugging off, otherwise libmtp cant recognise device.
Make sure your Android device is not going to sleep and the screen is not getting locked. Set screen timeout to very long values, or enable in Development section flag "Do not turn off the screen".
Thanks to ihavoc and Fonya1 for the opensuse and redhatfedora tutorials

Go to link download

Read more »