reynhout / chrx

Chromebook Unix
419 stars 56 forks source link

re: repartition disk chromebook - cb3-111 - gnawty #50

Closed Sapper-1cd closed 7 years ago

Sapper-1cd commented 7 years ago

Hello-
I am unable to recover my chromebook. I would like to remove the chrx partitions and recover the space. Could you give me a suggestion to do this? I am aware of the risks. Thank you.

Enclosed are (2) screenshots that may be helpful. Sorry I am new to this. screenshot 2017-08-27 at 09 56 55 screenshot 2017-08-27 at 09 58 06

I have tried researching, via Dennis L and prior questions using the following commands: cgpt add -i 6 -t unused /dev/sda cgpt add -i 7 -t unused /dev/sda cgpt add -i 1 -s $(( $(cgpt show -i 1 -s /dev/sda) + $(cgpt show -i 6 -s /dev/sda) + $(cgpt show -i 7 -s /dev/sda) )) /dev/sda

but when I use #1 above I get no file. Can you help me out? Thanks much. Chrx is great.

Regards,

Eric

reynhout commented 7 years ago

There aren't any "risks" to Recovering ChromeOS. The intention of Recovery is to completely erase the contents of internal storage and replace it with a factory ChromeOS image.

All you need to do is download a ChromeOS Recovery Image from Google, write it to USB/SD, invoke the Recovery key sequence (Esc-Refresh-Power), and follow the instructions on screen. Full docs: https://support.google.com/chromebook/answer/1080595?hl=en

So, I'm not sure what you're trying to do, or how to answer your question. :) Can you restate?

PS: You screenshots do not display for me -- if they are required to understand the question, perhaps try Imgur or similar?

Sapper-1cd commented 7 years ago

Thank you for the chrome recovery tips. My question was in regards to attempting to remove Chrx via re-partitioning or clearing out the areas (space allocated to Chrx). See issue # 11 from Dennis L (closed)-- ability to remove the Linux partition. I was attempting to work with that response but have been unsuccessful. I can do a full recovery as you suggest, however I wanted to attempt to remove the Linux partition without full recovery.

reynhout commented 7 years ago

Those command lines will need to be altered for some Chromebook models. GNAWTY has eMMC storage, so the paths should be changed to /dev/mmcblk0 instead of /dev/sda.

Remember, the whole process remains untested. ChromeOS can detect partition size changes and "repair" itself. If things go smoothly, this should work. If not, you'll need to do a normal ChromeOS Recovery.

Recovery is quick and painless, so that's the simplest recommendation anyway. You can back up any local storage to USB, if that's a concern. It's possible that the "repair" process will also invoke a "Powerwash", so you'd also want backups of local data in case of that eventuality.

Sapper-1cd commented 7 years ago

Thank you for the correct path. I will try that. Much appreciated. The first (2) commands work fine after appending /dev/mmcblk0 rather than /dev/sda. However, I am getting an error as follows with the third command ( the long one ). sudo cgpt add -i 1 -s $(( $(cgpt show -i 1 -s /dev/mmcblk0) + $(cgpt show -i 6 -s /dev/mmcblk0) > + $(cgpt show -i 7 -s /dev/mmcblk0) )) /dev/mmcblk0 ERROR: Can't open /dev/mmcblk0: Permission denied ERROR: Can't open /dev/mmcblk0: Permission denied ERROR: Can't open /dev/mmcblk0: Permission denied bash: +

I am not sure what it is telling me. Sudo worked fine on the first (2) commands after appending as you stated. Getting + : syntax error: operand expected (error token is "+ "). Thanks for any and all help.

Eric

Sapper-1cd commented 7 years ago

