Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,779,457 Members 51,699 Now Online
XDA Developers Android and Mobile Development Forum

Link2SD says Remove Link Failure

Tip us?
 
beani45
Old
#1  
Junior Member - OP
Thanks Meter 0
Posts: 1
Join Date: Mar 2011
Default Link2SD says Remove Link Failure

When I try to remove a link in Link2SD I will have the message

Remove link failure
rm failed for /data/sdext2..... Read-only file system


All files I can se have RW. Can it be a problem with the SD-card?

Is is not possible to make any new links either.

 
MongooseHelix
Old
#2  
MongooseHelix's Avatar
Senior Member
Thanks Meter 453
Posts: 711
Join Date: Aug 2010
Location: Portland, OR, USA
Quote:
Originally Posted by beani45 View Post
When I try to remove a link in Link2SD I will have the message

Remove link failure
rm failed for /data/sdext2..... Read-only file system


All files I can se have RW. Can it be a problem with the SD-card?

Is is not possible to make any new links either.
It sounds like the partition got mounted to /data/sdext2 as read-only somehow. It doesn't matter what the actual file permissions are if the partition is not mounted as read/write. Try one of the following commands to see how it is mounted:
Code:
#If using a terminal emulator on your phone
mount

#If using adb on your computer
adb shell mount

#Here's the output I get:
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/mtdblock3 on /system type yaffs2 (ro)
/dev/block/mtdblock5 on /data type yaffs2 (rw,nosuid,nodev)
/dev/block/mtdblock4 on /cache type yaffs2 (rw,nosuid,nodev)
/dev/block/mmcblk0p2 on /sd-ext type ext2 (rw,noatime,nodiratime,errors=continue)
/dev/block/mtdblock4 on /data/dalvik-cache type yaffs2 (rw,nosuid,nodev)
/dev/block/mmcblk0p2 on /data/sdext2 type ext2 (rw,noatime,nodiratime,errors=continue)
/dev/block/vold/179:4 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:4 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)
If yours says "ro" instead of "rw", you might have to modify the link2sd mounting script in /etc/init.d/

I would also suggest posting this in the Link2SD thread so more people, including the dev, can help you figure it out.
Twitter: @MongooseHelix
* * * * * * * * * * * * * * * *

Devices: Eris, Inc, Tbolt, Gnex
Source: GitHub
Change Review: Gerrit
 
Bling_Diggity
Old
#3  
Bling_Diggity's Avatar
Senior Member
Thanks Meter 92
Posts: 228
Join Date: Apr 2011
Location: Pensacola, FL

 
DONATE TO ME
I too am having a similar problem, except when trying to create a link. The message i get is:

"Create Link Failure

: cannot create /data/sdext2/sampleapp.apk: read-only file system"

I checked to see if my sdext2 partition is RO - and it is. How do I fix this? I found the link2sd mounting script in the init.d directory, but I have no clue as to how to edit it in order to get things working. I checked in the link2sd thread u posted above, but found no answer to this problem after reading thru 94+ pages.

Help...please...
 
MongooseHelix
Old
#4  
MongooseHelix's Avatar
Senior Member
Thanks Meter 453
Posts: 711
Join Date: Aug 2010
Location: Portland, OR, USA
Quote:
Originally Posted by Bling_Diggity View Post
The message i get is:

"Create Link Failure

: cannot create /data/sdext2/sampleapp.apk: read-only file system"

I checked to see if my sdext2 partition is RO - and it is. How do I fix this? I found the link2sd mounting script in the init.d directory, but I have no clue as to how to edit it in order to get things working.
Please post the output from the mount command so it will help us figure out how the link2sd script needs to be modified if that is the problem. It would be good if you could attach or post the contents of the link2sd script also. The easiest way might be to just open up either a terminal emulator or use an adb shell through your computer for two commands(filling in the appropriate script name):
Code:
su
cat /etc/init.d/LINK2SD_SCRIPT_NAME
Copy that output and post it here. If you get a read-only error, look below on how to remount /system as r/w and try again.

The script's mount command might use /dev/block/mmcblk0p2 instead of /dev/block/vold/179:2 as well as -o options and/or -t type possibly being specified but it should be similar to the following:
Code:
mount /dev/block/vold/179:2 /data/sdext2
#Only guessing until I get more info but you could try one of these:
mount -o rw /dev/block/vold/179:2 /data/sdext2
mount -o rw -t TYPE /dev/block/vold/179:2 /data/sdext2
#TYPE will be the format of your 2nd partition: ext2 or ext3 or ext4 or vfat(if fat32)
To edit the link2sd script, Root Explorer would work if you have it. If so, you can navigate to /system/etc/init.d/, click on the "mount rw" button at the top right, then long click on the link2sd script, choose "open in text editor" and make your changes. Another option is using adb. You can pull a copy of the script to your computer, edit it, then push it back. From a terminal/cmd prompt on your computer with adb set up:
Code:
#pull script to your current directory
adb pull /etc/init.d/LINK2SD_SCRIPT_NAME

