(Help)Adding an USBHDD to Rasbian filesystem - Raspberry Pi Q&A, Help & Troubleshooting

Hello Guys i have an Samba Server installed on my Raspberry pi and i wonder if you can mount an USBHDD on it i can Mount an USB pen drive whit no problem att all butt when i Try to mount the HDD it says that it Don't find ntfs-3 as a File System "sudo mount -t ntfs-3g -o uid=pi,gid=pi /dev/sda1 /media/usbhdd/" is the code to Mount and i have made a Dir only for that HDD to please Help what shall i write insteed for ntfs-3g

sioxz said:
Hello Guys i have an Samba Server installed on my Raspberry pi and i wonder if you can mount an USBHDD on it i can Mount an USB pen drive whit no problem att all butt when i Try to mount the HDD it says that it Don't find ntfs-3 as a File System "sudo mount -t ntfs-3g -o uid=pi,gid=pi /dev/sda1 /media/usbhdd/" is the code to Mount and i have made a Dir only for that HDD to please Help what shall i write insteed for ntfs-3g
Click to expand...
Click to collapse
Samba and other linux aspects related to linux servers can sometimes handle the NTFS file system in a weird way, I would suggest taking a look at these two guides for a couple of potential ways to fix your problem:
http://forums.whirlpool.net.au/archive/971582
http://ubuntuforums.org/showpost.php?p=9562968&postcount=3

Make sure you have the package for ntfs installed. I think it should be something like
Code:
sudo apt-get install ntfs-3g
Then try mounting it again using the command "mount" command. If you want it to mount automatically you will have to add it to /etc/fstab
Why are you using ntfs to being with? You should really use ext if possible, stick with Linux file systems and save yourself a headache if you aren't using this HDD with a computer that does support Linux file systems (i.e. Windows).

m2xtreme said:
Make sure you have the package for ntfs installed. I think it should be something like
Code:
sudo apt-get install ntfs-3g
Then try mounting it again using the command "mount" command. If you want it to mount automatically you will have to add it to /etc/fstab
Why are you using ntfs to being with? You should really use ext if possible, stick with Linux file systems and save yourself a headache if you aren't using this HDD with a computer that does support Linux file systems (i.e. Windows).
Click to expand...
Click to collapse
First of all Thanks both of you and the Reason i Use ntfs is becouse i have a 1TB Usb HDD full whit Data and i dont wanna Delete all that and make it into another Filesystem and i have another Problem you know the linux USB henarki whit sda1/sda2 Etc When i plug in my ntfs drive and my keybord only it says that i have Sda1/sda2/sda3 Bootet but when i drive the same tail command whit a Fat32 Usb stick i only get sda1 any tips on this ? whill try you thing First Thanks a lot :laugh: (edit: i also updated my USBmount i have no idea if this makes any diffrence but i got Dir in /media/ usb/usb1/usb2 Etc... to usb7)

I just ran a similar command to "sudo mount -t ntfs-3g -o uid=pi,gid=pi /dev/sda1 /media/usbhdd/" on my linux desktop without issue. Can you provide the error message you are getting when running this command? Also are you able to run this command without issue?
Code:
sudo mount -t ntfs-3g /dev/sda1 /media/usbhdd/
Perhaps you should verify that /dev/sda1 is in fact the correct hard drive by running:
Code:
sudo fdisk -l | grep NTFS

m2xtreme said:
I just ran a similar command to "sudo mount -t ntfs-3g -o uid=pi,gid=pi /dev/sda1 /media/usbhdd/" on my linux desktop without issue. Can you provide the error message you are getting when running this command? Also are you able to run this command without issue?
Code:
sudo mount -t ntfs-3g /dev/sda1 /media/usbhdd/
Perhaps you should verify that /dev/sda1 is in fact the correct hard drive by running:
Code:
sudo fdisk -l | grep NTFS
Click to expand...
Click to collapse
The ting is that i run a Tail command to se which sda number that Usb Hdd has and i says that is Has 3 sda number (sda1,sda2,sda3) and this makes me Really confused because when i run the same Tail command whit an flash usb stick (fat32) it only says one number (sda1)
gonna try running Arch linux insteed as soon as my new SD card Arrives :good: btw i have mounted an fat32 usb memory stick
and i have downloaded ntfs-3g package and utdated usbmount package

i have fixed it now my Raspberry pi are running Samba Whit my 1TB NTFS Drive
You need to Run Rasbian newest version
now how to
First
Code:
sudo apt-get install usbmount
to get the newest usb mount package
Code:
sudo apt-get install ntfs-3g
to get the ntfs-3g package to mount the disk
to mount
Code:
sudo mount -t ntfs-3g -o uid=pi,gid=pi /dev/path /media/path1/
were path is you fill in were the Disk is often sda1 but can also be sda2.sda3 my Drive was on sda3 becuse of some wierd ****
path1 do you fill in were you wanna mount your drive because of the usbmount package you now got usb,usb1,usb2 up to usb7
so choose any of them than if all works out you have mounted you NTFS drive
to test if it is munted or not
Write
Code:
cd /media/path1
and then type
Code:
dir
and you shoud se some maps if you got any on you Drive before
sorry for my English (i am from sweden and my spelling is genneraly bad in every language)

Happy to hear you figured it out. It is a bit surprising that it is mounting to sda3. In my experience Linux will give each hard drive it's own sdX number (i.e. sda, sdb, sdc, etc) and each partition on a hard drive will have a number associated with it (i.e. sda1, sda2, sda3, etc). Oh well

