FORUMS
Remove All Ads from XDA

vold, using ext3 on SD, USB drives

2,442 posts
Thanks Meter: 1,137
 
By Renate NST, Inactive Recognized Developer / Recognized Contributor on 10th March 2013, 04:29 PM
Post Reply Email Thread
vold is the volume daemon which is responsible for mounting removable (and sometimes non-removable) volumes.
It's the daemon that mounts your SD card so that you can use it.
It also mounts /media and is responsible for switching to USB mode when you plug the Nook into a desktop.
It's also what should be mounting your USB flash drives when you plug them in.

While working on my adbsync.exe I kept on running into bugs related to the vfat file system on the SD card.
Using the adage of "It's better to fix someone else's bugs than your own bugs", I set to work on vold.

The vold that ships with the Nook is non-standard.
I don't know if it was snarfed by B&N from somewhere.
It won't mount ext3 volumes or USB flash drives.

I built vold from the Eclair sources and it works even worse than the B&N stock.
A bunch of hacking later, I got it to mount an ext3 partition on an SD card.
I'm still working on USB drives and multiple partitions on an SD card.

So my adbsync.exe works marvelously now that it has real UTC timestamps to go on (courtesy of ext3).

As soon as I get things a bit more stabilized I'll post vold.
The Following 7 Users Say Thank You to Renate NST For This Useful Post: [ View ] Gift Renate NST Ad-Free
 
 
11th March 2013, 08:15 PM |#2  
Renate NST's Avatar
OP Inactive Recognized Developer / Recognized Contributor
Boston
Thanks Meter: 1,137
 
More
Code:
# mount
rootfs / rootfs ro 0 0
tmpfs /dev tmpfs rw,mode=755 0 0
devpts /dev/pts devpts rw,mode=600 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
tmpfs /sqlite_stmt_journals tmpfs rw,size=4096k 0 0
/dev/block/mmcblk0p2 /rom vfat rw,noatime,nodiratime,uid=1000,gid=1000,fmask=0117,dmask=0007,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,errors=remount-ro 0 0
/dev/block/mmcblk0p5 /system ext2 ro,errors=continue 0 0
/dev/block/mmcblk0p8 /data ext3 rw,nosuid,nodev,noatime,nodiratime,errors=continue,data=ordered 0 0
/dev/block/mmcblk0p7 /cache ext3 rw,nosuid,nodev,noatime,nodiratime,errors=continue,data=ordered 0 0
/dev/block/vold/179:6 /media vfat rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block/vold/179:17 /sdcard ext3 rw,sync,nosuid,nodev,noexec,noatime,nodiratime,errors=continue,data=ordered 0 0
/dev/block/vold/179:18 /audio ext3 rw,sync,nosuid,nodev,noexec,noatime,nodiratime,errors=continue,data=ordered 0 0
/dev/block/vold/180:1 /usb vfat rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
This still has a few wrinkles, but it's getting there.
The Following 2 Users Say Thank You to Renate NST For This Useful Post: [ View ] Gift Renate NST Ad-Free
12th March 2013, 08:03 PM |#3  
Member
Flag NY
Thanks Meter: 4
 
