2

I am trying to resize the partition /system using the parted and gdisk commands. But none of these commands succeed in changing mmcblk0 partitions after execution. The things I do are as follows:

  • install adb and fastboot and put them to the system variables.
  • enable Settings>developer options>USB debugging and Root debugging
  • install TWRP recovery.
  • run cmd in adminitsrator permission.
  • write these command in CMD :
    adb root  
    adb reboot recovery  
    adb push gdisk /sbin  
    adb push parted /sbin  
    adb shell chmod 777 /sbin/gdisk  
    adb shell chmod 777 /sbin/parted  
    adb shell  
    ~#> cd /dev/block  
    dev/block> gdisk mmcblk0  
    Partition table scan:  
      MBR: protective  
      BSD: not present  
      APM: not present  
      GPT: present  
    Found valid GPT with protective MBR; using GPT.
Command (? for help): p  
Disk /dev/block/mmcblk0: 61071360 sectors, 29.1 GiB  
Sector size (logical/physical): 512/512 bytes  
Disk identifier (GUID): 98101B32-BBE2-4BF2-A06E-2BB33D000C20  
Partition table holds up to 128 entries  
Main partition table begins at sector 2 and ends at sector 33  
First usable sector is 34, last usable sector is 61071326  
Partitions will be aligned on 2-sector boundaries  
Total free space is 8158 sectors (4.0 MiB)  



 Number  Start (sector)    End (sector)  Size       Code  Name  
       1            8192           38911   15.0 MiB    8300  apnhlos  
       2           38912          156543   57.4 MiB    0700  modem  
       3          156544          157567   512.0 KiB   FFFF  sbl1  
       4          157568          157631   32.0 KiB    FFFF  dbi  
       5          157632          157695   32.0 KiB    FFFF  ddr  
       6          157696          161791   2.0 MiB     FFFF  aboot  
       7          161792          162815   512.0 KiB   FFFF  rpm  
       8          162816          163839   512.0 KiB   FFFF  tz  
       9          163840          184319   10.0 MiB    FFFF  pad  
      10          184320          204799   10.0 MiB    8300  param  
      11          204800          233471   14.0 MiB    8300  efs  
      12          233472          239615   3.0 MiB     FFFF  modemst1  
      13          239616          245759   3.0 MiB     FFFF  modemst2  
      14          245760          268287   11.0 MiB    FFFF  boot  
      15          268288          294911   13.0 MiB    FFFF  recovery  
      16          294912          321535   13.0 MiB    FFFF  fota  
      17          321536          335853   7.0 MiB     8300  backup  
      18          335854          341997   3.0 MiB     FFFF  fsg  
      19          341998          341999   1024 bytes  FFFF  fsc  
      20          342000          342015   8.0 KiB     FFFF  ssd  
      21          342016          358399   8.0 MiB     8300  persist  
      22          358400          376831   9.0 MiB     8300  persdata  
      23          376832         5095423   2.3 GiB     8300  system  
      24         5095424         5709823   300.0 MiB   8300  cache  
      25         5709824         5730303   10.0 MiB    8300  hidden  
      26         5730304        61071326   26.4 GiB    8300  userdata  

Command (? for help): d  
Partition number (1-26): 26  

Command (? for help):w  

(curser blinking) and device goes to hang!!!!!

anyone can help me? I do this in parted command. It is like above.
after restarting the device, all of the partition are there, like before...

  • do yourself a favor and don't try this on device. make a dump of mmcblk0 and do some dry run on this file instead – alecxs May 22 '21 at 06:19
  • I backed up from cash,system,modem... in TWRP. Thank you for your inform. – Armin Absalan May 22 '21 at 10:40
  • what i mean you should do parted on the backup, not on the device itself. you can very easy brick your device https://android.stackexchange.com/q/218269 – alecxs May 22 '21 at 17:06
  • I really appreciate. you opened my eyes... – Armin Absalan May 22 '21 at 22:33
  • @elbarna would you please take a look at my question? – Armin Absalan Jun 12 '21 at 21:16
  • I think the bootloader of device is lock. Unfortunately I can not connect to fastboot, because of using windows 10 x64 but in developer option OEM Unlock is missing. Also, I used different PIT file to repartition the device, but Odin return error RQT_CLOSE!!. – Armin Absalan Jun 14 '21 at 21:30
  • Thank you @alecxs. If my device is locked, then how do I flashed Lineageos on it? – Armin Absalan Jun 15 '21 at 21:54
  • i didn't noticed you already unlocked bootloader because i didn't know you are talking about LineageOS. Anyway some protections live in aboot (bootloader) but afaik LineageOS comes with boot (kernel) only. therefore it might still be true (or why should LineageOS hide the OEM unlock feature from developer options)!? can't you see KG/RMM prenormal state on download mode screen? – alecxs Jun 15 '21 at 23:50
  • Thank you @alecxs for replying. I think the KG/RMM lock is for devices made in 2017 and beyond. anyway, there are some text line on the bootloader screen that are as follows: ODIN MODE PRODUCT NAME: SM-N9005 CURRENT BINARY: Custom SYSTEM STATUS: Custom REACTIVATION LOCK: OFF KNOX WARRANTY VOID: 0x1 (2) QUALCOM SECUREBOOT: ENABLE (CSB) RP SWREV: S2, T2, R2, A3, P3 SECURE DOWNLOAD : ENABLE UDC START – Armin Absalan Jun 18 '21 at 23:11
  • what about my suggestion dry run offline on mmcblk0 backup? there is cgdisk or sgdisk left you can try. afaik LineageOS provides flashable zip for resizing. if nothing works you still can update EBR with hex editor (there exist tools on xda). Disclaimer: all of this not recommend/at own risk – alecxs Jun 19 '21 at 00:50
  • 1
  • thank you @alecxs. I tried cgdisk but this command isn't on /sbin, tried to resizing with sgdisk but this command did same as gdisk and parted too, nothing change finaly. I can't find lineageOS resizing flashable zip on net. And about EBR, I tried to find out how can I do that! I searched and read many forum, this is for Mediatek devices however samsung hlte is not mediatek. – Armin Absalan Jun 23 '21 at 18:53
  • i did manually on GT-I9301i but can't remember which tool used. you must be right because Partition Editor is for MTK. maybe it was PIT Magic – alecxs Jun 23 '21 at 23:52
  • read here or ask in Libera Chat for hints. flo-deb_clamor_repartition.zip is such example for other device (don't try!) – alecxs Jun 24 '21 at 05:27
  • I used PIT Magic too, with many PIT files that downloaded from XDA even I edited a PIT file by myself. when I want to write it to the device, Odin shown this error: RQT_CLOSE!. I have read that forum you suggested, there is nothing for repartition. Thank you @alecxs for your try, but your comments not the solution of my problem. – Armin Absalan Jun 25 '21 at 16:16
  • Sorry for misleading. Nevertheless you could ask in that forum too. try heimdall flash tool instead Odin – alecxs Jun 26 '21 at 00:04

0 Answers0