#now edit the script then push it back and give correct permissions
adb push ./LINK2SD_SCRIPT_NAME /etc/init.d/
adb shell
su
chown 0:2000 /etc/init.d/LINK2SD_SCRIPT_NAME
chmod 750 /etc/init.d/LINK2SD_SCRIPT_NAME
Another option would be to use a terminal emulator on your phone:
Code:
su
cp /etc/init.d/LINK2SD_SCRIPT_NAME /sdcard/

#access the sdcard using a usb cable with your computer, edit the script, and disconnect from the computer

cp /sdcard/LINK2SD_SCRIPT_NAME /etc/init.d/
chown 0:2000 /etc/init.d/LINK2SD_SCRIPT_NAME
chmod 750 /etc/init.d/LINK2SD_SCRIPT_NAME
If you get read-only errors while trying to do any of the steps, you'll need to remount the /system partition as read/write. From terminal emulator or in adb shell:
Code:
su
mount -o remount,rw /system
Twitter: @MongooseHelix
* * * * * * * * * * * * * * * *

Devices: Eris, Inc, Tbolt, Gnex
Source: GitHub
Change Review: Gerrit
 
Bling_Diggity
Old
#5  
Bling_Diggity's Avatar
Senior Member
Thanks Meter 92
Posts: 228
Join Date: Apr 2011
Location: Pensacola, FL

 
DONATE TO ME
Problem solved. Apparently something happened that caused Clockworkmod to create my partition in Read-Only mode. Couldn't figure out how to change that to R/W, so I did a complete wipe of everything (including SD card), changed over to Amon Ra, repartioned using it, reloaded everything back on to the SD card, re-flashed CM7/gapps, then booted and reinstalled L2SD. Works perfectly now. Not sure why CWM created my partition in read-only mode...but Amon Ra didn't have that issue...so I guess I'll be sticking with it from now on.
 
blkwhk
Old
#6  
Junior Member
Thanks Meter 3
Posts: 29
Join Date: Nov 2010
Location: Spacecoast
Quote:
Originally Posted by MongooseHelix View Post

The script's mount command might use /dev/block/mmcblk0p2 instead of /dev/block/vold/179:2 as well as -o options and/or -t type possibly being specified but it should be similar to the following:
Code:
mount /dev/block/vold/179:2 /data/sdext2
#Only guessing until I get more info but you could try one of these:
mount -o rw /dev/block/vold/179:2 /data/sdext2
mount -o rw -t TYPE /dev/block/vold/179:2 /data/sdext2
#TYPE will be the format of your 2nd partition: ext2 or ext3 or ext4 or vfat(if fat32)
i seem to be getting closer with this solution but in terminal emul i'm entering
#mount -o rw -t vfat /dev/block/vold/179:2 /data/sdext2
and i'm getting failed device or resource busy
doktornotor Old
#7  
Guest
Thanks Meter
Posts: n/a
Quote:
Originally Posted by blkwhk View Post
#mount -o rw -t vfat /dev/block/vold/179:2 /data/sdext2
and i'm getting failed device or resource busy
vfat? Obviously wrong, isn't it?

Getting a read-only mount probably means that the filesystem is corrupted (which would exactly match my experience regarding the partitioning/formatting capabilities of CWM... has nothing but trouble with that one).
 
blkwhk
Old
#8  
Junior Member
Thanks Meter 3
Posts: 29
Join Date: Nov 2010
Location: Spacecoast
Quote:
Originally Posted by doktornotor View Post
vfat? Obviously wrong, isn't it?

Getting a read-only mount probably means that the filesystem is corrupted (which would exactly match my experience regarding the partitioning/formatting capabilities of CWM... has nothing but trouble with that one).
vfat because i used minitools to create a 2nd fat32 partition. the ext2,3,etc didn't work for me in link2sd
doktornotor Old
#9  
Guest
Thanks Meter
Posts: n/a
Quote:
Originally Posted by blkwhk View Post
vfat because i used minitools to create a 2nd fat32 partition. the ext2,3,etc didn't work for me in link2sd
Well, FAT32 is extremely bad choice. They did not work for you pretty much for the reason stated above - you are using a broken tool to partition/format them. Forget about CWM, simply do it on PC or use AmonRA.
 
blkwhk
Old
#10  
Junior Member
Thanks Meter 3
Posts: 29
Join Date: Nov 2010
Location: Spacecoast
Quote:
Originally Posted by doktornotor View Post
Well, FAT32 is extremely bad choice. They did not work for you pretty much for the reason stated above - you are using a broken tool to partition/format them. Forget about CWM, simply do it on PC or use AmonRA.
didn't use CWM, used minitools on PC

FYI

mount -t vfat -o rw,remount /dev/block/vold/179:2 /data/sdext2

worked for me

The Following 2 Users Say Thank You to blkwhk For This Useful Post: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Android App Review: How to Speed Up Your Android Phone – XDA Developer TV

Is your Android device running slow? Is your Android device … more

Make a Pre-Rooted Stock Sony ROMs in Just Few Clicks

Many usersdon’t see any particular reason to change out the stock firmware … more

Add Timestamps to Xposed Installer Logs with… Xposed!

If talking about the most interesting projects in the last few years, we must … more

Secrecy Goes Open Source, Assures File Encryption

As some of you may remember, a while back we spoke about Secrecy, an effective file … more