m2xtreme said:
Happy to hear you figured it out. It is a bit surprising that it is mounting to sda3. In my experience Linux will give each hard drive it's own sdX number (i.e. sda, sdb, sdc, etc) and each partition on a hard drive will have a number associated with it (i.e. sda1, sda2, sda3, etc). Oh well
Click to expand...
Click to collapse
Yea i was Kind of Confused to about that but now have i made guide how to fix this problem if anybody other than me experience this :laugh:
Also was First Time in Linux
Thanks to My Friends,Teachers And the people of XDA did i fix This Problem

If you've got various sdaX, that means one of two things:
1 - You've got multiple partitions; or
2 - Your partition table is broken.
If your partition table is broken but you can access your data, leave it as it is, and wait for a chance when you can back up that data to another disk to re-write MBR (or GPT, whatever floats your disk).

Related

Ubuntu Help !

Hey Guys wondering is someone can assist
i been using different ROMS for about 3 months now
i have several SD card that have been partitioned to FAT32 and Ext3
however i recently purcahsed an 8GB card but what i want to do it change cards but i want to copy my Ext3 partition so its just a matter of drag and drop to the new card
however via ubuntu its not letting me access Ext3 partition, it clearly shows that its there but wont let me mount it .... can mount up FAT32 with no issues
if someone could assist it would be greatly appreciated
Running latest ubuntu 9.04 from Live CD
if you have the android sdk set up I believe you can pull it, create the partition and then push the files to the partition that way. Not sure if ubuntu can mount an ext partition. Google!
not sure if it is ROM specific but I can mount ext from linux using cyanogens rom.
plug phone in and click mount usb.
from linux open console
Code:
dmesg # to find out which device (mine is /dev/sda)
sudo fdisk -l /dev/sda # or whatever dmesg said
sudo mkdir /mnt/tmp
sudo mount /dev/sda2 /mnt/tmp
ls /mnt/tmp #should show contents of ext3 if it worked
copy files
Code:
sudo umount /mnt/tmp
on phone click unmount usb or whatever.
Strange, Ubuntu always mounts my ext3 no problems. You could try pulling the file to you fat32 on the old card, copy them to fat on the new card and push to the ext3
On the old card
cp /system/sd/app/* /sdcard/app
Cp /system/sd/app-private/* /sdcard/app-private
Then copy those 2 folder to the fat32 of the new card, then:
Cp /sdcard/app/* /system/sd/app
Cp /sdcard/app-private/* /system/sd/app-private
You will have to remount /system and mkdir's first, though.
dumfuq said:
not sure if it is ROM specific but I can mount ext from linux using cyanogens rom.
plug phone in and click mount usb.
from linux open console
Code:
dmesg # to find out which device (mine is /dev/sda)
sudo fdisk -l /dev/sda # or whatever dmesg said
sudo mkdir /mnt/tmp
sudo mount /dev/sda2 /mnt/tmp
ls /mnt/tmp #should show contents of ext3 if it worked
copy files
Code:
sudo umount /mnt/tmp
on phone click unmount usb or whatever.
Click to expand...
Click to collapse
Ill check thos out my friend
thanks , i will report bk
It's a little odd what it does with the ext partition. I noticed it did not show up except in /media. The fat partition gets a shortcut on the desktop. If you have gparted on your machine, open it up and it should tell you where it mounted it to (if it got mounted).
Good luck.
dmesg
sudo fdisk -l /dev/sdf
sudo mkdir /mnt/tmp
sudo mount /dev/sdf2 /mnt/tmp ..... SO FAR THIS WORKS
when i enter this command ..... ls /mnt/tmp ..... i get error message "ls: cannot open directory /mnt/tmp: Permission denied"
any other idea's
AdrianK said:
Strange, Ubuntu always mounts my ext3 no problems. You could try pulling the file to you fat32 on the old card, copy them to fat on the new card and push to the ext3
On the old card
cp /system/sd/app/* /sdcard/app
Cp /system/sd/app-private/* /sdcard/app-private
Then copy those 2 folder to the fat32 of the new card, then:
Cp /sdcard/app/* /system/sd/app
Cp /sdcard/app-private/* /system/sd/app-private
You will have to remount /system and mkdir's first, though.
Click to expand...
Click to collapse
through terminal ? or linux command ? or through recovery mode ?
also can you give instructions to remount system , only if you can
cheers appreciated
also any idea's why your fat 32 AND ext system auto shows so that files can be dragged and dropped ?
dumfuq said:
not sure if it is ROM specific but I can mount ext from linux using cyanogens rom.
plug phone in and click mount usb.
from linux open console
Code:
dmesg
sudo fdisk -l /dev/sda
sudo mkdir /mnt/tmp
sudo mount /dev/sda2 /mnt/tmp
ls /mnt/tmp
copy files
Code:
sudo umount /mnt/tmp
on phone click unmount usb or whatever.
Click to expand...
Click to collapse
ok managed to do this , but how then do i copy the files ?
drewno1 said:
through terminal ? or linux command ? or through recovery mode ?
also can you give instructions to remount system , only if you can
cheers appreciated
also any idea's why your fat 32 AND ext system auto shows so that files can be dragged and dropped ?
Click to expand...
Click to collapse
Was posting from my G1 late at night so I was feeling lazy
to remount /system as rw
mount -o rw,remount /dev/block/mtdblock3 /system
input those commands in to the recovery console, it's not a good idea to push apk's while your phone is on (I mean, it is in android).
No idea. I'm on Ubuntu 9.04, it auto mounts them and opens them, they also appear in the sidebar in nautilus.
drewno1 said:
ok managed to do this , but how then do i copy the files ?
Click to expand...
Click to collapse
Code:
cp -rv /mnt/tmp/* /path/to/where/you/want/the/files/
or drag and drop using nautilus file browser.
cp /system/sd/app/* /sdcard/app
Cp /system/sd/app-private/* /sdcard/app-private
Cp /sdcard/app/* /system/sd/app
Cp /sdcard/app-private/* /system/sd/app-private
mount -o rw,remount /dev/block/mtdblock3 /system
OK that never worked , anymore idea's ?
dmesg
sudo fdisk -l /dev/sdf
sudo mkdir /mnt/tmp
sudo mount /dev/sdf2 /mnt/tmp ls /mnt/tmp
cp -rv /mnt/tmp/* /sdcard/app/* /system/sd/app
cp -rv /mnt/tmp/* /sdcard/app-private/* /system/sd/app-private
sudo umount /mnt/tmp
will try this method and report bk
drewno1 said:
dmesg
sudo fdisk -l /dev/sdf
sudo mkdir /mnt/tmp
sudo mount /dev/sdf2 /mnt/tmp ls /mnt/tmp
cp -rv /mnt/tmp/* /sdcard/app/* /system/sd/app
cp -rv /mnt/tmp/* /sdcard/app-private/* /system/sd/app-private
sudo umount /mnt/tmp
will try this method and report bk
Click to expand...
Click to collapse
LMAO this never worked , i feel like pulling my hair out haha
billquinn1 said:
It's a little odd what it does with the ext partition. I noticed it did not show up except in /media. The fat partition gets a shortcut on the desktop. If you have gparted on your machine, open it up and it should tell you where it mounted it to (if it got mounted).
Good luck.
Click to expand...
Click to collapse
checked GParted and here is where it says its mounted
Path: /dev/sdf2
Status: Mounted on /media/disk-1
Since this is Ubuntu Help, i figured i'd post this here, if it is the wrong forum, let me know.
I am trying, and have been for a week now, to use
Code:
adb shell
however, it keeps giving me the message
Code:
device not found
i know it's there because i am able to mount the sd to my pc and browse the files, but adb doesn't find it. device not found....
any help?
temporizer said:
Since this is Ubuntu Help, i figured i'd post this here, if it is the wrong forum, let me know.
I am trying, and have been for a week now, to use
Code:
adb shell
however, it keeps giving me the message
Code:
device not found
i know it's there because i am able to mount the sd to my pc and browse the files, but adb doesn't find it. device not found....
any help?
Click to expand...
Click to collapse
You need to edit a couple of files first. Google is your friend.
AdrianK said:
You need to edit a couple of files first. Google is your friend.
Click to expand...
Click to collapse
I tried that. i searched for hours before i posted. and tried a couple things. but none work. thats why i ask the wonderful people here.
temporizer said:
I tried that. i searched for hours before i posted. and tried a couple things. but none work. thats why i ask the wonderful people here.
Click to expand...
Click to collapse
Hmm I didn't follow those exact intructions but something similar for jaunty and it worked fine :-S

[9001]Mounting external SD Card as ext3

Hey,
I like to mount my external SD Card as ext3 to support large files. The SD Card is formatted with ext3 but now Android shows only an empty folder.
So i tried to remount the SD:
Code:
mount -o rw,remount -t ext3 /dev/block/vold/197:33 /mnt/sdcard/externald_sd
But it doesnt use something... Does anybody has an idea? Some Example or sthing else?
Greetz
FaxXer said:
Hey,
I like to mount my external SD Card as ext3 to support large files. The SD Card is formatted with ext3 but now Android shows only an empty folder.
So i tried to remount the SD:
Code:
mount -o rw,remount -t ext3 /dev/block/vold/197:33 /mnt/sdcard/externald_sd
But it doesnt use something... Does anybody has an idea? Some Example or sthing else?
Greetz
Click to expand...
Click to collapse
u need a kernel that supports ext3. u can ask one of the guys compiling at the moment if they have time to add an ext3 module for u.
May be a stupid question:
would ext4 work instead? I thought the system partition would use this FS.
filesystem is already ext4
wintel_mac said:
May be a stupid question:
would ext4 work instead? I thought the system partition would use this FS.
Click to expand...
Click to collapse
well the system uses ext4 so it should work, but i'm not sure what u're trying to achieve. i use a 16 gb class 10 formatted fat32
Blumdum said:
filesystem is already ext4
Click to expand...
Click to collapse
He's talking about formatting external sd-card
When I get him right, he has a file that exceeds the 4GB FAT32 limit.
So he looks for an alternative to FAT32, which might be some kind of ext*-FS.
wintel your right!
In the Android-Hilfe Forum someone said the system expect first an vfat partition and then the ext. I think thats wrong cause its not working but somehow it has to go.
Hmm should I write these mount command I postet in the init.rc? Or something else. Would be very nice if you post your ideas!
Thanks
init.rc+ ext3 module/object included in kernel
Hmm okay thats good but how do I use them? So I can read and write to my external sd card with an ext3 or ext2 partition.
Thanks
Come on guys where are the great developers?!
Ok I did a test with busybox inbuilt mount, but I tried only with an image.
Not with a real SD card! This worked for me:
On a linux box:
# dd if=/dev/zero of=/tmp/image bs=1M count=1k
# mkfs.ext4 /tmp/image
Copy file to your phone. Then:
On the phone with terminal:
# mkdir /sdcard/mmnt
# busybox mount -o loop /sdcard/image /sdcard/mmnt
To unmount:
# busybox umount -l /sdcard/mmnt
Anybody tried that?
If I understand u right u puting an image file (ext3/4) on the sd and mount that as a virtual disk. Wouldn't the image file be bound to the same restrictoins as other content on a fat32 file system? Like the 4 gig limit!
YOU WILL LOSE ALL DATA ON YOUR SDCARD IF YOUR FDISK
BACKUP WHATEVER IS ON THERE FIRST!!!
YOU'VE BEEN WARNED
using a photon 4g but....
what i did was get an external sdcard reader writer...
(used ubuntu) and let it mount
fdisk device and DELETE ALL PARTITIONS
write
fdisk again
create a linux primary type 83
type mount and grab the /dev/sdcX value (it was /dev/sdc1 for me)
umount that
then
mkfs.ext3 /dev/sdcX ... ( heres the thing though with cyanogen mod 7 kernel 2.6.32.9 SMP PREEMPT)
had to reboot twice for it to be seen in file manager...
its buggy but it does work for the most part
Reviving an old thread, but I just found that I can format a MicroSD under NTFS and it will work with Paragon's NTFS module. At the very least, my phone will mount the drive. I partitioned and formatted it with ext4 on my Linux machine and it didn't recognize it, but I did have it use the GUID partition table. Hoping to be able to load up some videos to take with me.
ext4 sdcard mount works
FaxXer said:
Hey,
I like to mount my external SD Card as ext3 to support large files. The SD Card is formatted with ext3 but now Android shows only an empty folder.
So i tried to remount the SD:
Code:
mount -o rw,remount -t ext3 /dev/block/vold/197:33 /mnt/sdcard/externald_sd
But it doesnt use something... Does anybody has an idea? Some Example or sthing else?
Greetz
Click to expand...
Click to collapse
The problem is with the shell interpreting the special character ":"
To make it work, first create a symlink to the device node:
Code:
ln -s /dev/block/vold/197\:17 /dev/sd2
Then mount it:
Code:
busybox mount /dev/sd2 /mnt/tmp
Code:
sh-4.1# ls -l /dev/sd2
lrwxrwxrwx root root 2013-11-16 14:45 sd2 -> /dev/block/vold/179:17
sh-4.1# mount|grep sd2
/dev/sd2 /mnt/tmp ext4 rw,relatime,user_xattr,acl,barrier=1,data=ordered 0 0
success mounting ext formatted SD Card on Android
An improvement in technique to mount ext formatted SDcard:
1) be root and open terminal
2) insert the card
3) see the block device and partition names from dmesg
4) mount device to location of choice (create the directory if needed)
Below is an example of an SD card with one ext4 partition on it
Code:
bash-4.1# dmesg | tail | grep mmc
<6>[20230.719541] mmc1: new high speed SDHC card at address 0007
<6>[20230.722803] mmcblk1: mmc1:0007 SD32G 29.3 GiB (ro)
<6>[20230.728352] mmcblk1: p1
bash-4.1# busybox mount /dev/block/mmcblk1p1 /data/mnt/sdcard2
tribh said:
An improvement in technique to mount ext formatted SDcard:
1) be root and open terminal
2) insert the card
3) see the block device and partition names from dmesg
4) mount device to location of choice (create the directory if needed)
Below is an example of an SD card with one ext4 partition on it
Code:
bash-4.1# dmesg | tail | grep mmc
<6>[20230.719541] mmc1: new high speed SDHC card at address 0007
<6>[20230.722803] mmcblk1: mmc1:0007 SD32G 29.3 GiB (ro)
<6>[20230.728352] mmcblk1: p1
bash-4.1# busybox mount /dev/block/mmcblk1p1 /data/mnt/sdcard2
Click to expand...
Click to collapse
Would this work just the same way with i9000?
After this, no more access to the extSD by the Windows PC but only with Ubuntu, right?
tetakpatak said:
Would this work just the same way with i9000?
After this, no more access to the extSD by the Windows PC but only with Ubuntu, right?
Click to expand...
Click to collapse
Since it's generic Linux kernel and busybox functionality it should work on any 'droid. The SDcard device name might be different than in the above example - you will see the correct device and partition names after you insert SDcard and run `dmesg | tail` on the tablet or phone.
(of course your device must be rooted and have busybox...)
Typically Windows is engineered not to recognise anything that does not come from Microsoft, so you will not be able to mount the Linux partition via Windows.

[Q] Updating Boot For SD based ICS

I am using "generic-sdcard-v1.3-ICS-large-Rev3" from leapinlar/verygreen and a knightly from @CM_Encore (TeamWin)
http://forum.xda-developers.com/showthread.php?t=1000957
Pulling the micro SD out of the nook, into the SD Adapter and into the PC isn't complicated, but I would rather handle this via a PC batch and adb.
By default partition 1 of the SDCard is not mounted on boot. (so far as I can tell)
My Linux days are a bit behind me, but I found /etc/vold.fstab pointing to dev_mount sdcard /mnt/sdcard 4 /devices/platform/mmci-omap-hs.0/mmc_host/mmc1.
So I assume I want to mount somthing like:
dev_mount boot /mnt/boot 1 /devices/platform/mmci-omap-hs.0/mmc_host/mmc1
Then I can ADB PUSH updated and ADB reboot recovery.
I don't see a path to dev_mount to reproduce this approach.
I am also not sure if I need to create a /mnt/boot path first.
jmiller76 said:
I am using "generic-sdcard-v1.3-ICS-large-Rev3" from leapinlar/verygreen and a knightly from @CM_Encore (TeamWin)
http://forum.xda-developers.com/showthread.php?t=1000957
Pulling the micro SD out of the nook, into the SD Adapter and into the PC isn't complicated, but I would rather handle this via a PC batch and adb.
By default partition 1 of the SDCard is not mounted on boot. (so far as I can tell)
My Linux days are a bit behind me, but I found /etc/vold.fstab pointing to dev_mount sdcard /mnt/sdcard 4 /devices/platform/mmci-omap-hs.0/mmc_host/mmc1.
So I assume I want to mount somthing like:
dev_mount boot /mnt/boot 1 /devices/platform/mmci-omap-hs.0/mmc_host/mmc1
Then I can ADB PUSH updated and ADB reboot recovery.
I don't see a path to dev_mount to reproduce this approach.
I am also not sure if I need to create a /mnt/boot path first.
Click to expand...
Click to collapse
Just create a directory on /sdcard called boot...
adb shell mkdir /sdcard/boot
adb shell mount /dev/block/mmcblk1p1 /sdcard/boot
adb push XXXXX /sdcard/boot
There are two easy ways to accomplish what you need if you don't want to mess with adb. But Dizzy's instructions work if you are comfortable with adb.
One is to us a third party program named NookColorUMS and it will mount the boot partition on the PC using your USB cable.
The second way is to install a script file that I created to make the boot partition mount directly on the Nook.
You can learn about both by reading my tips thread linked in my signature.
Is this right to set the mount folder on the sdcard (fat32)?
I can make the folder, but attempting:
255|[email protected]:/ # mount /dev/block/mmcblk1p1 /sdcard/boot
mount /dev/block/mmcblk1p1 /sdcard/boot
Usage: mount [-r] [-w] [-o options] [-t type] device directory​The direct "Usage" text isn't explaining the syntax problem.
Believe it or not the whole /dev/block/ wasn't there when I used Linux in school. everything was just under /dev/ an ls -al took a while. Impossible to find things.
NookColorUMS-CM9.apk seems to do the trick if I switch out of MTP to Mass Storage.
Is there a way to make this work for MTP?
Id also still like to understand why the mount commands aren't working.
Thanks,
Josh
jmiller76 said:
Is this right to set the mount folder on the sdcard (fat32)?
I can make the folder, but attempting:
255|[email protected]:/ # mount /dev/block/mmcblk1p1 /sdcard/boot
mount /dev/block/mmcblk1p1 /sdcard/boot
Usage: mount [-r] [-w] [-o options] [-t type] device directory​The direct "Usage" text isn't explaining the syntax problem.
Believe it or not the whole /dev/block/ wasn't there when I used Linux in school. everything was just under /dev/ an ls -al took a while. Impossible to find things.
NookColorUMS-CM9.apk seems to do the trick if I switch out of MTP to Mass Storage.
Is there a way to make this work for MTP?
Id also still like to understand why the mount commands aren't working.
Thanks,
Josh
Click to expand...
Click to collapse
No the app only works for UMS (mass storage).
The mount command was not working for you because in CM9, you must use the -t option. For boot it is vfat. So the command would be:
mount -t vfat /dev/block/mmcblk1p1 /sdcard/boot
Specifying the type makes sense, wish mount had told me that, or that a type was needed.
Do you know what the behavior would be to mount the SD via mass storage with that mount point?
I scanned your(Leapinlar) user tips again and saw that at some point this behavior was working out of the box with /data/sdboot linked to /sdboot. It said it would be discussed again, but I am not sure the current draft does that.[it is mentioned below, but not explained]
In MTP mode the /sdcard/boot is not visible. Is there a way to register this partition as visible via MTP?
Are there any gotchas I should keep an eye out for?
Or any issues adding this to /data/local/userinit.d?
Thanks.
jmiller76 said:
Specifying the type makes sense, wish mount had told me that, or that a type was needed.
Do you know what the behavior would be to mount the SD via mass storage with that mount point?
I scanned your(Leapinlar) user tips again and saw that at some point this behavior was working out of the box with /data/sdboot linked to /sdboot. It said it would be discussed again, but I am not sure the current draft does that.[it is mentioned below, but not explained]
In MTP mode the /sdcard/boot is not visible. Is there a way to register this partition as visible via MTP?
Are there any gotchas I should keep an eye out for?
Or any issues adding this to /data/local/userinit.d?
Thanks.
Click to expand...
Click to collapse
The sdboot folder only shows inside CM. The reason I set up that folder was so GooManager could use it, not to make it available to the PC. And it works well with no issues adding that script.
Mtp only shows sdcard and emmc folders and I don't know of a way to change that. It probably does not show the sdcard/boot because it is mounted there rather than an actual part of the sdcard.
Yes, I do know how to mount the boot partition with a userint script so that it mounts using UMS, but I now use the NookColorUMS app since it is easier.

[chroot] Ubuntu or BT5 chroot script

What is a note without the use of a Desktop Environment?
I love the Resolution of this screen 1280x800 (same size as my laptop) why not put it to good use and get Ubuntu running on this thing.
Root is Required with Busybox
Your device needs to be rooted
you can follow this guide http://forum.xda-developers.com/showthread.php?t=1837907
What did I do?
Not much, credit goes mostly to mSullivan and edounn (from I717). I just modified the script and the ubuntu.img file to work for T-Mobile Galaxy Note devices and uploaded the modified IMG to my own web server.
Instructions
Download the Ubuntu.zip Img from here (1.6gb)
extract ubuntu.zip to /sdcard/ubuntu
you should see
ubuntu.sh
mountonly
unionfs
fsrw
ubuntu.img
now from the terminal type
Code:
su
to gain access to root
then type
Code:
sh /sdcard/ubuntu/ubuntu.sh
to start the script
a few questions should pop up about screen resolution and desktop environment
I used
Code:
1280x800
2 - gnome
for my selections
Download Android VNC program and use these as the credentials
Nickname: Ubuntu (or anything you want)
Password: ubuntu (lower case)
IP: 127.0.0.1
Port: 5900
Color: 24bit
Links and what not
this is the original ubuntu.img I modified
http://ubuntuone.com/1Ew1232e3D51PCjYOkkQU7
for backtrack 5 (i have not tested bt5 yet on the note)
you can go directly to the backtrack 5 website and download using
http://www.backtrack-linux.org/downloads/
these options.
Choose: BT5
ARCH: ARM
IMAGE: IMG
I believe it's about 1gb download and 5gb uncompressed and might need to resize the IMG file to use on our fat32 storage. Follow mSullivan post to see how to resize the IMG. (If and when I get BT5 on our devices i will post another howto).
If you already have your own IMG file and don't want to download 1.6gb from my web server. here is the code
Code:
##########################################
#Ubuntu boot script V1 for Tmo Note #
#Built by Donald Hui (x3maniac) #
#Thanks to everyone at XDA! #
##########################################
perm=$(id|cut -b 5)
if [ "$perm" != "0" ];then echo "This script requires root! Type: su"; exit; fi
mount -o remount,rw /dev/block/mmcblk0p24 /system
export kit=/sdcard/ubuntu
export bin=/system/bin
export mnt=/data/local/mnt
export USER=root
mkdir $mnt
export PATH=$bin:/usr/bin:/usr/local/bin:/usr/sbin:/bin:/usr/local/sbin:/usr/games:$PATH
export TERM=linux
export HOME=/root
if [ -b /dev/block/loop255 ]; then
echo "Loop device exists"
else
busybox mknod /dev/block/loop255 b 7 255
fi
#mount -o loop,noatime -t ext2 $kit/ubuntu.img $mnt
losetup /dev/block/loop255 $kit/ubuntu.img
mount -t ext2 /dev/block/loop255 $mnt
mount -t devpts devpts $mnt/dev/pts
mount -t proc proc $mnt/proc
mount -t sysfs sysfs $mnt/sys
busybox mount -o bind /sdcard $mnt/sdcard
busybox mount -o bind /sdcard/external_sd $mnt/external_sd
busybox sysctl -w net.ipv4.ip_forward=1
echo "nameserver 8.8.8.8" > $mnt/etc/resolv.conf
echo "nameserver 8.8.4.4" >> $mnt/etc/resolv.conf
echo "127.0.0.1 localhost" > $mnt/etc/hosts
echo " "
busybox chroot $mnt /root/init.sh
echo "Shutting down Ubuntu ARM"
umount $mnt/sdcard
umount $mnt/external_sd
umount $mnt/dev/pts
umount $mnt/proc
umount $mnt/sys
umount $mnt
losetup -d /dev/block/loop255
screenshot Dual Core =)
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
[reserved]
this space is reserved. i'm working on making ubuntu more functional and will be posting the how-to's here as i go
Changing root password for ssh login
remember to change the root password. type
Code:
sudo passwd root
Speeding up VNC
this helps but i can't be too sure. i tried streaming video but still a bit choppy.
using nano to edit the init.sh script in the root folder
Code:
nano /root/init.sh
look for the line that says
Code:
vncserver :0 -geometry $REZ
and add -deferupdate 10 to the end like this
Code:
vncserver :0 -geometry $REZ -deferupdate 10
(Explanation)
-deferupdate time
Time in milliseconds, to defer screen updates (default 40).
Deferring updates helps to coalesce many small desktop changes
into a few larger updates thus saving network bandwidth.
lowering this should help with updates since network bandwidth isn't a problem. I tried lowering this to 0 or 5 but it seems it makes the screen try to refresh faster then it can draw causing weird choppiness when on youtube.
compressing local vnc connection with ssh
this command below compresses the traffic from port 5900(vnc) to port 5901. should help speed up vnc
Code:
ssh -C -L 5901:127.0.0.1:5900 -N -f -l root localhost
I'm not sure if in this case this helps or not. Reason: what this does is compress the information going from one place to another, which requires more CPU. besides on a local environment i don't think it helps but i gave it a try anyway.
(Explanation)
-L 5901:localhost:5900 : Specifies that the given port on the local (client) host is to be forwarded to the given host and port on the remote side. Here you are using port 5900 on the localhost to be forward to localhost on the 5901 port.
-N : Do not execute a remote command i.e. just forward ports.
-f : Requests ssh to go to background just before command execution. Requests ssh to go to background just before command execution. Once password supplied it will go to background and you can use prompt for type commands on local system.
-l root : root is the user to log in as on the remote machine (localhost).
localhost (127.0.0.1): Remote system with VNC server
Running Ubuntu on the Note is pretty awesome.
A few things I noticed:
- For some reason the d key in gnome was set as a shortcut to minimize all windows. (I tried to typed sudo but realizing now you are already root because the shell prompt has a # symbol - old Ubuntu habbits)
- apt-get doesn't work "out of the box" you need to add /sbin to your path something like:
Code:
PATH=$PATH:/sbin
Throw that in your ~/.bash_profile
This is because it's trying to run a program in /sbin but since it's not in your path it crashes.
Also I noticed that many VNC clients don't work well with an external mouse. Jump Desktop seems to work very good with an external mouse (non-free).
Also - since I have a 32GB class 10 SD card I put this on there instead of the main memory. If you want to do this you have to edit this line in the script:
Code:
export kit=/sdcard/ubuntu
to
Code:
export kit=/sdcard/external_sd/ubuntu
nadams said:
Running Ubuntu on the Note is pretty awesome.
A few things I noticed:
- For some reason the d key in gnome was set as a shortcut to minimize all windows. (I tried to typed sudo but realizing now you are already root because the shell prompt has a # symbol - old Ubuntu habbits)
- apt-get doesn't work "out of the box" you need to add /sbin to your path something like:
Code:
PATH=$PATH:/sbin
Throw that in your ~/.bash_profile
This is because it's trying to run a program in /sbin but since it's not in your path it crashes.
Also I noticed that many VNC clients don't work well with an external mouse. Jump Desktop seems to work very good with an external mouse (non-free).
Also - since I have a 32GB class 10 SD card I put this on there instead of the main memory. If you want to do this you have to edit this line in the script:
Code:
export kit=/sdcard/ubuntu
to
Code:
export kit=/sdcard/external_sd/ubuntu
Click to expand...
Click to collapse
thank you for your input to get ubuntu working on internal sd card and path.
as for the "D" key. i remember having to change a shortcut using dconf-tools.
unfortunately i bricked my note by flashing something to the wrong partition. (seriously typo) and havn't been doing anything more with this ubuntu.img. but i will continue to host the file for anyone who needs.
x3maniac said:
thank you for your input to get ubuntu working on internal sd card and path.
as for the "D" key. i remember having to change a shortcut using dconf-tools.
unfortunately i bricked my note by flashing something to the wrong partition. (seriously typo) and havn't been doing anything more with this ubuntu.img. but i will continue to host the file for anyone who needs.
Click to expand...
Click to collapse
Do you think you could post some instructions on how to resize the img disk? I looked in the linked thread and he talks about how to set it up but I don't see anything about resizing it. One of the reasons why I am asking is because there doesn't seem to be enough room for a release upgrade:
Code:
The upgrade has aborted. The upgrade needs a total of 869M free space
on disk '/'. Please free at least an additional 69.2M of disk space
on '/'. Empty your trash and remove temporary packages of former
I tried to run fdisk -l on ubuntu.img just to check out the partition table and I get this error:
Code:
Disk ubuntu.img doesn't contain a valid partition table
Edit: doh - I should of realized that a raw image file wouldn't have a partition table. So to resize:
Code:
dd if=/dev/zero bs=1M count=7168 >> data.img
yes | e2fsck -f data.img
resize2fs data.img
yes | e2fsck -f data.img
Though if you are paranoid you can leave off the yes.
Please note - there are tutorials out there that talk about using cp - this is a bad approach not only because you have to copy the files (this is slow) but some of them don't use the parameter to copy the attributes!
However, this presents a problem of why these Linux images are usually only 3.5GB. Fat32 can only have a file up to 4GB. So if you resize - you will need to format your SD card to ext3. Though exFAT should work - I don't know if Android supports that. I suppose that we could separate the image into different mount points - but eventually I think you will hit the 4GB limit.
Edit 2:
This is more frustrating than it needs to be. So I attempted to format the SD card as ext3/4 - Android refused to automatically mount it (even though it mounts system partitions with ext4). So I'm pretty sure in the Android subsystem it has a
Code:
mount -t vfat /dev/mmcblk1p1 /mnt/sdcard/external_sd
. In any case I tried several applications from the app store to add compatibility - with little success. I managed to get NTFS auto mounted at boot - but Android refuses to read the apps from an NTFS sd card (which I have a feeling would be the same with ext4 if I could get it mounted).
So at this point I am trying 2 partitions: most of the SD card is FAT32, and the second chunk will be ext2 for Ubuntu.
Edit 3:
2 partitions are working great. Just altered the script to mount the partition instead of mounting the file. To be honest I think it's a little faster on a separate partition.
Edit 4:
After upgrading System Monitor no longer sees two cores. I am looking into it.

Linking from /mnt/sdcard to /mnt/sdcard-ext - automatization

Found the solution, it's in the fifth post
Hey, first of all I'm Linux and Android newbie, so sorry if my question reveals it a bit
As my Internal Storage a.k.a. /mnt/sdcard is getting full and I hate to be reminded of it by notification I can't get rid of, I decided to put some effort into moving the largest files to the SD card. I have a 64GB SD an there still are several free gigs So after some googling I found out a way to link it. It works like this:
Code:
mount -o bind /origdir /newdir
where both /origdir and /newdir must exist, in my case as an example:
Code:
mount -o bind /mnt/sdcard-ext/sd/DictionariesNGHS /mnt/sdcard/DictionariesNGHS
where /mnt/sdcard-ext/sd/DictionariesNGHS is the data containing folder and /mnt/sdcard/sd/DictionariesNGHS is an empty folder for linking. It works like a charm, tried with several applications including some off-line navigations. The downside is that such links are forgotten after a reboot.
I didn't find out how to automatize that. I tried putting the line from second code to the end of /system/etc/init.goldfish.sh (I run Eclipse ICS 1.2) and it didn't get linked after a reboot (but works OK after mounting manually in terminal) - I suspect it runs before sdcard-ext is mounted. Any thoughts on how to make it run after reboot? Or maybe of an app that does this for me?
EDIT:
Put my links into /data/data/init.sh
Tried several not working apps:
ScriptMe by gilsken says Script run mount: No such file or directory
Script Manager - SManager by devworm says
Code:
exec sh '/data/data/init.sh'
[email protected]_maserati:/ # exec sh '/data/data/init.sh'
mount: No such file or directory
while interestingly when I write it by myself in its built-in console it works...
App that works: Tasker by Crafty Apps
I can have scripts run on boot and it works, but I can add only one line at time (or at least it's the only option I found) which is still kinda inconvenient plus it runs all the time consuming system resources. I'd like some less robust solution, preferably executed after boot and exiting after mounts proceed. Any ideas?
EDIT 2:
My "workaround" in Tasker: Profiles -> New -> Event -> System -> Device Boot -> OK -> New Task -> OK -> + -> Script -> Run Shell -> Command: /data/data/init.sh -> OK
Surprisingly enough it doesn't even need root permission...
In init.sh I have several lines with different mounts, it all works well. I'm still looking for less robust solution than Tasker is, or maybe a way to kill it after the init.sh is processed?
hey
can you please post the content of youre
Code:
/data/data/init.sh
---------- Post added at 04:35 PM ---------- Previous post was at 03:50 PM ----------
youre problem is, at the runtime form the mount command, the mount is not in youre path.
can you add to you script the command
Code:
env
and post the output?
I tried it with a file containing only this line:
Code:
mount -o bind /mnt/sdcard-ext/sd/DictionariesNGHS /mnt/sdcard/DictionariesNGHS
OK, after running it by SManager it looks like giving errors, but the folder gets mounted.
Also it seems apps get access to /mnt/sdcard faster after reboot then to /data/data (I wonder why...?) so I moved the script there.
Here you have the output with env at the end of init.sh, run by SManager as root (mounted OK):
Code:
exec sh '/mnt/sdcard/init.sh'
[email protected]_maserati:/ # exec sh '/mnt/sdcard/init.sh'
mount: No such file or directory
_=/system/xbin/env
ANDROID_BOOTLOGO=1
ANDROID_PROPERTY_WORKSPACE=8,69632
LOOP_MOUNTPOINT=/mnt/obb
SM_API=15
RANDOM=26725
ANDROID_ASSETS=/system/app
USER=root
EXTERNAL_STORAGE=/mnt/sdcard
ANDROID_DATA=/data
PATH=/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin
SM_LAUNCHER=MANUAL
TERM=vt100
PS1=$(precmd)[email protected]$HOSTNAME:${PWD:-?} #
SM_VERSION=2.5.3.1
SM_GUIFD=3
LD_LIBRARY_PATH=/vendor/lib:/system/lib
SECONDARY_STORAGE=/mnt/sdcard-ext
SM_ALIAS=init.sh
ASEC_MOUNTPOINT=/mnt/asec
SM_HOME=/mnt/sdcard
HOSTNAME=cdma_maserati
HOME=/
SM_VERSIONCODE=77
BOOTCLASSPATH=/system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/framework-ext.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/filterfw.jar:/system/framework/com.motorola.android.frameworks.jar:/system/framework/com.motorola.android.widget.jar:/system/framework/com.motorola.frameworks.core.addon.jar:/system/framework/kafdex.jar:/system/framework/com.motorola.orange.simauth.jar
ANDROID_ROOT=/system
SHELL=/system/bin/sh
MKSH=/system/bin/sh
ANDROID_SOCKET_zygote=9
So it works after all with the SManager as I intended, I just don't understand why it gives that error when everything actually is OK...
Any ideas on how to make it run automatically after every mount of sdcard-ext instead of on reboot? Because when I connect it to the computer as Mass Storage, the directory mounts disappear and I have to run the script manually...
LuH said:
I tried it with a file containing only this line:
Code:
mount -o bind /mnt/sdcard-ext/sd/DictionariesNGHS /mnt/sdcard/DictionariesNGHS
...
Any ideas on how to make it run automatically after every mount of sdcard-ext instead of on reboot? Because when I connect it to the computer as Mass Storage, the directory mounts disappear and I have to run the script manually...
Click to expand...
Click to collapse
for the first, replace the mount with this:
Code:
/system/bin/mount -o bind /mnt/sdcard-ext/sd/DictionariesNGHS /mnt/sdcard/DictionariesNGHS
Found out that the "mount: No such file or directory" error was due to typo in folder path
So to wrap it up:
You need to be rooted first.
Create your init.sh script file, works fine when put to /mnt/sdcard/
Example file (also attached so you have a sample in UNIX formatting - don't open with Notepad under Windows, better edit it in your phone):
Code:
# mount -o bind /sourcedir /fakedir - both sourcedir and fakedir MUST exist!
mount -o bind /mnt/sdcard-ext/sd/DictionariesNGHS /mnt/sdcard/DictionariesNGHS
mount -o bind /mnt/sdcard-ext/sd/Android/obb /mnt/sdcard/Android/obb
Note: you should use a UNIX formatting of the file, not Windows (I'm not sure if it's necessary though).
As hinted in the beginning note, sourcedir and fakedir must exist and after successful mount the fakedir folder will appear to have the contents of the sourcedir folder. Any fakedir's contents are ignored ("disappear") after mount and reappear only after it gets unmounted.
It gets automatically unmounted after unmounting of either fakedir's or sourcedir's media (typically when connecting phone to a computer as mass storage) and I haven't found any workaround for running the script after remounting of media... Any suggestions?
Install SManager (free version here).
In SManager navigate to your script file, tap it and select Script/Executable and tap Su and Boot icons (see attached screenshot).
Done, your folders get mounted on reboot

Categories

Resources