[Q] /data cannot be mounted - Bravo General

After installing new CM ROM: http://forum.xda-developers.com/showthread.php?t=1779324
Most things function fine, with a few hiccups. However, any time the phone is rebooted, it goes back to default settings. As if it cannot save anything.
So I pulled this out of dmesg:
Code:
VFS: Can't find ext3 filesystem on dev mmcblk1p25.
Which corresponds to /data in /system/etc/fstab.
Could anyone give some insight into this? Would it be safe to format to ext3?

t1nk_2 said:
After installing new CM ROM: http://forum.xda-developers.com/showthread.php?t=1779324
Most things function fine, with a few hiccups. However, any time the phone is rebooted, it goes back to default settings. As if it cannot save anything.
So I pulled this out of dmesg:
Code:
VFS: Can't find ext3 filesystem on dev mmcblk1p25.
Which corresponds to /data in /system/etc/fstab.
Could anyone give some insight into this? Would it be safe to format to ext3?
Click to expand...
Click to collapse
Not sure what the problem is, but do not format it to ext3. If you format it, there's a chance you'll brick since the key of the partition will change, and our locked bootloader requires them to be at a specific setting. All the format options in the recovery are really rm -rf commands (just deletes everything) and don't really format at all.
I'd wipe data\factory reset (from cwm) and reinstall the rom. If that doesn't work, then go here and download Quarx's latest build for the Bravo or over to my PA thread and download its latest. You can use PA exactly like CM10 by disabling PA's hybrid UI. I know for sure that PA version works cause I used if for a month before flashing a 7 port I'm started working on yesterday.
Good luck

