{"action":"created","issue":{"url":"https://api.github.com/repos/igorpecovnik/lib/issues/243","repository_url":"https://api.github.com/repos/igorpecovnik/lib","labels_url":"https://api.github.com/repos/igorpecovnik/lib/issues/243/labels{/name}","comments_url":"https://api.github.com/repos/igorpecovnik/lib/issues/243/comments","events_url":"https://api.github.com/repos/igorpecovnik/lib/issues/243/events","html_url":"https://github.com/igorpecovnik/lib/issues/243","id":143681477,"number":243,"title":"Modify partition resizing behaviour","user":{"login":"ThomasKaiser","id":12658961,"avatar_url":"https://avatars.githubusercontent.com/u/12658961?v=3","gravatar_id":"","url":"https://api.github.com/users/ThomasKaiser","html_url":"https://github.com/ThomasKaiser","followers_url":"https://api.github.com/users/ThomasKaiser/followers","following_url":"https://api.github.com/users/ThomasKaiser/following{/other_user}","gists_url":"https://api.github.com/users/ThomasKaiser/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasKaiser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasKaiser/subscriptions","organizations_url":"https://api.github.com/users/ThomasKaiser/orgs","repos_url":"https://api.github.com/users/ThomasKaiser/repos","events_url":"https://api.github.com/users/ThomasKaiser/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasKaiser/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-26T09:10:53Z","updated_at":"2016-03-26T09:55:05Z","closed_at":null,"body":"I'm currently playing around with different SD cards, partitioning and filesystem (settings). Being able to create a bunch of additional partitions on a card is therefore quite useable and Armbian's auto resizing gets in my way. I know that I can disable it completely (`touch /root/.no_rootfs_resize` as part of the customization) but my goal is to implement something a bit more fine grained.\r\n\r\nTwo questions:\r\n\r\n1) Is there a specific reason we still create a MBR partition table and not GPT?\r\n\r\n2) Same applies to the use of `fdisk` for the partition resizing in `firstrun` (most probably `parted` being outdated as hell in Wheezy ;) )?\r\n\r\nI though about switching to GPT and replacing the fdisk call with `parted /dev/mmcblk0 resizepart 1 yes $VALUE` instead. $VALUE defaults to `100%` and can be adjusted by creating `/root/.rootfs_resize` containing a string that will the be used by parted (eg. `50%`, `5000MiB` or `7577599s`). For compatibility reasons the existence of `/root/.no_rootfs_resize` still has higher priority.\r\n\r\nAnd I also thought about decreasing the default `100%` to `95%` when the size of the card in question is 4GB or below. What might sound absurd has a simple background. Using 2016 cards with 4GB or less is most probably a sign of 'o look, there's an old spare card lying around. Let's try Armbian with this'. Older cards are known to implement less superiour wear leveling and GC algorithms so by leaving a 5% spare area we help the card's controller in situations where users start to fill their cards to the max."},"comment":{"url":"https://api.github.com/repos/igorpecovnik/lib/issues/comments/201749476","html_url":"https://github.com/igorpecovnik/lib/issues/243#issuecomment-201749476","issue_url":"https://api.github.com/repos/igorpecovnik/lib/issues/243","id":201749476,"user":{"login":"zador-blood-stained","id":14262690,"avatar_url":"https://avatars.githubusercontent.com/u/14262690?v=3","gravatar_id":"","url":"https://api.github.com/users/zador-blood-stained","html_url":"https://github.com/zador-blood-stained","followers_url":"https://api.github.com/users/zador-blood-stained/followers","following_url":"https://api.github.com/users/zador-blood-stained/following{/other_user}","gists_url":"https://api.github.com/users/zador-blood-stained/gists{/gist_id}","starred_url":"https://api.github.com/users/zador-blood-stained/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zador-blood-stained/subscriptions","organizations_url":"https://api.github.com/users/zador-blood-stained/orgs","repos_url":"https://api.github.com/users/zador-blood-stained/repos","events_url":"https://api.github.com/users/zador-blood-stained/events{/privacy}","received_events_url":"https://api.github.com/users/zador-blood-stained/received_events","type":"User","site_admin":false},"created_at":"2016-03-26T09:55:05Z","updated_at":"2016-03-26T09:55:05Z","body":"> 1) Is there a specific reason we still create a MBR partition table and not GPT?\r\n\r\nLooks like [support for GPT partition tables in mainline u-boot](http://git.denx.de/?p=u-boot.git;a=blob;f=doc/README.gpt;hb=HEAD) is disabled by default for most devices (including sunxi-based). If all other u-boot versions (for other boards) support GPT, then you can switch to GPT at least for SD cards (NAND bootloader still will need MBR with first FAT partition I believe).\r\n\r\n\r\n> 2) Same applies to the use of fdisk for the partition resizing in firstrun (most probably parted being outdated as hell in Wheezy ;) )?\r\n\r\nWhat isn't outdated as hell in Wheezy?\r\n\r\n> Playing a bit around with it looks already pretty discouraging since it depends on the parted version used. \r\n\r\nI already tested it a while ago, newer parted versions have `resizepart` command and they accept partition size in percents, older have `resize` command (If I remember correctly)."}}