[Q] cp: write error: No space left on device

mclifford

Member
Mar 7, 2011
8
0
0
I am trying to re-root after the 2.3.6 update, I did not remove root before the OTA update.

I made sure USB connection was set to none, and USB debugging was on. I see that is saying that I am out of space, problem is I don't know how I could possibly be able to be out of space, I have plenty of room on both the internal and external cards. Below is the output with the error. Any help would be appreciated. Thanks.

C:\moto-fastboot-win32>moto-fastboot.exe flash preinstall preinstall.img
sending 'preinstall' (30720 KB)... OKAY [ 2.682s]
writing 'preinstall'... OKAY [ 3.447s]

C:\moto-fastboot-win32>moto-fastboot.exe reboot
rebooting...

C:\moto-fastboot-win32>adb shell
$ /preinstall/dosu
/preinstall/dosu
bash: groups: command not found
[email protected]:/# /bin/mount -o remount,rw /system
/bin/mount -o remount,rw /system
[email protected]:/# cp /preinstall/su /system/bin/
cp /preinstall/su /system/bin/
cp: write error: No space left on device
[email protected]:/#
 

avelezmtz

New member
Feb 27, 2012
3
1
0
Hi there... I had the same issue when I installed the 2.3.6 ATT OTA update when I lost root... I tried RootKeeper application but it didn't work after the OTA installation. I looked for information about this error but didn't find much or complex solutions as to free space from that system dir... so then I thought about if the copy command would have an overwrite option and it did, so I tried it and it worked for me.... I'm rooted again!
I see this is an old post but in case you still need it, it may help you too. I used line bleow to overwrite and the rest you know it.
cp -f /preinstall/su /system/bin/su
 

avelezmtz

New member
Feb 27, 2012
3
1
0
by the way, I got an error in the line "PATH=/system/bin:$PATH pm install /preinstall/Superuser.apk" telling me that the application or file already existed as I already had superuser installed... I guess it should work without re-installing it, in my case the reinstallation was to a different superuser version... anyway if you want to skip that error and proceed with the re-installation you can use option -r as shown in line below.

PATH=/system/bin:$PATH pm install -r /preinstall/Superuser.apk

cheers!
 

mclifford

Member
Mar 7, 2011
8
0
0
avelezmtz,

Thanks for the idea, but it did not work for me, I still got the no space left error. Do you know if there a way to delete the SU file and then try to copy it? Thanks
 

mclifford

Member
Mar 7, 2011
8
0
0
I tried the, PATH=/system/bin:$PATH pm install -r /preinstall/Superuser.apk, command and it was able to reinstall the apk which it never has before so that's good, but it's still not rooted.

If anyone else has any ideas let me know. I am thinking about backing everything up and doing a factory reset and seeing how that goes.
 

avelezmtz

New member
Feb 27, 2012
3
1
0
First... as suggestion, if you will be playing deleting files, ensure you have clockworkmod backup or anyother way to restore a previous backup just to be safe.

I think rm command should delete su, but I'm not sure if it would help since the error is not a permissions error, so the ovewrite option should work if the space in the system dir is enough... if you still wanna try the removal of su I think line below will do it.

rm /system/bin/su

Another option I saw somewhere it was about freeing up space by deleting apk files from /system/app dir which is mounted in the same volume, however it would depend on how big those files are. Of course you should back them up first maybe copying them to /sdcard/ for instance. In the post I saw that they removed swype.apk and that was enough for them but in my case it didn't help and as the ovewrite worked I didn't try removing more apps.

If you want to know the space on that dir you can use

df /system/bin/
 
  • Like
Reactions: mclifford

mclifford

Member
Mar 7, 2011
8
0
0
avelezmtz,

Thanks for all the help, I am now rooted again!!

Using your suggestion I deleted Superuser.apk and Swype.apk from the /system/app directory.

After that I was able to rerun all the commands and get root back. Thanks for all the help, I appreciate it. Sure beats wiping the phone and starting all over again.
 

imroz_7

New member
Jun 8, 2016
1
0
0
I have a problem with my Yu Yureka which running on CM 12.1 and Rooted (su) twrp

1. When I was trying to to flash any zip file like CameraNext Mod, it was flash successfully. After reboot the system, I can't find the CameraNext Mod, it was not in menu.

2. Sometime when i tried to flash other zip file like xposed framework, it was not completely installed. there was error and the error message was " cp:write error: no space left on device"

plz help me with right direction..