More
Thumbs up
Thank you for continuing to develop for the NST! Just wanted to let you know.
Also, thank you for your Library app (it's the best for me).
15th March 2013, 02:53 AM |#4  
Renate NST's Avatar
OP Inactive Recognized Developer / Recognized Contributor
Boston
Thanks Meter: 1,137
 
More
Ok, for the adventurous we have a beta release of vold.

The first thing is to decide your mount points.
You may like them in the root, like /sdcard or higher up like /mnt/usb
You will have to establish these mount points in init.rc (in uRamdisk).
You can just put them after the one for /sdcard.

All my examples are based upon using the original /media, having two partitions on the removable SD card and one partition on a USB flash drive.
You may use more or less of this stuff depending on your needs.
Code:
    mkdir /media 0777 system system
    mkdir /sdcard 0777 system system
    mkdir /audio 0777 system system
    mkdir /usb 0777 system system
Edit vold.conf to suit your setup.

Then replace /system/bin/vold and /system/etc/vold.conf
Be sure to chmod 755 vold

There are a few small wrinkles now.
One is that upon booting it will give you a notification that a drive has been removed.
This is due to a strangeness in the Android code, but for right now it's not worth patching that.
The other wrinkle is that it will complain when you disconnect a USB drive.

Things that do work nicely.
  • Mounting of vfat or ext3 partitions
  • Mounting of multiple partitions on a single device
  • Automatic mounting of USB drives
  • The UMS still works for /media and one other partition (presumably /sdcard).
Download in the signature.
If you run into strangeness, please post your /system/etc/vold.conf & /data/voldlog
The Following 3 Users Say Thank You to Renate NST For This Useful Post: [ View ] Gift Renate NST Ad-Free
13th June 2013, 10:35 PM |#5  
Junior Member
Pisa, Italy
Thanks Meter: 3
 
More
Many many thanks! I had messed up the partitions on my ST. Even after fixing it, I couldn't get /media to mount via USB, and couldn't understand why. Your new version fixed my problems. Thanks again!
15th December 2013, 07:30 AM |#6  
Senior Member
Flag Siberia
Thanks Meter: 434
 
Donate to Me
More
Hi Renate NST,

Unfortunately, i was unable to make USB automount work
I have replaced /system/bin/vold (set perm to 755), added the following lines to /system/etc/vold.conf:
Code:
volume_usb
{
   media_path     /devices/platform/musb_hdrc/usb1
   media_type     mmc
   partition      1   
   mount_point    /usb
}
... and edited /init.rc with:
Code:
    mkdir /usb 0777 system system
It seems that something wrong happens with vold when I plug usb flash drive and press "HOST" button. Here is the logcat output:
Code:
I/DEBUG   (  972): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   (  972): Build fingerprint: 'generic/zoom2/zoom2/zoom2:2.1/ERD79/1.1.2:user/test-keys'
I/DEBUG   (  972): pid: 971, tid: 971  >>> /system/bin/vold <<<
I/DEBUG   (  972): signal 11 (SIGSEGV), fault addr 0ccccccc
I/DEBUG   (  972):  r0 0ccccccc  r1 00000000  r2 80808080  r3 00000000
I/DEBUG   (  972):  r4 0ccccccc  r5 00000002  r6 00000000  r7 bec6622c
I/DEBUG   (  972):  r8 00000000  r9 00000000  10 00000000  fp bec66a2c
I/DEBUG   (  972):  ip ffffffff  sp bec661a8  lr afe162bb  pc afe0e530  cpsr 60000010
I/DEBUG   (  972):          #00  pc 0000e530  /system/lib/libc.so
I/DEBUG   (  972):          #01  pc 000162b8  /system/lib/libc.so
I/DEBUG   (  972): 
I/DEBUG   (  972): code around pc:
I/DEBUG   (  972): afe0e520 1afffff6 e1a00002 e3082080 e3482080 
I/DEBUG   (  972): afe0e530 e490c004 e0433000 f5d0f040 e04c13a2 
I/DEBUG   (  972): afe0e540 e0011002 e1d1100c 0490c004 1a000022 
I/DEBUG   (  972): 
I/DEBUG   (  972): code around lr:
I/DEBUG   (  972): afe162a8 1b039c09 bfa84563 e0034663 f7f89809 
I/DEBUG   (  972): afe162b8 4603e90a 7e88f50d 0c00f04f 46629c06 
I/DEBUG   (  972): afe162c8 cc01f80e c018f8cd 970ee140 0610f046 
I/DEBUG   (  972): 
I/DEBUG   (  972): stack:
I/DEBUG   (  972):     bec66168  00000000  
I/DEBUG   (  972):     bec6616c  00000000  
I/DEBUG   (  972):     bec66170  00000000  
I/DEBUG   (  972):     bec66174  00000000  
I/DEBUG   (  972):     bec66178  00000000  
I/DEBUG   (  972):     bec6617c  00000000  
I/DEBUG   (  972):     bec66180  00000000  
I/DEBUG   (  972):     bec66184  00000000  
I/DEBUG   (  972):     bec66188  00000000  
I/DEBUG   (  972):     bec6618c  00000000  
I/DEBUG   (  972):     bec66190  00000000  
I/DEBUG   (  972):     bec66194  00000000  
I/DEBUG   (  972):     bec66198  00000000  
I/DEBUG   (  972):     bec6619c  00000000  
I/DEBUG   (  972):     bec661a0  df002777  
I/DEBUG   (  972):     bec661a4  e3a070ad  
I/DEBUG   (  972): #00 bec661a8  00000000  
I/DEBUG   (  972):     bec661ac  0ccccccc  
I/DEBUG   (  972): #01 bec661b0  00000000  
I/DEBUG   (  972):     bec661b4  00000000  
I/DEBUG   (  972):     bec661b8  00000000  
I/DEBUG   (  972):     bec661bc  00000000  
I/DEBUG   (  972):     bec661c0  00000000  
I/DEBUG   (  972):     bec661c4  00000000  
I/DEBUG   (  972):     bec661c8  bec668d8  [stack]
I/DEBUG   (  972):     bec661cc  00000000  
I/DEBUG   (  972):     bec661d0  00000000  
I/DEBUG   (  972):     bec661d4  0ccccccc  
I/DEBUG   (  972):     bec661d8  bec66444  [stack]
I/DEBUG   (  972):     bec661dc  00000073  
I/DEBUG   (  972):     bec661e0  afe3ae08  /system/lib/libc.so
I/DEBUG   (  972):     bec661e4  bec662bf  [stack]
I/DEBUG   (  972):     bec661e8  000176dc  /system/bin/vold
I/DEBUG   (  972):     bec661ec  00000000  
I/DEBUG   (  972):     bec661f0  00000000  
I/DEBUG   (  972):     bec661f4  00000006  
E/MountListener( 1051): Failed to connect to vold
E/MountListener( 1051): java.lang.IllegalStateException
E/MountListener( 1051): 	at com.android.server.MountListener.listenToSocket(MountListener.java:269)
E/MountListener( 1051): 	at com.android.server.MountListener.run(MountListener.java:289)
E/MountListener( 1051): 	at java.lang.Thread.run(Thread.java:1096)
I/vold    ( 4450): Android Volume Daemon version 2.0
D/vold    ( 4450): Partition not specified, defaulting to 1
W/vold    ( 4450): Volume '/media' already mounted at startup
W/vold    ( 4450): Volume '/sdcard' already mounted at startup
I/vold    ( 4450): Name: 002G00, Serial: 0x090fe044
E/vold    ( 4450): Error making device nodes for '/dev/block/vold/179:0' (File exists)
I/vold    ( 4450): New blkdev 179.0 on media 002G00, media path /devices/platform/mmci-omap-hs.1/mmc_host/mmc0/mmc0:0001/block/mmcblk0
E/vold    ( 4450): Could not find volume by /devices/platform/mmci-omap-hs.1/mmc_host/mmc0/mmc0:0001/block/mmcblk0 and 0
E/vold    ( 4450): Error making device nodes for '/dev/block/vold/179:1' (File exists)
I/vold    ( 4450): New blkdev 179.1 on media 002G00, media path /devices/platform/mmci-omap-hs.1/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p1
E/vold    ( 4450): Could not find volume by /devices/platform/mmci-omap-hs.1/mmc_host/mmc0/mmc0:0001/block/mmcblk0 and 1
E/vold    ( 4450): Error making device nodes for '/dev/block/vold/179:2' (File exists)
I/vold    ( 4450): New blkdev 179.2 on media 002G00, media path /devices/platform/mmci-omap-hs.1/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p2
E/vold    ( 4450): Could not find volume by /devices/platform/mmci-omap-hs.1/mmc_host/mmc0/mmc0:0001/block/mmcblk0 and 2
E/vold    ( 4450): Error making device nodes for '/dev/block/vold/179:3' (File exists)
I/vold    ( 4450): New blkdev 179.3 on media 002G00, media path /devices/platform/mmci-omap-hs.1/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p3
E/vold    ( 4450): Could not find volume by /devices/platform/mmci-omap-hs.1/mmc_host/mmc0/mmc0:0001/block/mmcblk0 and 3
E/vold    ( 4450): Error making device nodes for '/dev/block/vold/179:4' (File exists)
I/vold    ( 4450): New blkdev 179.4 on media 002G00, media path /devices/platform/mmci-omap-hs.1/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p4
E/vold    ( 4450): Could not find volume by /devices/platform/mmci-omap-hs.1/mmc_host/mmc0/mmc0:0001/block/mmcblk0 and 4
E/vold    ( 4450): Error making device nodes for '/dev/block/vold/179:5' (File exists)
I/vold    ( 4450): New blkdev 179.5 on media 002G00, media path /devices/platform/mmci-omap-hs.1/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p5
E/vold    ( 4450): Could not find volume by /devices/platform/mmci-omap-hs.1/mmc_host/mmc0/mmc0:0001/block/mmcblk0 and 5
E/vold    ( 4450): Error making device nodes for '/dev/block/vold/179:6' (File exists)
I/vold    ( 4450): New blkdev 179.6 on media 002G00, media path /devices/platform/mmci-omap-hs.1/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p6
E/vold    ( 4450): Volume /media already mounted (did we just crash?)
E/vold    ( 4450): Error making device nodes for '/dev/block/vold/179:7' (File exists)
I/vold    ( 4450): New blkdev 179.7 on media 002G00, media path /devices/platform/mmci-omap-hs.1/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p7
E/vold    ( 4450): Could not find volume by /devices/platform/mmci-omap-hs.1/mmc_host/mmc0/mmc0:0001/block/mmcblk0 and 7
E/vold    ( 4450): Error making device nodes for '/dev/block/vold/179:8' (File exists)
I/vold    ( 4450): New blkdev 179.8 on media 002G00, media path /devices/platform/mmci-omap-hs.1/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p8
E/vold    ( 4450): Could not find volume by /devices/platform/mmci-omap-hs.1/mmc_host/mmc0/mmc0:0001/block/mmcblk0 and 8
D/vold    ( 4450): send_msg(ums_disabled):
D/vold    ( 4450): send_msg(ums_disconnected):
D/vold    ( 4450): Bootstrapping complete
D/dalvikvm( 4071): GC freed 3242 objects / 522848 bytes in 36ms
D/vold    ( 4450): Accepted connection from framework
D/vold    ( 4450): send_msg(volume_mounted:/media):
D/MountListener( 1051): handleEvent volume_mounted:/media
D/vold    ( 4450): send_msg(volume_mounted:/sdcard):
D/vold    ( 4450): send_msg(volume_nomedia:/usb):
D/vold    ( 4450): dispatch_cmd(send_ums_status):
D/vold    ( 4450): send_msg(ums_disabled):
D/vold    ( 4450): send_msg(ums_disconnected):
D/vold    ( 4450): dispatch_cmd(mount_volume:/sdcard):
E/vold    ( 4450): Cannot start volume '/sdcard' (volume is not bound)
D/vold    ( 4450): dispatch_cmd(mount_volume:/media):
E/vold    ( 4450): Cannot consider volume '/media' because it is in state '4
E/vold    ( 4450): volmgr failed to start volume '/media'
D/MountListener( 1051): handleEvent volume_mounted:/sdcard
I/ActivityManager( 1051): Starting activity: Intent { flg=0x10000000 cmp=android/com.android.internal.app.ExternalMediaStatusActivity (has extras) }
D/MountListener( 1051): handleEvent volume_nomedia:/usb
D/MediaScannerService( 1152): start scanning volume external
I/ActivityManager( 1051): Starting activity: Intent { flg=0x10000000 cmp=android/com.android.internal.app.ExternalMediaStatusActivity (has extras) }
D/MountListener( 1051): handleEvent ums_disabled
D/MountListener( 1051): handleEvent ums_disconnected
Here is the /data/voldlog:
Code:
12:49:55.406  Starting vold
12:49:55.610  <=  volume_checking:/media
12:49:55.612  <=  ums_disabled
12:49:55.612  <=  ums_disconnected
12:49:56.487  <=  volume_mounted:/media
12:50:08.605  Framework connected
12:50:08.605  <=  volume_mounted:/media
12:50:08.605  <=  volume_nomedia:/sdcard
12:50:08.605  <=  volume_nomedia:/usb
12:50:08.606  <=  ums_disabled
12:50:08.606  <=  ums_disconnected
12:50:08.606  =>  send_ums_status
12:50:08.606  =>  mount_volume:/sdcard
12:50:08.606  =>  mount_volume:/media
12:50:14.008  Starting vold
12:50:14.012  <=  ums_disabled
12:50:14.012  <=  ums_disconnected
12:50:16.003  Framework connected
12:50:16.003  <=  volume_mounted:/media
12:50:16.011  <=  volume_mounted:/sdcard
12:50:16.012  <=  volume_nomedia:/usb
12:50:16.012  <=  ums_disabled
12:50:16.012  <=  ums_disconnected
12:50:16.012  =>  send_ums_status
12:50:16.012  =>  mount_volume:/sdcard
12:50:16.012  =>  mount_volume:/media
USB host mode seems to work correctly, since i'm able to mount the drive manually:
Code:
mount -t vfat /dev/block/uba1 /usb
15th December 2013, 12:40 PM |#7  
Renate NST's Avatar
OP Inactive Recognized Developer / Recognized Contributor
Boston
Thanks Meter: 1,137
 
More
Alright, so I was confused and in a hurry when I last responded.

You are connecting the USB flash drive, then hitting the Host button on UsbMode?
It could be related to the USB going in and out.
Are you trying to use a flash drive without a hub?
That's problematic depending on how much current it takes.

Use a hub.
Put it in host mode.
Connect a keyboard and see that it sees it.
Then plug in the flash drive.
17th December 2013, 05:46 AM |#8  
Senior Member
Flag Siberia
Thanks Meter: 434
 
Donate to Me
More
Quote:
Originally Posted by Renate NST

You are connecting the USB flash drive, then hitting the Host button on UsbMode?

Excatly. When i hitting the button, there pops up the icon with SD card at the top of the screen (just like when you inserting a microSD), but no new mounts appears. However, it creates the new block device (/dev/block/uba1) and i can mount it by hands: mount -t vfat /dev/block/uba1 /usb.

Concering the USB hub: yes, i found that the most of my flash drives are refusing to work via direct plugging in. However, i found an ancient 256 MB usb flash drive that work perfectly So i'm playing with it since I have no a powered usb hub at this moment.
17th December 2013, 12:46 PM |#9  
Renate NST's Avatar
OP Inactive Recognized Developer / Recognized Contributor
Boston
Thanks Meter: 1,137
 
More
The vold I mixed up is just a stock (not B&N) version with a few modifications for multiple partitions and ext3 support.

Trying to run a flash drive without a hub is too much on the edge.
The Nook can really only supply about 70 mA to the USB.
Most older flashes take more than that.

I would only rely on keyboards and other things that take less than 10 mA.
NOOK!E
5th September 2014, 09:36 PM |#10  
Guest
Thanks Meter: 0
 
More
Hi everyone. Sorry to dig up an old thread.

I just attempted to install this on my Nook Touch Glow with firmware 1.2.1. Unfortunately, it only seems to activate the little boot-up bug where it says that your SD card has been removed, the aforementioned (somewhere on this forum) screensaver bug (see spoiler below), and it doesn't seem to do much else. It doesn't auto-mount my USB drives, but that could be because I haven't been able to get the cpio applet to work for extracting and editing the uramdisk file.

All around, I'd rather have the old vold and vold.conf back. Can anyone please post the original vold (found in /system/bin) and vold.conf (found in /system/etc) for me? That'd be great!

Or, Renate, would you be up for trying to fix the screensaver bug and mounting bug and making a new vold?

Thanks,

3N


For some reason, when I installed the vold file found in this thread, it immediately (after a reboot) caused the Settings > Screen > Screensavers option to only show the screensaver folders located in /system/media/screensaver, and not show any of the ones in /media/screensavers. So I thought Okay, I'll just move my screensaver folders to /system/media/screensaver. I tried that, and what I found was that if I selected a folder other than Authors or Nature for use as the screensaver, it just automatically selected Authors again.

My temporary fix is to put my screensavers in Authors and put the original authors files in a backup folder, but I'd love to be able to fix this or just get rid of this new vold altogether.


EDIT - Thanks to OverByter for giving me these files! Sorry that your vold doesn't seem to work so well, though, Renate.
7th September 2014, 01:46 PM |#11  
Renate NST's Avatar
OP Inactive Recognized Developer / Recognized Contributor
Boston
Thanks Meter: 1,137
 
More
All the original B&N files are available in the original B&N update, just unzip them.

I use my bootutil.exe (in signature) for modifying ramdisks.

Although vold was working fine, I've largely given up on it.
Mounting USB drives on the Nook was really not too practical.
Both USB host mode and USB drives take a lot of current.
You'd be better off just copying it to the SD card.
Isn't 32 G enough?

I use mntsdcard these days.
The thread is here: http://forum.xda-developers.com/show....php?t=2609223
It works fine and I haven't thought about it for a while.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes