PDA

View Full Version : Chromebook SD install only showing 5GB file system?



utcu
2013-03-31, 18:38
This may be a bit of a noob question, but I'm having issues regardless of how I try to resize the partition.

Used "dd if=kali-custom-chrome.img of=/dev/sdb bs=512k" to set up the SD card.

Install went flawlessly, boots up great, set everything else up, then I notice that there's 25Gb of unallocated space on my SD card and Kali only has 5Gb in the file system to work with. I've tried using gparted both from my ubuntu system as well as using a live cd and I'm getting errors. The following error is what keeps showing.

"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 disc is smaller. Fix by moving backup to the end (and renaming old backup)?
Not all of the space on /dev/sdb appears to be used, you can fix the GPT to use all of the space (an extra 52568327) or continue with the current setting?
Unable to satisfy all constraints on the partition."

I'm unsure if I'm just missing something or I'm having on off day, but its getting a tad frustrating. Any help would be greatly appreciated. Thanks

Also this is the structure of the SD card according to gparted.
unallocated - 4Mib
/dev/sdb1 - unknown - 16Mib
/dev/sdb2 - unknown - 16Mib
/dev/sdb3 - Ext4 - 4.2Gib
unallocated - 25.07Gib

whoismike
2013-04-03, 21:50
You're not alone... Same issue. Haven't found an easy solution yet.

anonnyperson
2013-04-04, 17:59
Here's a nearly identical thread (http://forums.kali.org/showthread.php?730-raspberrypi-install-is-not-using-whole-sd-card), and the files and instructions posted by ciphersson may work for us (NOT TESTED - yet ;) ).

Hopefully cross-referencing helps. I'm going to give this a shot this weekend!