I ran the above command (cgpt add -i 1 -s $(( $(cgpt show -i 1 -s /dev/mmcblk0) + $(cgpt show -i 6 -s /dev/mmcblk0) > + $(cgpt show -i 7 -s /dev/mmcblk0) )) /dev/mmcblk0) as root and it worked fine. However upon running command - - localhost dev # blockdev --rereadpt /dev/mmcblk0, i am getting the following error: blockdev: ioctl error on BLKRRPART: Device or resource busy. Thanks again for the help.

Eric

reynhout commented 7 years ago

Command should be:

sudo bash
cgpt add -i 1 -s $(( $(cgpt show -i 1 -s /dev/mmcblk0) + $(cgpt show -i 6 -s /dev/mmcblk0) + $(cgpt show -i 7 -s /dev/mmcblk0) )) /dev/mmcblk0

Or, this version might be easier to paste and follow, both are equivalent:

sudo bash
p1=$(cgpt show -i 1 -s /dev/mmcblk0)
p6=$(cgpt show -i 6 -s /dev/mmcblk0)
p7=$(cgpt show -i 7 -s /dev/mmcblk0)
cgpt add -i 1 -s $(( p1 + p6 + p7 )) /dev/mmcblk0

Your pastes have spurious > chars in them, which might be causing a problem. Also you need to run as root, don't use sudo in the cgpt command line. I added sudo bash at the top to be more clear.

If it did work correctly, the blockdev error is not necessarily a problem. The device is, in fact, busy. Rebooting and then pressing Ctrl+D should kick ChromeOS which should notice the partition change and do its thing.

Sapper-1cd commented 7 years ago

With cgpt add -i 1 -s $(( p1 + p6 +p7)) /dev/mmcblk0, returning Error: Entry outside of valid region Error:-i 1 -s 40988672

reynhout commented 7 years ago

OK, try rebooting into ChromeOS and then running the last step post-reboot:

cgpt add -i 1 -s 40988672 /dev/mmcblk0
Sapper-1cd commented 7 years ago

Still returning same error: cgpt add -i 1 -s 40988672 /dev/mmcblk0 ERROR: Entry outside of valid region ERROR: -i 1 -s 40988672

reynhout commented 7 years ago

Try reducing the size. Start with 40988670, then go from there.

Check the current size with cgpt show -i 1 -s /dev/mmcblk0. Somewhere between 40988672 and the current size should work.

Sapper-1cd commented 7 years ago

I ran again the original commands (with the spur) and it was accepted. Then upon running the blockdev command again yielded same error as before. Then I ran cgpt show -I 1 -s /dev/mmcblk0 and it showed size of 1. I believe then I rebooted and it gave me the message "Your system is repairing itself. Please wait." It is now cycling through this same message with spinner for the 4th time. It runs for 5 minutes each time and then when I press control-d it appears to just recycle over again. Update. I have never seen the your system is repairing itself message before. Interesting. This last time I re-enabled verification , (back to non-dev mode) and the Chrome screen came back up for a flash before continuing to recycle.

reynhout commented 7 years ago

If cgpt show -i 1 -s /dev/mmcblk0 shows size 1, then some command has not worked properly.

I'd move on to ChromeOS Recovery at this point.

Sapper-1cd commented 7 years ago

Thanks for all the input, information, and help @reynhout. It appears I bricked it, but that is okay. It was worth a shot. Any suggestions for a usb / sd? I had written chrx to my internal drive.

reynhout commented 7 years ago

There are some good low-profile USB drives listed here: https://wiki.galliumos.org/Buyers_Guide.

I like the Samsung best for a permanent mount (gets warm but not too hot, very fast, no LED) or the Lexar for a utility device (good temp, half the speed of the Samsung, LED is very bright). The SanDisk gets too hot and is ~15% slower than the Samsung in my testing.

Sapper-1cd commented 7 years ago

Thanks for all the input. Awesome. I will check out the Samsung.

Sapper-1cd commented 7 years ago

I did purchase the Samsung USB drive you suggested and the instructions given worked perfectly. I successfully recovered my Chromebook. Thank you for all the help!