skeevy420 said:
Not sure what the problem is, but do not format it to ext3. If you format it, there's a chance you'll brick since the key of the partition will change, and our locked bootloader requires them to be at a specific setting. All the format options in the recovery are really rm -rf commands (just deletes everything) and don't really format at all...
Click to expand...
Click to collapse
I did find in /default.prop:
Code:
# ADDITIONAL_DEFAULT_PROPERTIES (From bootmenu/config)
...
# Forbid format of these partitions in mount menu (use only rm -r)
ro.cwm.forbid_format=/misc,/devtree,/config,/boot,/recovery,/pds,/system,/logo
Most of those are mounted with an "emmc" filesystem/module I've never heard of in linux.
I'd wipe data\factory reset (from cwm) and reinstall the rom. If that doesn't work, then go ... and download Quarx's latest build for the Bravo or over to my PA thread and download its latest. You can use PA exactly like CM10 by disabling PA's hybrid UI. I know for sure that PA version works cause I used if for a month before flashing a 7 port I'm started working on yesterday.
Click to expand...
Click to collapse
Unfortunately, installing any ROM fails to fix the issue. Tried PA first, got stuck in a bootloop. That leads me to believe ROMs will always require a working file structure.
I did however 'factory reset/wipe cache' from stock recovery (which claimed to format /data), load ROM, reset/wipe, reboot.
This did appear to solve the absence of /data mount. But it did not resolve the userdata persistence between reboots.
I found in /data/system/uiderrors.txt:
Code:
11/2/12 5:19 PM: No settings file; creating initial state
I tried changing some permissions via adb shell, but these were reset on reboot.
I suspect something with the init scripts is reseting something (it shouldn't be) on boot, however this is an area unfamiliar to me. I know some of those files are readable, I guess I'll have to just go through them line by line and see what makes sense....
CM 10-20120912-NIGHTLY-mb520
Build: cm_mb520_userdebug 4.1.1 JRO03L eng. quarx.20120912.233429 test-keys
Bootmenu v2.0-beta + Bootmenu JB Recovery v5.7.0-kobe

Didn't find anything conclusive in the parsable sections of init.* files, however I did notice that they often mount partitions and setup permissions.
On further digging into my phone, I saw that my *original* /data mount was still failing to function. Even though it has been repopulated under rootfs.
My output of mount:
Code:
rootfs on / type rootfs (rw,relatime)
tmpfs on /dev type tmpfs (rw,relatime,mode=755)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
/dev/block/mmcblk1p21 on /system type ext3 (rw,relatime,barrier=1,data=ordered)
tmpfs on /dev type tmpfs (rw,nosuid,relatime,mode=755)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
none on /acct type cgroup (rw,relatime,cpuacct)
tmpfs on /mnt/asec type tmpfs (rw,relatime,mode=755,gid=1000)
tmpfs on /mnt/obb type tmpfs (rw,relatime,mode=755,gid=1000)
none on /dev/cpuctl type cgroup (rw,relatime,cpu)
/dev/block/loop7 on /pds type ext3 (rw,nosuid,nodev,noatime,nodiratime,barrier=1,data=ordered)
ramfs on /tmp type ramfs (rw,relatime,relatime)
/dev/block/vold/179:1 on /mnt/sdcard type vfat (rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage
/dev/block/vold/179:1 on /mnt/secure/asec type vfat (rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,cod
tmpfs on /mnt/sdcard/.android_secure type tmpfs (rw,relatime,size=0k,mode=000)
If someone could paste their output (working ROM) for comparison, please.
This might help explain why my internal storage reads as 0Gb available, preventing Play store installs (I can force copy backups via adb).
At least I can enjoy JB so long as I don't reboot/power off.

From Quarx CM10 Custom Kernel Defy Plus 11\04 (running on a Bravo)
Code:
rootfs on / type rootfs (ro,relatime)
tmpfs on /dev type tmpfs (rw,nosuid,relatime,mode=755)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
none on /acct type cgroup (rw,relatime,cpuacct)
tmpfs on /mnt/asec type tmpfs (rw,relatime,mode=755,gid=1000)
tmpfs on /mnt/obb type tmpfs (rw,relatime,mode=755,gid=1000)
none on /dev/cpuctl type cgroup (rw,relatime,cpu)
/dev/block/mmcblk1p21 on /system type ext3 (ro,relatime,data=ordered)
/dev/block/mmcblk1p24 on /cache type ext3 (rw,nosuid,nodev,noatime,nodiratime,errors=continue,data=ordered)
/dev/block/mmcblk1p25 on /data type ext3 (rw,nosuid,nodev,noatime,nodiratime,errors=continue,data=ordered)
/dev/block/loop7 on /pds type ext3 (rw,nosuid,nodev,noatime,nodiratime,barrier=1,data=ordered)
ramfs on /tmp type ramfs (rw,relatime,relatime)
/dev/block/vold/179:1 on /mnt/sdcard type vfat (rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
/dev/block/vold/179:1 on /mnt/secure/asec type vfat (rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
tmpfs on /mnt/sdcard/.android_secure type tmpfs (ro,relatime,size=0k,mode=000)
Here's one option you could try -- fsck to repair the filesystem of any damage.
reboot into recovery
start adbd (Advanced->Start adbd)
open a terminal\command prompt (on PC...)
adb remount
adb shell
su
umount /data
e2fsck -fv /dev/block/mmcblk1p25
reboot and hope it worked
While a crappy option, have you tried flashing the sbf yet? If flashing the sbf two or three time in a row doesn't fix your issues then (probably) nothing will.

Being that the fs was never mounted:
adb shell
su
e2fsck -fv /dev/block/mmcblk1p25
And output:
Code:
e2fsck 1.41.11 (14-Mar-2010)
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open /dev/block/mmcblk1p25
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
Which made me want to simply format. I don't know about "signatures", is there a blkid-like function under /system/bin? AFAICK init scripts only refer to /dev fs when mounting.
...have you tried flashing the sbf yet?...
Click to expand...
Click to collapse
In the course of events, yes, I did. This is how it went: from Bandroidx recovery + BravoX ROM (working fine), installed CM10 (w/o clearing anything, I was excited) managed to get a mostly working system w/o gapps. Not knowing it came with its own bootmenu, tried installing Bandroidx again. Led to bootloader error. Flashed fixed_bravo_sbf.sbf. Got CM back. Not sure when /data was corrupted...
I also have p4_kobe_umts_kobe_user_3.4.2-125_KOB_FFW-4_product-keys-ATT-US_ATT-signed.sbf, and noticed a size difference. If I go this route, should I try this one? Or fixed_bravo_sbf.sbf again? Thanks again for the input.

The umount command is just for safety . Here's the output from a working /data from CM10
Code:
[email protected]:/system/bin # e2fsck -fv /dev/block/mmcblk1p25
e2fsck 1.41.11 (14-Mar-2010)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
662 inodes used (0.80%)
50 non-contiguous files (7.6%)
1 non-contiguous directory (0.2%)
# of inodes with ind/dind/tind blocks: 83/4/0
32693 blocks used (9.91%)
0 bad blocks
1 large file
329 regular files
320 directories
0 character device files
0 block device files
1 fifo
0 links
1 symbolic link (1 fast symbolic link)
2 sockets
--------
653 files
There is a major difference between the full and fixed sbf. The fixed sbf only contains the bootloader and devtree (maybe ramdisk as well). The full sbf contains the full stock system. The fixed is mainly for those that accidentally flash a Defy boot.img or devtree.img when flashing or porting Defy roms.
While it sucks, it sounds like you just need to flash the full sbf and start over from scratch. I usually flash the sbf once every other month even if nothing is wrong (just makes me feel better).
From what you said above, /data was probably corrupted when you flashed CM10 without wiping data. Unless I'm flashing the same rom over and over again (when testing ports out, etc) I always do a factory reset when flashing. Its the safest way to go and you'll get better support from devs when you flash onto a blank slate (easier to debug since /data not being wiped is usually the cause of random bugs). It may have been from installing BandroidX Recovery since it uses the stock init scripts. Never install BandroidX Recovery. It is very obsolete and only useful if you plan on using BravoX, and even then you can use Defy 2nd-init recovery (just set it to boot to stock). More than likely it was from the non-wiped flash.

Flashing original .sbf worked! :victory:
Rooted, installed 2ndInitDefy, and backed up everything from there to sdcard.
/data now mounts correctly, and userdata persistence in CM10 is functional. :highfive:
Learn something new every day.

t1nk_2 said:
Flashing original .sbf worked! :victory:
Rooted, installed 2ndInitDefy, and backed up everything from there to sdcard.
/data now mounts correctly, and userdata persistence in CM10 is functional. :highfive:
Learn something new every day.
Click to expand...
Click to collapse
Glad to here you're not screwed :victory:. The best thing about the Bravo is you can fix it just like you do Windows -- if it breaks, just reinstall -- if you can't reinstall then its time for an upgrade cause ya broke it .

Related

cannot mount \cache

Hey all.
Firstly please forgive me it this seems pretty basic however i seem to have lost the ability to mount the cache partition on my JF1.5 Dev Phone.
The upgrade process went fine, had been using it for a week, then i installed an animated splash screen made for non-cupcake builds and it bricked my phone. i got the black screen of wait in place of an animated load screen. luckily, anticipating such problems, i had just done a full nandroid backup.
now here's the problem. while backing up from nandroid, i was informed that the cache partition does not exist.
looking in the filesystem, there is a /cache folder but nothing in it and i have lost the ability to install apps via the market.
running mount shows:
rootfs on / type rootfs (ro)
tmpfs on /dev type tmpfs (rw,mode=755)
devpts on /dev/pts type devpts (rw,mode=600)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
tmpfs on /sqlite_stmt_journals type tmpfs (rw,size=4096k)
/dev/block/mtdblock3 on /system type yaffs2 (ro)
/dev/block/loop0 on /system/modules type cramfs (ro)
/dev/block/loop1 on /system/xbin type cramfs (ro)
/dev/block/mtdblock5 on /data type yaffs2 (rw,nosuid,nodev)
/dev/block/mmcblk0p2 on /system/sd type ext2 (rw,errors=continue)
/dev/block//vold/179:1 on /sdcard type vfat (rw,dirsync,nosuid,nodev,noexec,uid=
1000,gid=1000,fmask=0711,dmask=0700,allow_utime=0022,codepage=cp437,iocharset=is
o8859-1,shortname=mixed,utf8)
and the partitions table shows:
major minor #blocks name
7 0 204 loop0
7 1 1936 loop1
31 0 256 mtdblock0
31 1 5120 mtdblock1
31 2 2560 mtdblock2
31 3 69120 mtdblock3
31 4 69120 mtdblock4
31 5 76544 mtdblock5
179 0 3872256 mmcblk0
179 1 3349521 mmcblk0p1
179 2 522112 mmcblk0p2
please help, i have tried mounting it manually to mtdblock4 with the command:
# mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /cache
mount: mounting /dev/block/mtdblock4 on /cache failed: Invalid argument
If any more information than this is needed i can supply logcat file etc...
twoolie said:
Hey all.
...
please help, i have tried mounting it manually to mtdblock4 with the command:
# mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /cache
mount: mounting /dev/block/mtdblock4 on /cache failed: Invalid argument
Click to expand...
Click to collapse
wouldn't the command be:
mount -o rw,remount -t yaffs2 /dev/block/mtdblock4 /cache
??
but I fail to see why you are doing this, care to explain so i can understand?
ok maybe i should explain better. there are 3 major blocks set aside for the use of the filesystem. mtdblock3 is set aside for the /system partition, mtdblock4 is set aside for /cache and mtdblock5 is set aside for /data. cache is important because it caches objects for the dalvic VM, web pages for the browser and most importantly, it stores apks from the market while downloading. now the first two are not so bad because the dalvic vm will run, just a little slower and the browser will browse, ablight will not be able to cache pages and will only have access to what is in ram. but because the market will wait to be able to place a file in /cache before downloading it, this effectively means i will never be able to download/install from the market.
Now what happened was when i created my nandroid backup it backed up system.img, cache.img and data.img
i then bricked the system and wanted to restore from nandroid backups. first i put back the system, then data but the phone wouldnt accept a cache image. fastboot is unable to mount it, jf recovery is unable to mount it, and the android OS is unable to mount it.
also i tried your suggestion but mount -o rw,remount -t yaffs2 /dev/block/mtdblock4 /cache returns the same error message:
mount: mounting /dev/block/mtdblock4 on /cache failed: Invalid argument
also, mount -a returns:
mount: mounting /dev/block/mtdblock4 on /cache failed: Invalid argument
mount: mounting /system/modules/modules.cramfs on /system/modules failed: No such file or directory
mount: mounting /system/xbin/xbin.cramfs on /system/xbin failed: No such file or directory
i'm hoping that this means something to somebody. does this just mean i am missing cramfs modules i need?
any help would be GREATLY appreciated.
It would be a roundabout way, but DREAIMG.NBH will restore partitions. Of course you'd have to then do the rooting process all over again.
Wait... but to do nandroid, don't you want to just restore
system.img
data.img
boot.img
so the commands would be
fastboot flash system system.img
fastboot flash userdata data.img
fastboot flash boot boot.img
I guess I'm failing to see why cache needs to be restored. won't the OS just clear it out an write over it eventually anyways?
Or am I missing something?

[Q] Anyone use AdFree on CM7?

Got AdFree installed, but it says it can't find space to write the hosts file.
Using CM7 final on SD card installed with verygreen's method.
Same here
Sent from my PC36100 using XDA App
danbutter said:
Using CM7 final on SD card installed
Click to expand...
Click to collapse
There's your problem.
AdFree probably freaks out when it sees how you have Android setup on your sd card.
It runs flawlessly for me with CM7 emmc.
Paul22000 said:
There's your problem.
AdFree probably freaks out when it sees how you have Android setup on your sd card.
It runs flawlessly for me with CM7 emmc.
Click to expand...
Click to collapse
+1
Agreed, works perfect on emmc
Works fine on my uSD. It just copy the host file to /system/etc/ so running on SD or emmc makes no different.
Confirmed Functional
I used adfree on nightlies in the SD card...decided to install final release on emmc and also didn't have problems.
I'm running CM7 off SD card. Adfree can't find the right mount point to remount.
1) I pulled the Adfree hosts file off another Android device (I attached it in a zip).
2) I then made the NC system partition writeable by using 'adb remount'
3) I pushed the hosts file to the NC: 'adb push hosts /system/etc/hosts'
if step 2) doesn't work, here are manual instructions. You need adb or terminal emulator with root permissions (hence the # that precedes each command):
# alias mount="busybox mount"
# mount
rootfs on / type rootfs (ro)
tmpfs on /dev type tmpfs (rw,mode=755)
devpts on /dev/pts type devpts (rw,mode=600)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
tmpfs on /mnt/asec type tmpfs (rw,mode=755,gid=1000)
tmpfs on /mnt/obb type tmpfs (rw,mode=755,gid=1000)
/dev/block/mmcblk0p2 on /rom type vfat (rw,noatime,nodiratime,uid=1000,gid=1000,fmask=0117,dmask=0007,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,errors=remount-ro)
/dev/block/mmcblk1p2 on /system type ext4 (ro,barrier=1,data=ordered)
/dev/block/mmcblk1p3 on /data type ext4 (rw,nosuid,nodev,noatime,barrier=1,data=ordered)
/dev/block/mmcblk0p7 on /cache type ext4 (rw,nosuid,nodev,noatime,barrier=1,data=ordered)
/sys/kernel/debug on /sys/kernel/debug type debugfs (rw)
/dev/block/vold/179:20 on /mnt/sdcard type 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)
/dev/block/vold/179:20 on /mnt/secure/asec type 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)
tmpfs on /mnt/sdcard/.android_secure type tmpfs (ro,size=0k,mode=000)
/dev/block/vold/179:8 on /mnt/emmc type 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)
/dev/block/dm-0 on /mnt/asec/dk.logisoft.aircontrol-1 type vfat (ro,dirsync,nosuid,nodev,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)​
The red line is the one we care about. DO NOT PROCEED IF YOURS IS DIFFERENT.
To make it read-write:
# mount -o rw,remount -t ext4 /dev/block/mmcblk1p2 /system
To make it read-only:
# mount -o ro,remount -t ext4 /dev/block/mmcblk1p2 /system
joobu said:
I'm running CM7 off SD card. Adfree can't find the right mount point to remount.
1) I pulled the Adfree hosts file off another Android device (I attached it in a zip).
2) I then made the NC system partition writeable by using 'adb remount'
3) I pushed the hosts file to the NC: 'adb push hosts /system/etc/hosts'
Click to expand...
Click to collapse
Yep, this should work... I still see ads all over though. Same places I don't see them on my Nexus One.
Did this actually work for you? Although really I can't imagine why it wouldn't.
I replaced my hosts file the harder manual way.
Maybe check to see if the hosts file was actually replaced. The hosts file should be around 700 kB
I'm encountering a problem with adfree and the nook color running cm7. I see others have it installed and running fine. First time using this app.
I have downloaded adfree and when i try and download and install hosts by clicking the button it gives me an error stating" unable to locate a partition to remount to write the host files to"
Anybody know whats wrong and how to solve?
Look at my post with the manual instructions.
don't need to, its on my evo that I tether from and I see no ads on the nook or my pc
Fix Permisions
I ran "Fix Permissions" from TWRP touch recovery and that did the trick for me.

