Originally Posted by
blksun813
Success!
@blksun813 I got it to work! super thanks to your guide it helped a lot, i had to change a few things in order to get it to work here are the steps i took
1. Boot the Chromebook into ChromeOS and press ctrl+alt+t to get the terminal emulator called "crosh"
2. Zero out the partition table so Windows could read the SD card cause I already had Kali installed.
Code:
Welcome to crosh, type 'help' for a list of commands.
crosh> shell
chronos@localhost / $ sudo -s
localhost / # fdisk /dev/mmcblk1
Welcome to fdisk (util-linux 2.21.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
WARNING: GPT (GUID Partition Table) detected on '/dev/mmcblk1'! The util fdisk doesn't support GPT. Use GNU Parted.
Command (m for help): o
Building a new DOS disklabel with disk identifier 0x14e1f4e1.
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
3. Write the .img to the SD card using Win32DiskImager
5. Reboot into ChromeOS and on the file manager click on the eject button to unmount the 3 folders from the mounted SD card
6. Run fsck on /dev/mmcblk1p3 [in my case its mmcblk1p3 and not mmc3blk1p3/mmcblk1 i some how saw mmcb and didnt pay attention to the rest]
7. Show / Repair /dev/mmcblk1 [ notice the change in name]
8.try running the command
Code:
cgpt add -i 3 -b 73728 -s 58151184 /dev/mmcblk1
Note: if it works without giving "ERROR: cgpt add: Entry outside of valid region" error then continue with blksun813's instructions and steps else continue
9. use GNU Parted to fix the disk and use up the free space
Code:
chronos@localhost / $ parted /dev/mmcblk1
GNU Parted 3.1
Using /dev/mmcblk1
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Error: The backup GPT table is not at the end of the disk, as it should be. This might mean that another operating system
believes the disk is smaller. Fix, by moving the backup to the end (and removing the old backup)?
Fix/Ignore/Cancel? Fix
make sure you type fix at that point it might ask you again if you want to fix it go ahead and fix it.
7. Show / Repair using cgpt
(I am using a 32GB SD card and used blksun813's method to get total 28 gb file system space and 22GB free space took the original size of 9691864 and multiplied by 6 to get 58151184)
Code:
localhost / # cgpt repair /dev/mmcblk1
localhost / # cgpt show /dev/mmcblk1
start size part contents
0 1 PMBR
1 1 Pri GPT header
2 32 Pri GPT table
8192 32768 1 Label: "KERN-A"
Type: ChromeOS kernel
UUID: 65CAB7C9-E0FA-41C1-93CA-FF3FB484A9F1
Attr: priority=10 tries=5 successful=1
40960 32768 2 Label: "KERN-B"
Type: ChromeOS kernel
UUID: 7B2BC6CF-14BF-4EFB-ABB2-003AB9BEF25B
Attr: priority=5 tries=5 successful=1
73728 9691864 3 Label: "Linux filesystem"
Type: 0FC63DAF-8483-4772-8E79-3D69D8477DE4
UUID: 77C08BAF-3402-4512-A8EE-444AD48737E5
31116255 32 Sec GPT table
31116287 1 Sec GPT header
localhost / # cgpt add -i 3 -b 73728 -s 58151184 /dev/mmcblk1
localhost / # cgpt show /dev/mmcblk1
start size part contents
0 1 PMBR
1 1 Pri GPT header
2 32 Pri GPT table
8192 32768 1 Label: "KERN-A"
Type: ChromeOS kernel
UUID: 65CAB7C9-E0FA-41C1-93CA-FF3FB484A9F1
Attr: priority=10 tries=5 successful=1
40960 32768 2 Label: "KERN-B"
Type: ChromeOS kernel
UUID: 7B2BC6CF-14BF-4EFB-ABB2-003AB9BEF25B
Attr: priority=5 tries=5 successful=1
73728 58151184 3 Label: "Linux filesystem"
Type: 0FC63DAF-8483-4772-8E79-3D69D8477DE4
UUID: 77C08BAF-3402-4512-A8EE-444AD48737E5
31116255 32 Sec GPT table
31116287 1 Sec GPT header
10. Run fsck and resizefs on /dev/mmcblk1p3
Code:
crosh> shell
chronos@localhost / $ sudo -s
localhost / # resize2fs /dev/mmcblk1p3
resize2fs 1.42 (29-Nov-2011)
Filesystem at /dev/mmcblk1p3 is mounted on /media/removable/External Drive 2; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
The filesystem on /dev/mmcblk1p3 is now .........
11.Now mark either boot partition 1 or 2 to have higher priority
Code:
cgpt repair /dev/sdb
cgpt add -i 1 -S 1 -T 5 -P 10 -l KERN-A /dev/mmcblk1
cgpt add -i 2 -S 1 -T 5 -P 5 -l KERN-B /dev/mmcblk1
12.Reboot into kali and verify that kali is running once your in run
Thats it, a longer process but im so thankful for blksun813's guide.
If you guys run into any problems using my method let me know i will try and double check if i missed anything.
while your in kali run an update for the latest tools and fix's
apt-get update
apt-get upgrade
Peace