Also, I'd like to create an additional, separate, FAT32 partition rather than expanding the rootfs as listed in the above installations. Actually, I'd like two (crouton or similar chroot environment in ext4 + shared data partition across all 'three' os's in fat32), but if I can make one I'm sure I can figure out making another.

utcu
2013-04-04, 18:58
I finally managed to get it to let me resize the partition using a gparted live CD, but now it won't boot. I'm hoping either someone finds a fix or it gets fixed in the next image release. It seems that they've found a solution for the raspberry pi image though.

anonnyperson
2013-04-05, 15:25
There's another thread here on RaspPi's with a fix, however it involves installing .deb files, and I have mixed feelings about how they'd work for us. I'll find a fix in a few days and get back to you guys.

blksun813
2013-04-07, 17:22
I have a feeling it has something to do with a signature somewhere. I know the kernel must be signed, but not quite sure where that signature is located...

I even went though the custom build instructions at http://docs.kali.org/development/custom-chromebook-kernel-image hoping to create a new .img file that was larger. I must have messed something up, because I didn't end up with a bootable image... In fact, I don't think there was much of anything in the image I created.

Anyone else care to try? The only change I made is in the line dd if=/dev/zero of=kali-custom-chrome.img bs=1MB count=5000, I changed the 5000 to 10000 (just to see if it would work). I was using Kali for I386 running under VirtualBox.

anonnyperson
2013-04-09, 02:55
blksun - you created a chrome image in a x86 environment? Wouldn't you need an ARM emulator in order for a chrome image to work?

I didn't get around to expanding the partition using the .deb's somebody posted for the rasppi this past weekend. I wonder if the signing/verification would be the problem afterall. There's tons of docs for developers creating and signing their own custom images for chromebooks though. I recently sort of decided I'd have to cook my own anyway (include some drivers and other things).

Anyway, keep this thread bumped until we get it fixed :D

blksun813
2013-04-10, 17:48
Well... I followed the instructions to set up a cross-development environment.... But, I also tried a second time without modifying the instructions exactly and it still won't boot. So, I must have missed something.

It seems any modification to the partition table causes the image to fail. So, either the signature has something to do with the partition table, or the partition table is non-standard and needs to be edited with special tools.

Hopefully we can figure it out. In the meantime I was able to use a USB thumb drive mounted at /var/cache/apt to successfully perform a apt-get upgrade.

blksun813
2013-04-20, 12:38
Success!

I think trying to use anything other than the cgpt command on ChomeOS corrupts the partition table. Here's the steps I took to resize the filesystem:

1. Boot the Chromebook into ChromeOS
2. Zero out the partition table so Windows could read the SD card (I already had Kali installed)


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 (I used Win32DiskImager)
4. Reboot the Chromebook into Kali to test (optional)
5. Reboot into ChromeOS
6. Run fsck on /dev/mmc3blk1p3 (optional?)
7. Show / Repair (optional?) / Resize partition 3 on /dev/mmc3blk1
(I took the original size of 9691864 and multiplied by 3 to get 29075592. This ends up being about 14GB. If you have a 32GB drive, maybe you want to multiply by 6.)



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 29075592 /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 29075592 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


8. Reboot Chromebook into Kali (Optional, maybe just a remove/insert of the SD card is needed?)
9. Reboot Chromebook into ChromeOS
10. Run fsck and resizefs on /dev/mmcblk1p3 (Note: I probably should have done umount /dev/mmcblk1p3 before running the following commands)



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 3634449 blocks long.


11. Enjoy having some extra room in your Kali installation


Please let me know if this procedure worked for you.

utcu
2013-04-21, 16:32
Success!



I'll be trying this either this evening or tomorrow morning. Thanks for the detailed instructions as well.

Edit: Tried it out last night writing the image from ubuntu and that was a no go. Today I partitioned my mac hd and threw on windows. After using Win32DiscImager everything went as smooth as can be. I did 6x when putting the new size since I was using the 32gb sdcard and that gave me about 22gb in the file system which is great. The only thing that I can add is that I didn't bother running fsck on the partition (step 6) and then on step 8 I just unmounted the partitions then removed and reinserted the sdcard instead of rebooting.

1. Won't work writing the image using unetbootin or dd command in ubuntu.
2. Step 6 is completely optional.
3. Step 8 you can just unmount,remove,reinsert to save time.

Thanks again.

j0k3rr
2013-05-01, 15:55
Success!
First off thanks for writing this out

I followed your steps even using win32diskimg,but im stuck on step 7, when i try to run the following command on


cgpt add -i 3 -b 73728 -s 29075592 /dev/mmcblk1

it gives me the following error:


ERROR: cgpt add: Entry outside of valid region
ERROR: cgpt add: -i 3 -b 73728

i can go lower than 9691864 it allowed, but when i tried 9691865 and above it wouldnt allow give the same error.

tried googling cgpt but theres nothin out there.
if i find a solution i will update this.
Thanks again

blksun813
2013-05-01, 23:07
j0k3rr,

Can you give me the output of
cgpt show /dev/mmcblk1
?

I wonder if the Sec GPT table is at 9691865...

j0k3rr
2013-05-02, 08:11
j0k3rr,

Can you give me the output of
cgpt show /dev/mmcblk1
?

I wonder if the Sec GPT table is at 9691865...

Hi blksun813, Thanks for your help heres the output


Welcome to crosh, type 'help' for a list of commands.
crosh> shell
chronos@localhost / $ sudo -s
Password:
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 29075592 /dev/mmcblk1
ERROR: cgpt add: Entry outside of valid region
ERROR: cgpt add: -i 3 -b 73728 -s 29075592


also a screenshot
http://i41.tinypic.com/29er11.jpg

blksun813
2013-05-03, 07:00
Well, j0k3rr... I really don't have an answer..

Maybe there's something wrong w/ your SD card? Maybe the Lock switch is in the locked position?

Maybe there is some corruption on the SD card.. Maybe you can try to clear it out and write the image again.


dd if=/dev/zero of=/dev/mmcblk1 bs=2G

should wipe anything left on there out.. then maybe you can try to write the image again and see if you get better results.

j0k3rr
2013-05-03, 19:58
Well, j0k3rr... I really don't have an answer..

Maybe there's something wrong w/ your SD card? Maybe the Lock switch is in the locked position?

Maybe there is some corruption on the SD card.. Maybe you can try to clear it out and write the image again.


dd if=/dev/zero of=/dev/mmcblk1 bs=2G

should wipe anything left on there out.. then maybe you can try to write the image again and see if you get better results.

@blksun813 thanks for everything, if i figure it out i will deff update u all on here.

j0k3rr
2013-05-03, 21:49
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.


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


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


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)


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


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


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


df -h


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 :)

blksun813
2013-05-04, 02:21
@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


Sweet. I'm glad you were able to figure it out. Thanks for the updates also.