Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Couldn't write partition #278

Open
ReFil opened this issue Apr 24, 2022 · 6 comments · May be fixed by #610
Open

Error: Couldn't write partition #278

ReFil opened this issue Apr 24, 2022 · 6 comments · May be fixed by #610
Assignees
Labels
bug Something isn't working

Comments

@ReFil
Copy link

ReFil commented Apr 24, 2022

I'm trying to unbrick a 3t but irrelevant of the decrypted firmware i try to flash or the partitions i try to flash at some point it alwys errors out with
Couldn't write partition. Either wrong memorytype given or no gpt partition.

@skyblaster
Copy link

skyblaster commented Apr 27, 2022

I'm seeing the same issue trying to write to an LG Velvet. More details on the exact model here

./edl wl /media/user/Reserved/LG_Velvet --memory=ufs --debugmode --skip=super,OP_a,OP_b,grow,ftm,persist,rct,power,els,srtc,sns,p_persist_lg,drm,mpt,fota,eksst,pstore,metadata,keystore,misc,ssd --loader=/opt/edl/Loaders/qualcomm/factory/sd765/0000000000720000_1bebe3863a6781db_fhprg.bin

log.txt

EDIT: I should add how I got into the situation of needing to restore from backup. I clicked "ChipErase" in LGUP thinking it would present options before proceeding to do anything. I was dead wrong, and interrupted the process as it was in the midst of erasing the "super" partition. The partition map was no longer visible in QFIL after this process.

@skyblaster
Copy link

If it helps to troubleshoot this issue, here is my lun0 partition table.
rawprogram0.txt

@skyblaster
Copy link

I ended up using QFIL to restore my phone.

@ReFil, if you're still having trouble, I noticed that with QFIL, I had to reboot the phone (Vol+, Vol-, and Power simultaneously), and then initiate the "Download" immediately after Windows detected the 9008 device.

Perhaps there is a short window after boot that is affecting edl and QFIL equally here.

@bkerler bkerler self-assigned this Apr 4, 2023
@bkerler bkerler added the bug Something isn't working label Apr 4, 2023
@dzid26
Copy link

dzid26 commented Aug 27, 2023

There is a bug that this message will display whether flashing was successful or not.

When edl wl option is used, it needs to point to each lun folder that was obtained with edl rl.
For example:

#!/bin/bash 
DUMP_FOLDER="../dump/"

./edl wl "$DUMP_FOLDER/lun1" --lun=1 --memory=ufs
./edl wl "$DUMP_FOLDER/lun2" --lun=2 --memory=ufs
./edl wl "$DUMP_FOLDER/lun3" --lun=3 --memory=ufs
./edl wl "$DUMP_FOLDER/lun4" --lun=4 --memory=ufs
./edl wl "$DUMP_FOLDER/lun5" --lun=5 --memory=ufs
./edl wl "$DUMP_FOLDER/lun0" --lun=0 --memory=ufs # main partition 120GB last - takes >3h

@drmouss
Copy link

drmouss commented Sep 18, 2023

can someboby help me find this /sd765/0000000000720000_1bebe3863a6781db_fhprg.bin need this file

@imyxh
Copy link

imyxh commented Dec 23, 2024

There is a bug that this message will display whether flashing was successful or not.

When edl wl option is used, it needs to point to each lun folder that was obtained with edl rl. For example:

Found it:

if guid_gpt is None:
self.error(
"Error: Can not fetch GPT table from device, you may need to use `edl w gpt` to write a partition table first.`")
break
for filename in filenames:
partname = os.path.basename(filename)
if ".bin" in partname[-4:] or ".img" in partname[-4:] or ".mbn" in partname[-4:]:
partname = partname[:-4]
if partname in skip:
continue
if partname in guid_gpt.partentries:
partition = guid_gpt.partentries[partname]
sectors = os.stat(filename).st_size // self.firehose.cfg.SECTOR_SIZE_IN_BYTES
if (os.stat(filename).st_size % self.firehose.cfg.SECTOR_SIZE_IN_BYTES) > 0:
sectors += 1
if sectors > partition.sectors:
self.error(f"Error: {filename} has {sectors} sectors but partition " +
f"only has {partition.sectors}.")
return False
self.printer(f"Writing {filename} to partition {str(partition.name)}.")
self.firehose.cmd_program(lun, partition.sector, filename)
else:
self.printer("Couldn't write partition. Either wrong memorytype given or no gpt partition.")
return False

Indentation issue. Opening PR in a sec.

@imyxh imyxh linked a pull request Dec 23, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants