Tiny Core Linux
Tiny Core Base => Raspberry Pi => Topic started by: patrikg on January 23, 2017, 01:00:18 AM
-
Hello Bela.
Couldn't sleep well this morning because maybe i figured out what problem you have with the picore image.
In my head.. there something saying OPTION BASE like the Basic command.
Where to start count from, start from 0 or start from 1.
Thinking like,when Bela making the picore image.. he just type in that the starting block of 1.
He just need to type in 0 as start. Have seen in the image that the first partition start with a gap of 4M.
Maybe this is also some explanation of why the image lost the counting at the end..missing one block.
//Patrik
-
Have now tried to accomplish what i mean. Why not try this.
To make 100 meg image.
Don't know if this working or not... haven't tested my self with pi.
Just making the image on my laptop.
Added -a to parted to tell none alignment.
Don't know if the none alignment will slow down the performance.
dd if=/dev/zero of=image.img bs=1M count=100M
(export LANG=C;parted -a none -s image.img mktable msdos mkpart primary fat32 0 30M mkpart primary ext4 30M 100%)
-
Missed the count should be 100 not 100M
-
He just need to type in 0 as start. Have seen in the image that the first partition start with a gap of 4M.
Maybe this is also some explanation of why the image lost the counting at the end..missing one block.
Are you saying that mmcblk0p1 must start on 0 instead of 8192?
tc@box:~$ sudo fdisk -l /dev/mmcblk0
Disk /dev/mmcblk0: 7.3 GiB, 7780433920 bytes, 15196160 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0009bf4f
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 8192 69631 61440 30M c W95 FAT32 (LBA)
/dev/mmcblk0p2 69648 11788415 11718768 5.6G 83 Linux
tc@box:~$
-
Not must, but you loose 4M at start of partition.
You could also start with 1s, to specify the first sector. when sector size=512
I am continue on my path to test out my theory.
Using following after the image dd maked and parted with parted.
sudo losetup -o $((512*1)) /dev/loop0 image.img
mkdir sdimg
sudo mkfs.vfat /dev/loop0
sudo dosfslabel /dev/loop0 RASPBOOT
sudo mount /dev/loop0 sdimg
Picture says more :)
(http://forum.tinycorelinux.net/index.php?action=dlattach;topic=20712.0;attach=4739)
-
Raspbian starts at 8192 also to leave room for the BOOT at the beginning of card. Just for curiosity you can try to repartition it starting at the very beginning and see wheter it boots or not. Let me know the result. I have never tried :)
-
Okey lets see.
parted 2017-01-11-raspbian-jessie.img print
Model: (file)
Disk 2017-01-11-raspbian-jessie.img: 4372MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 4194kB 70.3MB 66.1MB primary fat32 lba
2 70.3MB 4372MB 4301MB primary ext4
parted piCore-8.1.5.img print
Model: (file)
Disk piCore-8.1.5/piCore-8.1.5.img: 46.1MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 4194kB 35.7MB 31.5MB primary fat16 lba
2 35.7MB 46.1MB 10.5MB primary ext4
You are absolutely right.
Haven't thought about this with raspbian.
-
If you format a SD Card with SD Card for matter from the SD Card association, it will start at 8192. (At least for cards over 2 or 4GB)
-
Sorry to start this thread again, but I've been thinking about this a lot.
I think I know why the partition starts two sectors away.
It is so that the boot code will have space for MBR.
Now when you run with a fat partition on a raspberry pi that does not require any boot code.
I think you can start the partition much earlier.
-
You can try it, verify your idea and share result with us :)