Remount system after updating to current master


#1

I just pulled the current master and flashed it to the board. Afterwards, I tried to remount /system as usual:

adb root
adb remount

However, this gives me the error:
“remount of the / superblock failed: Permission denied”

When I run “mount -o rw,remount /system” from the adb shell, I get “/system not in /proc/mounts”.

As I found on Stackoverflow, I also tried

adb root
adb disable-verity
adb reboot

...
adb root
adb remount

but this gives the same result. What is going on here?


#2

I haven’t got to current master yet, but have you tried specifying the path to what you are remounting?

i.e.

mount -o remount,rw /path/to/system/partition /system

Also, what is the output of

mount

?

Anything jump out the kmsg when you get the permission denial?


#3

In kmsg, I get: EXT4-fs (sdd11): re-mounted. Opts: (null)

mount prints:

tmpfs on /dev type tmpfs (rw,seclabel,nosuid,relatime,mode=755)
devpts on /dev/pts type devpts (rw,seclabel,relatime,mode=600,ptmxmode=000)
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 /mnt type tmpfs (rw,seclabel,nosuid,nodev,noexec,relatime,mode=755,gid=1000)
/dev/block/sdd10 on / type ext4 (rw,seclabel,nodev,relatime,block_validity,delalloc,barrier,user_xattr)
/dev/block/sdd11 on /vendor type ext4 (rw,seclabel,relatime,block_validity,delalloc,barrier,user_xattr)
none on /acct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct)
none on /dev/memcg type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
none on /dev/stune type cgroup (rw,nosuid,nodev,noexec,relatime,schedtune)
none on /config type configfs (rw,nosuid,nodev,noexec,relatime)
none on /dev/cpuctl type cgroup (rw,nosuid,nodev,noexec,relatime,cpu)
none on /dev/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset,noprefix,release_agent=/sbin/cpuset_release_agent)
cg2_bpf on /dev/cg2_bpf type cgroup2 (rw,nosuid,nodev,noexec,relatime)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime)
pstore on /sys/fs/pstore type pstore (rw,seclabel,nosuid,nodev,noexec,relatime)
/sys/kernel/debug on /sys/kernel/debug type debugfs (rw,seclabel,relatime,mode=755)
tracefs on /sys/kernel/debug/tracing type tracefs (rw,seclabel,relatime)
/dev/block/sdd13 on /data type ext4 (rw,seclabel,noatime,discard,noauto_da_alloc,data=ordered)
tmpfs on /storage type tmpfs (rw,seclabel,nosuid,nodev,noexec,relatime,mode=755,gid=1000)
adb on /dev/usb-ffs/adb type functionfs (rw,relatime)
mtp on /dev/usb-ffs/mtp type functionfs (rw,relatime)
ptp on /dev/usb-ffs/ptp type functionfs (rw,relatime)
/data/media on /mnt/runtime/default/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,multiuser,mask=6,derive_gid,default_normal)
/data/media on /storage/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,multiuser,mask=6,derive_gid,default_normal)
/data/media on /mnt/runtime/read/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,multiuser,mask=23,derive_gid,default_normal)
/data/media on /mnt/runtime/write/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,multiuser,mask=7,derive_gid,default_normal)

I found out that I can run

mount -o rw,remount /dev/block/platform/soc/ff3b0000.ufs/by-name/system`

which gives me write access to /system. But it would be much nicer to be able to use adb remount.


#4

Wow, /system mount is not even showing in there. That’s wild.


#5

adb shell mount -o rw,remount /dev/block/platform/soc/ff3b0000.ufs/by-name/system


#6

Is there anything we can do about it, except for defining an alias for that command?


#7

The best solution is actually just to leave the system partition alone. The vendor partition still responds to the adb remount command, and makes a lot more sense to mangle than the system partition, which in theory should be device-independent.