How to Run(Chroot) Linux(Ubuntu/Debian,etc.) in your Milestone 2

Chrooting Linux on Android is a very popular topic, and you can find many tutorials online. I am not going to post a detailed how to here.. but, I will explain the generalized steps for the process! If anyone have any questions or need help, feel free to ask!
Get Root Access on your phone
There are many ways to get root access; Easiest will be using z4root or SuperOneClick ! Rooting is mandatory because: You need to install Busybox; Need to mount file system, etc..​
Install SuperUser App from the Market
This application allows you to grant Root access to other applications (when needed). Depending on how you rooted your phone, superuser.apk may be already installed on your phone.​
Install Busybox App from the Market
Depending on how you rooted your phone, Busybox may be already installed on your phone. In any case install this app from the market and update your busybox to the latest version. Busybox is a set of commonly used linux commands, which are not available in android by default. Eg: cp, chroot, etc.​
Install Connectbot from Android market
Connect bot is a terminal client application for android. There are other alternatives but, I recommend Connectbot! Also Connectbot has SSH support, so if you are installing an SSH server on your Ubuntu, you can connect to it using connectbot and you may totally skip the VNC for GUI. Anyway, note that you need a terminal app to start the chroot daemon!​
Install AndroidVNCViewer from Android market
With androidVNCViewer we can get GUI access to our ubuntu! This App works so fine in my Milestone 2 with Ubuntu; It even supports mouse pointer!​
Download/build a Linux rootfs for your flavour of linux
Now, you need the Ubuntu/Debian/Other linux file system for your Phone's processor. Like most of the Android phones, Milestone 2 uses an ARM processor. And Ubuntu offers full support for ARM processors. It is so easy to build ubuntu for ARM(OMAP) platform using rootstock/bootstrap method. I used rootstock method for Ubuntu as explained here.
PS: For your first time, make sure you build, "Ubuntu Lucid" (just use the --seed/-s parameter of rootstock command. I was not able to use 11.04(Natty). Once you get Lucid to work, you can surely try yourself for the other versions! )​
Create a mountable .img file with a size suited for you
From rootstock, you will get a .tgz file! You will need to convert this to a mountable .img file.
In order to create an empty ubuntu.img file, use the followed command in your ubuntu-desktop's terminal; the last arguement (2048) specifies size of the Ubuntu rootfs (If you need much disk space when you are in ubuntu, use a large value here. Normally 2GB will be sufficient for you; even with GUI/VNC).
Code:
dd if=/dev/zero of=ubuntu.img bs=1MB count=0 seek=2048
Next, format our empty ubuntu.img with a suitable ext2/ext3/ext4 file system!
For Milestone 2, you should use ext3 (I think it does not support ext2). ext4 is supported only in Gingerbird+. So, you should use the appropriate command based on your mobile
Code:
mkfs.ext2 -F ubuntu.img
mkfs.ext3 -F ubuntu.img
mkfs.ext4 -F ubuntu.img
You can find out the suitable file system by opening Connectbot in your mobile and entering the followed command. In the output, look for words ext2/ext3/ext4!
Code:
su
mount
Once you format ubuntu.img with appropriate file system. We should temporarily mount the ubuntu.img in a somewhere and we should extract the armel-rootfs-xx.tgz to it. You can use these commands
Code:
sudo mount -o loop ubuntu.img /mnt
sudo tar -C /mnt -zxf armel-rootfs--xx.tgz
sudo umount /mnt
Download(and modify) or create a Shell script for automatically mounting your Chroot image
This is the most important part, we have to run a set of commands in our android shell to get into the ubuntu. To make things easier, we will write these command-sequence in a shell script, and whenever we need we simple call this script. Cool isn't it?. Basically this is what this script should do:
Code:
1. Check if there exists an ubuntu.img file as we specify in command line
2. Create a loop device with the ubuntu.img - ie. Make android(linux) believe that ubuntu.img is a mountable device.
3. Mount the newly created loop device to a folder. My script mounts the image to /data/local/chrootos
4. Set some environment variables in the shell
5. Mount the [I]devpts, proc, sysfs[/I] for the ubuntu!
6. Run the Chroot command. This command actually changes the root of file system to a new directory we specify. ie. we fake [B]/data/local/chrootos[/B] as the rootfs![B]/[/B]
Create a folder in your Phone's SD Card and copy one or more(If you want to choose between: Debian/Ubuntu/Puppy/etc) .img files and your shell script for booting linux into it.
Create a folder named .chroot in your SD Card. If you have a "." as the first character, this folder will be hidden in the Android File Browser. And will avoid you accidentally modifying these files.​
Get into your Phone's Shell through ConnectBot / USB-ADB / Terminal Emulator
Enter su in the terminal to get root access
Remount your Android filesystem to get write access to your phones
By default, the android file system is read only. So in order to write to the files sytem, we have to remount it with the following command.
Code:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
Copy your bootscript to /system/bin so that you can easily start your LinuxIf you have downloaded my bootscript, the file name will be bl - short for boot linux. So, once you copied you will have your shell script at /system/bin/bl. Once we copy the shell script to the bin directory, it will work as a shell command.​
Start your linux and customize it
If you have done everything correctly so far, you can now boot into your ubuntu.img with the following command. Note that you do not need to specify the full file name "ubuntu.img".
Code:
bl ubuntu
Start your linux and customize it
If Chroot was a success, you will see the ubuntu shell prompt. And then you can start installing more stuff, etc. [email protected]:​
Downloads & Screenshots
Screenshots: http://goo.gl/PzVI0
My Shell Script for starting linux: http://goo.gl/il3nJ
My ubuntu.img: Coming Soon​Password
Code:
arunraj.in
Common Errors
The most common error will be when we are dealing with the "loop device". Because, according to the apps installed in your device, there may not be a free loop device available. If you are facing errors, feel free to ask me and I will try and help!​
Thanks, man! When I have time I'm gonna try it out.
Sent from my Milestone 2 XDA App
thanks for tutorial. will try this soon
Script didn't work :/
Gongui20 said:
Script didn't work :/
Click to expand...
Click to collapse
Do you get any error message?
Thanks !
It's very interesting.I will try it when I have some free time.
echo "Linux Chrooter: Chroot!"
chroot $mnt /bin/bash
Click to expand...
Click to collapse
/bin/bash didnt exist or something like that.
Gongui20 said:
/bin/bash didnt exist or something like that.
Click to expand...
Click to collapse
I think there was no free loop device available for mounting the image.
could run these commands as root and send me the output(the txt files created)?
Code:
mount > mount-list.txt
losetup -f > losetup1.txt
losetup /dev/block/loop1 /sdcard/.chroot/ubuntu.img > losetup2.txt
losetup1.txt
/dev/loop0
Click to expand...
Click to collapse
mount-list.txt
rootfs / rootfs ro,relatime 0 0
tmpfs /dev tmpfs rw,relatime,mode=755 0 0
devpts /dev/pts devpts rw,relatime,mode=600 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
none /acct cgroup rw,relatime,cpuacct 0 0
tmpfs /mnt/asec tmpfs rw,relatime,mode=755,gid=1000 0 0
none /dev/cpuctl cgroup rw,relatime,cpu 0 0
/dev/block/mmcblk1p21 /system ext3 ro,noatime,nodiratime,barrier=1,data=ordered 0 0
/dev/block/userdata /data ext3 rw,nosuid,nodev,noatime,nodiratime,errors=continue,barrier=1,data=ordered 0 0
/dev/block/cache /cache ext3 rw,nosuid,nodev,noatime,nodiratime,errors=continue,barrier=1,data=ordered 0 0
tmpfs /tmp tmpfs rw,relatime,size=2048k 0 0
/dev/block/pds /pds ext3 rw,nosuid,nodev,noatime,nodiratime,barrier=1,data=ordered 0 0
/dev/block/preinstall /preinstall ext3 rw,nosuid,nodev,noatime,nodiratime,barrier=1,data=ordered 0 0
/dev/block/vold/179:1 /mnt/sdcard vfat rw,dirsync,nosuid,nodev,noexec,relatime,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:1 /mnt/secure/asec vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
tmpfs /mnt/sdcard/.android_secure tmpfs ro,relatime,size=0k,mode=000 0 0
/dev/block/dm-0 /mnt/asec/com.rovio.angrybirdsrio-1 vfat ro,dirsync,nosuid,nodev,noexec,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block/dm-1 /mnt/asec/com.rovio.angrybirds-1 vfat ro,dirsync,nosuid,nodev,noexec,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block/dm-2 /mnt/asec/org.xbmc.android.remote-2 vfat ro,dirsync,nosuid,nodev,noexec,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
Click to expand...
Click to collapse
losetup2.txt is empty.
Yeap, I faced the same error when I was doing it. If you notice the mount-list.txt, you can see that AngryBirds application is using /dev/block/dm-0 and /dev/block/dm-1. /dev/block/dm-2 is also in use.
You could try this:
Edit the script bl and replace /dev/block/loop1 in the script with /dev/block/dm-3. It might just do the trick.
Hey check this out:
http://androlinux.com/android-ubuntu-development/how-to-install-ubuntu-on-android/
Works on Asus TF101
Hi
Thanks for the guide. I got it running on my Asus TF101. I had to modify your script slightly :
The /system filesystem is mounted as ext4 (not yaffs)
The /system fs is mounted from /dev/block/mmcblk0p1
/dev/block/mmcblk0p1 /system ext4 rw,relatime,barrier=1,data=ordered 0 0
Click to expand...
Click to collapse
Apart from that no other changes were necessary.
Need Help!!!!
hi ~ I just put the img file in /sdcard/.chroot/.linux/ ,named ubuntu.img and edited the Script
but when I run the script ,there is a problem in line:
mount -t ext3 /dev/block/loop1 $mnt
it said:
Device or resourc busy
I have tried thousand ways and cost 5 days,but I can't solve it.....
can you help me?
sorry for my poor english...
losetup1.txt
/dev/loop0
I also replace /dev/block/loop1 in the script with /dev/block/dm-5,but I need use command :"mknod /dev/block/dm-5 b 7 0" first.
the error Screenshots and mount
echoeye said:
the error Screenshots and mount
Click to expand...
Click to collapse
Hi,
Which is your Mobile ?
Also -- Did you see reply #7, #8 on page 1 of this thread ?
There is another way to mount it without using the option -oloop
If you look into /dev/block you are going to find 8 loop devices, from loop0 to loop7. As android doesn't use that many loop devices it should be enough. You can mount it like this:
Code:
losetup /dev/block/loop7 /sdcard/ubuntu/ubuntu.img
mount -t ext3 /dev/block/loop7 /mnt/ubuntu
If your phone doesn't have a free loop device, you can create a new one, like this:
Code:
mknod /dev/block/loop99 b 7 99
losetup /dev/block/loop99 /sdcard/ubuntu/ubuntu.img
mount -t ext3 /dev/block/loop99 /mnt/ubuntu
The problem is you have apps installed to the sd card (and getting mount points busy), when it happens here I just open Titanium Backup and move External apps to internal.
No matter what I tried here, this script wouldn't work... So I used DebOnDroid app from defy forum, and when updated to GB. The app stopped working also, so I moved the ubuntu.img to /data/local/ and mounted from there, works like a charm!
This is the script I'm using /system/bin/buntu:
Code:
export mnt=/data/local/debian
export PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin
export TERM=linux
export HOME=/root
export USER=root
echo "Linux Chrooter: Setup Networking"
sysctl -w net.ipv4.ip_forward=1
#necessary mount points
busybox mount -o loop $mnt/../debian.img $mnt
busybox mount -t devpts devpts $mnt/dev/pts
busybox mount -t sysfs sysfs $mnt/sys
busybox mount -t proc proc $mnt/proc
#extra mount points
busybox mount -o rw /system $mnt/mnt/s
busybox mount /data $mnt/mnt/d
busybox mount /sdcard $mnt/mnt/sd
echo "Linux Chrooter: Chroot!"
chroot $mnt /bin/bash
umount $mnt/sys
umount $mnt/proc
umount $mnt/dev/pts
umount $mnt/mnt/*
#somehow the commented lines didn't work...
#umount $mnt/mnt/d
#umount $mnt/mnt/s
umount $mnt
PS: when I copy a binary from ubuntu to /system/bin and chmod, it won't exec, why?
Sent from my Milestone 2 XDA App
r2beta0 said:
There is another way to mount it without using the option -oloop
If you look into /dev/block you are going to find 8 loop devices, from loop0 to loop7. As android doesn't use that many loop devices it should be enough. You can mount it like this:
Code:
losetup /dev/block/loop7 /sdcard/ubuntu/ubuntu.img
mount -t ext3 /dev/block/loop7 /mnt/ubuntu
If your phone doesn't have a free loop device, you can create a new one, like this:
Code:
mknod /dev/block/loop99 b 7 99
losetup /dev/block/loop99 /sdcard/ubuntu/ubuntu.img
mount -t ext3 /dev/block/loop99 /mnt/ubuntu
Click to expand...
Click to collapse
thank you very very very very very very very very very very very very very very very much!!!!
I made it!!!
oh yeah!~~~~
How is this different from using an app like linuxinstaller? Well, apart from doing it manually and the nerdy way of course?
Is it safer? I am intrigued by the possibility of having a working ubuntu in my pocket, but am wondering if I should go this way or try the app.
great guide though... i think this is the push i needed to finally try this.
Nice job! but i got this..
Nice job!
I got this
#bl ubuntu
bl: permission denied
#
;/

[Q] /system ext3 strangely formated

Hi,
I've been struggling for days installing any custom rom into my defy.
When I finally checked the log, I saw it interrupted with "no space left on device" about halfway through.
But there still is space, only 32% are in use (~100MB of~ 300MB).
/system just ran out of inodes.
Finally I succeeded after I removed most of the terminals in /etc/terminfo/* from the latest nightly before installing it. (CM10, 20130110, that is)
df -i /system
Filesystem Inodes Used Available Use% Mounted on
/dev/block/mmcblk1p21 1968 1915 53 97% /system
I don't understand, how come /system only has ~2000 inodes (typical should be ~10k)?
(I'm not the first owner, so I don't know what happened to the device before...I got it with some Vodafone branded firmware on it, but you never know..)
I'm afraid of simply formatting it, because bootmenu and recovery seem to be running from /system, and formatting might render the device nonfunctional.
How do I get back to a proper fs?
Is there a way to safely format /system?
Or should I better tune2fs?
Anyone seen this before?
Thanks,
mcr42
Ran out of inodes! ("No space left on device")
I seem to have the same problem. A few days after doing a fresh install of CyanogenMod7.2 + Googleapps, I start to get Gapps and other processes crashing all the time. Looking in the logfiles using "adb logcat -d" even immediately after bootup, it reports:
W/BatteryStats( 2274): Error writing battery statistics
W/BatteryStats( 2274): java.io.FileNotFoundException: /data/system/batterystats.bin.tmp (No space left on device)
and indeed I have lots of space, but no inodes left at all:
df -k .
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/block/mmcblk1p25
130837 97898 32939 75% /data
df -i .
Filesystem Inodes Used Available Use% Mounted on
/dev/block/mmcblk1p25
1296 1296 0 100% /data
Can anyone suggest what's going on and how to fix it?
Thanks,
Richard
P.S. As a bit of background, I wonder if things have got messed up on an earlier install when a while back after using S2E to move most things to an ext4 partition on the SD card, I later used S2E to revert the system to normal, but it crashed half-way through the process. I believe that is sorted now as "mount" doesn't report looking for anything on sd-ext partition (which I have removed since anyway):
rootfs on / type rootfs (ro,relatime)
tmpfs on /dev type tmpfs (rw,relatime,mode=755)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
/dev/block/mmcblk1p21 on /system type ext3 (ro,relatime,barrier=1,data=ordered)
tmpfs on /dev type tmpfs (rw,relatime,mode=755)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
none on /acct type cgroup (rw,relatime,cpuacct)
tmpfs on /mnt/asec type tmpfs (rw,relatime,mode=755,gid=1000)
tmpfs on /mnt/obb type tmpfs (rw,relatime,mode=755,gid=1000)
none on /dev/cpuctl type cgroup (rw,relatime,cpu)
/dev/block/mmcblk1p24 on /cache type ext3 (rw,nosuid,nodev,noatime,nodiratime,errors=continue,data=ordered)
/dev/block/mmcblk1p25 on /data type ext3 (rw,nosuid,nodev,noatime,nodiratime,data=ordered)
/dev/block/loop7 on /pds type ext3 (rw,nosuid,nodev,noatime,nodiratime,barrier=1,data=ordered)
ramfs on /tmp type ramfs (rw,relatime,relatime)
/dev/block/vold/179:1 on /mnt/sdcard type vfat (rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0602,dmask=0602,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
/dev/block/vold/179:1 on /mnt/secure/asec type vfat (rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0602,dmask=0602,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
tmpfs on /mnt/sdcard/.android_secure type tmpfs (ro,relatime,size=0k,mode=000)
CM10 latest nightly is the unofficial late august build by sunnyqeen. If you have custom recovery, flash AROMA wiper (search) and fully wipe system, data and cache in ext4 and then immediately flash ROM and gapps.
Is there a way to increase the number of inodes on /data?
Following up my email, I've been looking through the full list of files on /data (the number closley tallies with the 1296 inodes available). There were quite a few (but not excessive number) of debug files in /data/system/dropbox which I've deleted to free up a few inodes. However 1296 inodes doesn't seem sufficient. Does this tally with what most people have on their Defy phones? Grateful if someone could connect to their phone and run the following:
adb shell df -i /data
I have seen there have been reports of ClockworkMod Recovery prior to version 6 corrupting inodes:
http://forum.xda-developers.com/showthread.php?t=2111734
Grasping at straws, could this be what is happening resulting in a loss of inodes?
(Rebooting to (Cyanmod) recovery mode on my phone reports "Bootmenu Recovery v5.0.6" - does that tie in with CWM v5 then?)
Richard

A300FU E:failed to mount /efs (Invalid argument)

A few days ago I was having some problems with my phone and lineage 14.1 so I decided to reflash the ROM, only to notice it wouldn't boot. I then decided to install the stock 6.0.1 firmware through odin, but when I rebooted the device, it just stayed on the samsung galaxy a3 screen. I managed to boot the device with a 4 part 5.0.2 polish firmware, which is bloated and doesn't remember wifi passwords, so I decided to try to reinstall the 6.0.1 firmware, thinking I had fixed my phone. I just ran into the same problem as the first time.
This time I noticed that when I booted into recovery, there was an error mounting /efs ("E:failed to mount /efs (invalid argument)"). Going through the internet I found many ways to fix the problem but none worked for me. The one I saw most people had success with was one that involved using some commands in adb, which failed for me.
The commands where:
adb shell
su
mke2fs /dev/block/mmcblk0p1
mount -w -t ext4 /dev/block/mmcblk0p1
reboot
all the commands up to "mount -w -t ext4 /dev/block/mmcblk0p1" worked fine, but this one got the error: can't find /dev/block/mmcblk0p1 in /etc/fstab
Does anyone have any idea how I can fully fix the device and mount /efs to be able to install a fully working firmware?
btw, I was using this tutorial:
http://www.selftechgenius.com/how-t...nvalid-argument-in-all-samsung-galaxy-phones/
and at the end it says that if you're not sure which particular mmcblk0p* EFS mount point to use, you should use the command mount to see which one is he EFS mount point, but I can't seem to find which one to use after using 'mount'.
The mount commant prints:
~ # mount
rootfs on / type rootfs (rw)
tmpfs on /dev type tmpfs (rw,seclabel,nosuid,relatime,size=700004k,nr_inodes=153395,mode=755)
devpts on /dev/pts type devpts (rw,seclabel,relatime,mode=600)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,seclabel,relatime)
selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,seclabel,relatime,size=700004k,nr_inodes=153395)
adb on /dev/usb-ffs/adb type functionfs (rw,relatime)
/dev/block/mmcblk0p24 on /system type ext4 (rw,seclabel,relatime,data=ordered)
/dev/block/mmcblk0p27 on /data type ext4 (rw,seclabel,relatime,data=ordered)
/dev/block/mmcblk0p27 on /sdcard type ext4 (rw,seclabel,relatime,data=ordered)
/dev/block/mmcblk1p1 on /external_sd type ext4 (rw,seclabel,relatime)
How am I supposed to know which one to use?
You can't just use any old block device, it needs to be the specific one the EFS partition mounts to, which you would find with the command below.
ls -laR /dev/block
However I would think your problem is that you just need to install the stock firmware then format(Factory Reset) the /data partition.
ashyx said:
You can't just use any old block device, it needs to be the specific one the EFS partition mounts to, which you would find with the command below.
ls -laR /dev/block
However I would think your problem is that you just need to install the stock firmware then format(Factory Reset) the /data partition.
Click to expand...
Click to collapse
Is there a specific reason why the repair firmware works but other stock firmware or rom flashed after that don't. Shouldn't the repair firmware fix the problem?
I think I already tried formating the data partition after flashing a stock firmware, but I'll give it another try in a few days as I have a lot of stuff to do right now.
If this method doesn't work, using the same commands I stated previously on the block I get from -laR /dev/block should work right?
Sorry, I don't know that much about partitions, blocks and all that deep and advanced android stuff, I had never run into a problem like this when flashing roms and kernels previously, I don't even know what caused tha problem on the first place...
Thanks for helping!
ashyx said:
You can't just use any old block device, it needs to be the specific one the EFS partition mounts to, which you would find with the command below.
ls -laR /dev/block
However I would think your problem is that you just need to install the stock firmware then format(Factory Reset) the /data partition.
Click to expand...
Click to collapse
I found the block for the efs partition (/dev/block/mmcblk0p13) with your command, but when running the previous commands on it, I still get the "mount: can't find /dev/block/mmcblk0p13"
I already factory data reset my phone a couple of times after the problem occured the first time, and it didn't do anything. Any other ideas why something like this would happen?
EDIT: When I rebooted my phone I noticed my wifi was working (before this, all my wifi passwords would get erased on reboot) and when I checked the /efs folder on root explorer I noticed it was full, not like before. Seeing this I decided to try and install the stock firmware again and it worked!
Thank you so much for your help, looks like I just had to find the right block all along...
Result

Categories

Resources