[Xperia Z5 Android Development] serajr:
I have no problems remounting rootfs and/or system as rw with Root Explorer using OP's V5.1+. F8131 with Nougat.

[MENTION=357342]tobias.waldvogel[/MENTION]

I've added TWRP support for Xperia XP and XZ, but sdcard link is still a problem, as you already know of!

Anyway, this is the recovery.log contents (I've also changed forceencrypt to encryptable in the ramdisk, and formatted /data to get rid of encryption):

__bionic_open_tzdata: couldn't find any tzdata when looking for localtime!
__bionic_open_tzdata: couldn't find any tzdata when looking for GMT!
__bionic_open_tzdata: couldn't find any tzdata when looking for posixrules!
Starting TWRP 3.0.2-0 on Sun Aug 16 17:18:21 1970
(pid 482)
I:Lun file '/sys/devices/platform/msm_hsusb/gadget/lun0/file' does not exist, USB storage mode disabled
I:Find_File: Error opening '/sys/class/backlight'
I:Found brightness file at '/sys/class/leds/lcd-backlight/brightness'
I:Got max brightness 4095 from '/sys/class/leds/lcd-backlight/max_brightness'
I:TWFunc::Set_Brightness: Setting brightness control to 4095
I:LANG: en
Starting the UI...Overlay graphics may work (mdssfb_90000), but not enabled. Use TW_TARGET_USES_QCOM_BSP := true to enable.
setting DRM_FORMAT_RGB565 and GGL_PIXEL_FORMAT_RGB_565
cannot find/open a drm device: No such file or directory
fb0 reports (possibly inaccurate):
vi.bits_per_pixel = 32
vi.red.offset = 0 .length = 8
vi.green.offset = 8 .length = 8
vi.blue.offset = 16 .length = 8
setting GGL_PIXEL_FORMAT_RGBA_8888
double buffered
framebuffer: 0 (1080 x 1920)
Using fbdev graphics.
I:TWFunc::Set_Brightness: Setting brightness control to 4095
I:Loading package: splash (/twres/splash.xml)
I:Load XML directly
I:PageManager::LoadFileToBuffer loading filename: '/twres/splash.xml' directly
I:Checking resolution...
I:Loading resources...
I:Loading variables...
I:Loading mouse cursor...
I:Loading pages...
I:Loading page splash
I:Switching packages (splash)
=> Linking mtab
Renaming regular /etc/recovery.fstab -> /etc/recovery.fstab.bak
Moving /etc/twrp.fstab -> /etc/recovery.fstab
=> Processing recovery.fstab
I:Processing '/system'
I:Processing '/cache'
I:Processing '/data'
I:Processing '/boot'
I:Processing '/recovery'
I:Processing '/firmware'
I:Created '/firmware' folder.
I:Processing '/persist'
I:Created '/persist' folder.
I:Processing '/dsp'
I:Created '/dsp' folder.
I:Processing '/idd'
I:Created '/idd' folder.
I:Processing '/keymaster'
I:Processing '/modem_fs1'
I:Processing '/modem_fs2'
I:Processing '/oem'
I:Processing '/qns'
I:Created '/qns' folder.
I:Processing '/ta'
I:Processing '/sdcard1'
I:Created '/sdcard1' folder.
I:Processing '/usbdisk'
I:Created '/usbdisk' folder.
[B][COLOR="Red"]I:Using automatic handling for /data/media emulated storage device.
I:Setting up '/data' as data/media emulated storage.
I:Can not create '/sdcard' folder.
mount: mounting /data/media on /sdcard failed: No such file or directory
mount -o bind '/data/media' '/sdcard' process ended with ERROR: 255[/COLOR][/B]
I:Backup folder set to '/data/media/0/TWRP/BACKUPS/CB512AD0TJ'
I:Settings storage is '/data/media/0'
Updating partition details...
[B][COLOR="Red"]mount: mounting /data/media/0 on /sdcard failed: No such file or directory
mount -o bind '/data/media/0' '/sdcard' process ended with ERROR: 255[/COLOR][/B]
I:Data backup size is 327MB, free: 20408MB.
I:cmd: /sbin/exfat-fuse -o big_writes,max_read=131072,max_write=131072 /dev/block/mmcblk1p1 /sdcard1
__bionic_open_tzdata: couldn't find any tzdata when looking for localtime!
__bionic_open_tzdata: couldn't find any tzdata when looking for GMT!
__bionic_open_tzdata: couldn't find any tzdata when looking for posixrules!
__bionic_open_tzdata: couldn't find any tzdata when looking for GMT!
__bionic_open_tzdata: couldn't find any tzdata when looking for posixrules!
I:Unable to mount '/usbdisk'
I:Actual block device: '', current file system: 'auto'
...done
mount: mounting /data/media/0 on /sdcard failed: No such file or directory
mount -o bind '/data/media/0' '/sdcard' process ended with ERROR: 255
I:Unmounting main partitions...

Partition Logs:
/system | /dev/block/mmcblk0p55 | Size: 7132MB Used: 4577MB Free: 2555MB Backup Size: 4577MB
Flags: Can_Be_Mounted Can_Be_Wiped Can_Be_Backed_Up Wipe_Available_in_GUI IsPresent
Primary_Block_Device: /dev/block/mmcblk0p55
Display_Name: System
Storage_Name: System
Backup_Path: /system
Backup_Name: system
Backup_Display_Name: System
Storage_Path: /system
Current_File_System: ext4
Fstab_File_System: ext4
Backup_Method: files

/cache | /dev/block/mmcblk0p35 | Size: 247MB Used: 0MB Free: 247MB Backup Size: 0MB
Flags: Can_Be_Mounted Can_Be_Wiped Can_Be_Backed_Up Wipe_During_Factory_Reset Wipe_Available_in_GUI IsPresent
Primary_Block_Device: /dev/block/mmcblk0p35
Display_Name: Cache
Storage_Name: Cache
Backup_Path: /cache
Backup_Name: cache
Backup_Display_Name: Cache
Storage_Path: /cache
Current_File_System: ext4
Fstab_File_System: ext4
Backup_Method: files

/data | /dev/block/mmcblk0p54 | Size: 20699MB Used: 327MB Free: 20408MB Backup Size: 327MB
Flags: Can_Be_Mounted Can_Be_Wiped Can_Be_Backed_Up Wipe_During_Factory_Reset Wipe_Available_in_GUI IsPresent Has_Data_Media Can_Encrypt_Backup Use_Userdata_Encryption Is_Storage Is_Settings_Storage Retain_Layout_Version
Symlink_Path: /data/media/0
Symlink_Mount_Point: /sdcard
Primary_Block_Device: /dev/block/mmcblk0p54
Length: -16384
Display_Name: Data
Storage_Name: Internal Storage
Backup_Path: /data
Backup_Name: data
Backup_Display_Name: Data
Storage_Path: /data/media/0
Current_File_System: ext4
Fstab_File_System: ext4
Backup_Method: files
MTP_Storage_ID: 65539

/boot | /dev/block/mmcblk0p16 | Size: 64MB
Flags: Can_Be_Backed_Up Has_SubPartition IsPresent Can_Flash_Img
Primary_Block_Device: /dev/block/mmcblk0p16
Display_Name: Kernel
Storage_Name: Kernel
Backup_Path: /boot
Backup_Name: boot
Backup_Display_Name: Kernel
Storage_Path: /boot
Current_File_System: emmc
Fstab_File_System: emmc
Backup_Method: dd

/recovery | /dev/block/mmcblk0p45 | Size: 64MB
Flags: Can_Be_Backed_Up IsPresent Can_Flash_Img
Primary_Block_Device: /dev/block/mmcblk0p45
Display_Name: FOTAKernel
Storage_Name: FOTAKernel
Backup_Path: /recovery
Backup_Name: recovery
Backup_Display_Name: FOTAKernel
Storage_Path: /recovery
Current_File_System: emmc
Fstab_File_System: emmc
Backup_Method: dd

/firmware | /dev/block/mmcblk0p23 | Size: 94MB Used: 67MB Free: 27MB Backup Size: 67MB
Flags: Can_Be_Mounted Can_Be_Wiped IsPresent Mount_To_Decrypt
Primary_Block_Device: /dev/block/mmcblk0p23
Display_Name: Firmware
Storage_Name: Firmware
Backup_Path: /firmware
Backup_Name: firmware
Backup_Display_Name: Firmware
Storage_Path: /firmware
Current_File_System: vfat
Fstab_File_System: vfat
Backup_Method: files
Mount_Flags=0x 1, Mount_Options=context=u:object_r:firmware_file:s0

/persist | /dev/block/mmcblk0p36 | Size: 27MB Used: 0MB Free: 27MB Backup Size: 0MB
Flags: Can_Be_Mounted Can_Be_Wiped IsPresent
Primary_Block_Device: /dev/block/mmcblk0p36
Display_Name: persist
Storage_Name: persist
Backup_Path: /persist
Backup_Name: persist
Backup_Display_Name: persist
Storage_Path: /persist
Current_File_System: ext4
Fstab_File_System: ext4
Backup_Method: files

/dsp | /dev/block/mmcblk0p24 | Size: 11MB Used: 4MB Free: 7MB Backup Size: 4MB
Flags: Can_Be_Mounted Can_Be_Wiped IsPresent
Primary_Block_Device: /dev/block/mmcblk0p24
Display_Name: dsp
Storage_Name: dsp
Backup_Path: /dsp
Backup_Name: dsp
Backup_Display_Name: dsp
Storage_Path: /dsp
Current_File_System: ext4
Fstab_File_System: ext4
Backup_Method: files

/idd | /dev/block/mmcblk0p48 | Size: 13MB Used: 0MB Free: 13MB Backup Size: 0MB
Flags: Can_Be_Mounted Can_Be_Wiped Can_Be_Backed_Up IsPresent
Primary_Block_Device: /dev/block/mmcblk0p48
Display_Name: Diag
Storage_Name: Diag
Backup_Path: /idd
Backup_Name: idd
Backup_Display_Name: Diag
Storage_Path: /idd
Current_File_System: ext4
Fstab_File_System: ext4
Backup_Method: files

/keymaster | /dev/block/mmcblk0p17 | Size: 0MB
Flags: IsPresent
Primary_Block_Device: /dev/block/mmcblk0p17
Display_Name: keymaster
Storage_Name: keymaster
Backup_Path: /keymaster
Backup_Name: keymaster
Backup_Display_Name: keymaster
Storage_Path: /keymaster
Current_File_System: emmc
Fstab_File_System: emmc
Backup_Method: dd

/modem_fs1 | /dev/block/mmcblk0p33 | Size: 2MB
Flags: Can_Be_Backed_Up Is_SubPartition IsPresent Mount_To_Decrypt
SubPartition_Of: /boot
Primary_Block_Device: /dev/block/mmcblk0p33
Display_Name: modem_fs1 (Baseband)
Storage_Name: modem_fs1 (Baseband)
Backup_Path: /modem_fs1
Backup_Name: modem_fs1
Backup_Display_Name: modem_fs1 (Baseband)
Storage_Path: /modem_fs1
Current_File_System: emmc
Fstab_File_System: emmc
Backup_Method: dd

/modem_fs2 | /dev/block/mmcblk0p34 | Size: 2MB
Flags: Can_Be_Backed_Up Is_SubPartition IsPresent Mount_To_Decrypt
SubPartition_Of: /boot
Primary_Block_Device: /dev/block/mmcblk0p34
Display_Name: modem_fs2 (Baseband)
Storage_Name: modem_fs2 (Baseband)
Backup_Path: /modem_fs2
Backup_Name: modem_fs2
Backup_Display_Name: modem_fs2 (Baseband)
Storage_Path: /modem_fs2
Current_File_System: emmc
Fstab_File_System: emmc
Backup_Method: dd

/oem | /dev/block/mmcblk0p42 | Size: 387MB Used: 13MB Free: 374MB Backup Size: 13MB
Flags: Can_Be_Mounted Can_Be_Wiped Can_Be_Backed_Up IsPresent
Primary_Block_Device: /dev/block/mmcblk0p42
Display_Name: OEM
Storage_Name: OEM
Backup_Path: /oem
Backup_Name: oem
Backup_Display_Name: OEM
Storage_Path: /oem
Current_File_System: ext4
Fstab_File_System: ext4
Backup_Method: files

/qns | /dev/block/mmcblk0p49 | Size: 17MB Used: 0MB Free: 17MB Backup Size: 0MB
Flags: Can_Be_Mounted Can_Be_Wiped Can_Be_Backed_Up IsPresent
Primary_Block_Device: /dev/block/mmcblk0p49
Display_Name: Qnovo
Storage_Name: Qnovo
Backup_Path: /qns
Backup_Name: qns
Backup_Display_Name: Qnovo
Storage_Path: /qns
Current_File_System: ext4
Fstab_File_System: ext4
Backup_Method: files

/ta | /dev/block/mmcblk0p1 | Size: 2MB
Flags: Can_Be_Backed_Up IsPresent
Primary_Block_Device: /dev/block/mmcblk0p1
Display_Name: TA (Trim-Area)
Storage_Name: TA (Trim-Area)
Backup_Path: /ta
Backup_Name: ta
Backup_Display_Name: TA (Trim-Area)
Storage_Path: /ta
Current_File_System: emmc
Fstab_File_System: emmc
Backup_Method: dd

/sdcard1 | /dev/block/mmcblk1p1 | Size: 60890MB Used: 7561MB Free: 53328MB Backup Size: 7561MB
Flags: Can_Be_Mounted Can_Be_Wiped Wipe_Available_in_GUI Removable IsPresent Is_Storage
Primary_Block_Device: /dev/block/mmcblk1p1
Display_Name: Micro SDcard
Storage_Name: Micro SDcard
Backup_Path: /sdcard1
Backup_Name: sdcard1
Backup_Display_Name: Micro SDcard
Storage_Path: /sdcard1
Current_File_System: exfat
Fstab_File_System: vfat
Backup_Method: files
MTP_Storage_ID: 65537

/usbdisk | | Size: 0MB Used: 0MB Free: 0MB Backup Size: 0MB
Flags: Can_Be_Mounted Can_Be_Wiped Wipe_Available_in_GUI Removable Is_Storage
Primary_Block_Device: /dev/block/sda1
Alternate_Block_Device: /dev/block/sda
Display_Name: USB OTG
Storage_Name: USB OTG
Backup_Path: /usbdisk
Backup_Name: usbdisk
Backup_Display_Name: USB OTG
Storage_Path: /usbdisk
Current_File_System: auto
Fstab_File_System: auto
Backup_Method: files
MTP_Storage_ID: 65538

I:Loading package: TWRP (/data/media/0/TWRP/theme/ui.zip)
I:Loading zip theme
I:Loading package: TWRP (/twres/ui.xml)
I:Load XML directly
I:PageManager::LoadFileToBuffer loading filename: '/twres/languages/uk.xml' directly
I:PageManager::LoadFileToBuffer loading filename: '/twres/languages/tr.xml' directly
I:PageManager::LoadFileToBuffer loading filename: '/twres/languages/sv.xml' directly
I:PageManager::LoadFileToBuffer loading filename: '/twres/languages/sl.xml' directly
I:PageManager::LoadFileToBuffer loading filename: '/twres/languages/sk.xml' directly
I:PageManager::LoadFileToBuffer loading filename: '/twres/languages/ru.xml' directly
I:PageManager::LoadFileToBuffer loading filename: '/twres/languages/pt_BR.xml' directly
I:PageManager::LoadFileToBuffer loading filename: '/twres/languages/pl.xml' directly
I:PageManager::LoadFileToBuffer loading filename: '/twres/languages/nl.xml' directly
I:PageManager::LoadFileToBuffer loading filename: '/twres/languages/it.xml' directly
I:PageManager::LoadFileToBuffer loading filename: '/twres/languages/hu.xml' directly
I:PageManager::LoadFileToBuffer loading filename: '/twres/languages/fr.xml' directly
I:PageManager::LoadFileToBuffer loading filename: '/twres/languages/es.xml' directly
I:PageManager::LoadFileToBuffer loading filename: '/twres/languages/en.xml' directly
I:PageManager::LoadFileToBuffer loading filename: '/twres/languages/el.xml' directly
I:PageManager::LoadFileToBuffer loading filename: '/twres/languages/de.xml' directly
I:PageManager::LoadFileToBuffer loading filename: '/twres/languages/cz.xml' directly
I:PageManager::LoadFileToBuffer loading filename: '/twres/languages/en.xml' directly
parsing languageFile
parsing languageFile done
I:PageManager::LoadFileToBuffer loading filename: '/twres/ui.xml' directly
I:Checking resolution...
I:Loading resources...
I:Failed to load image from indeterminate013, error -1
I:Loading variables...
I:Loading mouse cursor...
I:Loading pages...
I:Including file: /twres/portrait.xml...
I:PageManager::LoadFileToBuffer loading filename: '/twres/portrait.xml' directly
I:Loading resources...
I:Loading variables...
I:Loading mouse cursor...
I:Loading pages...
I:Loading page main
I:Loading page main2
I:Loading page install
I:Unable to open '/sdcard'
I:Unable to open '/sdcard'
I:Loading page flash_confirm
I:Loading page flash_zip
I:Loading page flash_done
I:Loading page flashimage_confirm
I:Loading page clear_vars
I:Loading page confirm_action
I:Loading page action_page
I:Loading page singleaction_page
I:Loading page action_complete
I:Loading page filecheck
I:Loading page rebootcheck
I:Loading page wipe
I:Loading page advancedwipe
I:Loading page formatdata
I:Loading page formatdata_confirm
I:Loading page checkpartitionlist
I:Loading page partitionoptions
I:Loading page refreshfilesystem
I:Loading page selectfilesystem
I:Loading page backup
I:Loading page backup_options
I:Loading page backupname1
I:Loading page backupname2
I:Loading page backupencryption
I:Loading page backupencryption2
I:Loading page checkbackuppassword
I:Loading page backup_run
I:Loading page restore
I:Unable to open '/data/media/0/TWRP/BACKUPS/CB512AD0TJ'
I:Loading page restore_read
I:Loading page restore_decrypt
I:Loading page try_restore_decrypt
I:Loading page restore_select
I:Loading page renamebackup
I:Loading page restore_run
I:Loading page mount
I:Loading page usb_mount
I:Loading page usb_umount
I:Loading page system_readonly_check
I:Loading page reboot
I:Loading page system_readonly
I:Loading page settings
I:Loading page settings_timezone
I:Loading page settings_screen
I:Loading page settings_vibration
I:Loading page settings_language
I:Loading page advanced
I:Loading page partsdcardsel
I:Loading page partsdcardcheck
I:Loading page partsdcard
I:Loading page htcdumlock
I:Loading page lock
I:Loading page filemanagerlist
I:Loading page filemanageroptions
I:Loading page choosedestinationfolder
I:Loading page filemanagerrenamefile
I:Loading page filemanagerrenamefolder
I:Loading page filemanagerchmod
I:Loading page filemanagerconfirm
I:Loading page filemanageraction
I:Loading page decrypt
I:Loading page decrypt_pattern
I:Loading page trydecrypt
I:Loading page terminalcommand
I:Loading page sideload
I:Loading page fixcontexts
I:Loading page installsu
I:Loading page slideout
I:Loading page select_storage
I:Loading page select_language
I:Set page: 'clear_vars'
I:Set page: 'main2'
I:Switching packages (TWRP)
No file contexts for SELinux
Full SELinux support is present.
I:Not using /misc, not defined in fstab.
I:Not using /misc, not defined in fstab.
Startup Commands:

I:Copying file /cache/recovery/log to /cache/recovery/last_log
tw_get_context got selinux context: u:object_r:media_rw_data_file:s0
I:Got default contexts and file mode for storage files.
I:Attempt to load settings from settings file...
I:InfoManager file '/data/media/0/TWRP/.twrps' not found.
I:Backup folder set to '/data/media/0/TWRP/BACKUPS/CB512AD0TJ'
I:Copying file /etc/recovery.fstab to /cache/recovery/recovery.fstab
I:Version number saved to '/cache/recovery/.version'
I:cmd: /sbin/exfat-fuse -o big_writes,max_read=131072,max_write=131072 /dev/block/mmcblk1p1 /sdcard1
__bionic_open_tzdata: couldn't find any tzdata when looking for localtime!
__bionic_open_tzdata: couldn't find any tzdata when looking for GMT!
__bionic_open_tzdata: couldn't find any tzdata when looking for posixrules!
__bionic_open_tzdata: couldn't find any tzdata when looking for GMT!
__bionic_open_tzdata: couldn't find any tzdata when looking for posixrules!
I:Unable to mount '/usbdisk'
I:Actual block device: '', current file system: 'auto'
__bionic_open_tzdata: couldn't find any tzdata when looking for CST6CDT,M3.2.0,M11.1.0!
__bionic_open_tzdata: couldn't find any tzdata when looking for posixrules!
I:TWFunc::Set_Brightness: Setting brightness control to 4095
I:PageManager::LoadFileToBuffer loading filename: '/twres/languages/en.xml' directly
parsing languageFile
parsing languageFile done
I:Translating partition display names
I:Backup folder set to '/data/media/0/TWRP/BACKUPS/CB512AD0TJ'
I:TWFunc::Fixup_Time: Pre-fix date and time: 1970-08-16--12-18-23
I:TWFunc::Fixup_Time: Setting time offset from file /sys/class/rtc/rtc0/since_epoch
I:TWFunc::Fixup_Time: will attempt to use the ats files now.
I:TWFunc::Fixup_Time: Setting time offset from file /data/time/ats_2, offset 1465219147832
I:TWFunc::Fixup_Time: Date and time corrected: 2017-01-20--00-37-30
I:Enabling MTP during startup
I:Starting MTP
Starting MTP
I:sending message to add 65539 '/data/media/0' 'Internal Storage'
I:Message sent, add storage ID: 65539
I:sending message to add 65537 '/sdcard1' 'Micro SDcard'
I:Message sent, add storage ID: 65537
MTP Enabled
I:Switching packages (TWRP)
I:Set page: 'system_readonly'
created new mtpserver object
MtpServer::run fd: 18
mtppipe add storage 65539 '/data/media/0'
MtpStorage id: 65539 path: /data/media/0
mtppipe add storage 65537 '/sdcard1'
MtpStorage id: 65537 path: /sdcard1
I:Is_Mounted: Unable to find partition for path '/vendor'
I:operation_start: 'Toggle System Mount'
I:operation_end - status=1
I:Set page: 'main'
I:Set page: 'clear_vars'
I:Set page: 'main2'
I:Set page: 'main'
I:Set page: 'clear_vars'
I:Set page: 'main2'
I:Switching packages (TWRP)
I:Set page: 'main'
I:Set page: 'clear_vars'
I:Set page: 'main2'
I:Set overlay: 'slideout'
I:Set overlay: ''
I:Set page: 'advanced'
I:Set page: 'confirm_action'
I:Set page: 'action_page'
I:operation_start: 'Copy Log'
I:Copying file /tmp/recovery.log to /data/media/0/recovery.log