Create bootable sd card with parted

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












0















I executed the following script to create a bootable SD card, but the raspberry pi doesn't boot. The sd cards are fine, they arrived today in the mail and badblocks found none. What am I missing?



#!/usr/bin/env sh
sudo parted --script /dev/sdb
mklabel msdos
mkpart primary fat32 1MiB 256MiB
mkpart primary ext4 256MiB 100%
set 1 boot on
set 1 lba on
sudo mkfs.vfat /dev/sdb1
sudo mkfs.ext4 /dev/sdb2


Edit: I checked the output of parted print and fdisk -l here are the results, they look fine to me.



The result if I execute fdisk -l is



Disk /dev/sdb: 29.8 GiB, 32010928128 bytes, 62521344 sectors
Disk model: SD/MMC/MS PRO
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: 0x93bfb447

Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 2048 524287 522240 255M c W95 FAT32 (LBA)
/dev/sdb2 524288 62521343 61997056 29.6G 83 Linux


The output of parted is



Model: Generic- SD/MMC/MS PRO (scsi)
Disk /dev/sdb: 32.0GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system Flags
1 1049kB 268MB 267MB primary boot, lba
2 268MB 32.0GB 31.7GB primary ext4


Edit: I follow this guide on the Alpine Wiki: https://wiki.alpinelinux.org/wiki/Classic_install_or_sys_mode_on_Raspberry_Pi#Preparation



Edit: I made some progress on trying. If I run the following script and copy the files it will boot.



sudo mkfs.fat /dev/sdb -I









share|improve this question
























  • Are you following some instructions to make the bootable SD card? You've formatted the SD card but not yet installed the bootloader or OS, it seems.

    – Kevin Kruse
    Feb 19 at 20:19











  • I do follow the instructions of the alpine wiki. I updated my question.

    – Knerd
    Feb 19 at 20:31















0















I executed the following script to create a bootable SD card, but the raspberry pi doesn't boot. The sd cards are fine, they arrived today in the mail and badblocks found none. What am I missing?



#!/usr/bin/env sh
sudo parted --script /dev/sdb
mklabel msdos
mkpart primary fat32 1MiB 256MiB
mkpart primary ext4 256MiB 100%
set 1 boot on
set 1 lba on
sudo mkfs.vfat /dev/sdb1
sudo mkfs.ext4 /dev/sdb2


Edit: I checked the output of parted print and fdisk -l here are the results, they look fine to me.



The result if I execute fdisk -l is



Disk /dev/sdb: 29.8 GiB, 32010928128 bytes, 62521344 sectors
Disk model: SD/MMC/MS PRO
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: 0x93bfb447

Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 2048 524287 522240 255M c W95 FAT32 (LBA)
/dev/sdb2 524288 62521343 61997056 29.6G 83 Linux


The output of parted is



Model: Generic- SD/MMC/MS PRO (scsi)
Disk /dev/sdb: 32.0GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system Flags
1 1049kB 268MB 267MB primary boot, lba
2 268MB 32.0GB 31.7GB primary ext4


Edit: I follow this guide on the Alpine Wiki: https://wiki.alpinelinux.org/wiki/Classic_install_or_sys_mode_on_Raspberry_Pi#Preparation



Edit: I made some progress on trying. If I run the following script and copy the files it will boot.



sudo mkfs.fat /dev/sdb -I









share|improve this question
























  • Are you following some instructions to make the bootable SD card? You've formatted the SD card but not yet installed the bootloader or OS, it seems.

    – Kevin Kruse
    Feb 19 at 20:19











  • I do follow the instructions of the alpine wiki. I updated my question.

    – Knerd
    Feb 19 at 20:31













0












0








0








I executed the following script to create a bootable SD card, but the raspberry pi doesn't boot. The sd cards are fine, they arrived today in the mail and badblocks found none. What am I missing?



#!/usr/bin/env sh
sudo parted --script /dev/sdb
mklabel msdos
mkpart primary fat32 1MiB 256MiB
mkpart primary ext4 256MiB 100%
set 1 boot on
set 1 lba on
sudo mkfs.vfat /dev/sdb1
sudo mkfs.ext4 /dev/sdb2


Edit: I checked the output of parted print and fdisk -l here are the results, they look fine to me.



The result if I execute fdisk -l is



Disk /dev/sdb: 29.8 GiB, 32010928128 bytes, 62521344 sectors
Disk model: SD/MMC/MS PRO
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: 0x93bfb447

Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 2048 524287 522240 255M c W95 FAT32 (LBA)
/dev/sdb2 524288 62521343 61997056 29.6G 83 Linux


The output of parted is



Model: Generic- SD/MMC/MS PRO (scsi)
Disk /dev/sdb: 32.0GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system Flags
1 1049kB 268MB 267MB primary boot, lba
2 268MB 32.0GB 31.7GB primary ext4


Edit: I follow this guide on the Alpine Wiki: https://wiki.alpinelinux.org/wiki/Classic_install_or_sys_mode_on_Raspberry_Pi#Preparation



Edit: I made some progress on trying. If I run the following script and copy the files it will boot.



sudo mkfs.fat /dev/sdb -I









share|improve this question
















I executed the following script to create a bootable SD card, but the raspberry pi doesn't boot. The sd cards are fine, they arrived today in the mail and badblocks found none. What am I missing?



#!/usr/bin/env sh
sudo parted --script /dev/sdb
mklabel msdos
mkpart primary fat32 1MiB 256MiB
mkpart primary ext4 256MiB 100%
set 1 boot on
set 1 lba on
sudo mkfs.vfat /dev/sdb1
sudo mkfs.ext4 /dev/sdb2


Edit: I checked the output of parted print and fdisk -l here are the results, they look fine to me.



The result if I execute fdisk -l is



Disk /dev/sdb: 29.8 GiB, 32010928128 bytes, 62521344 sectors
Disk model: SD/MMC/MS PRO
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: 0x93bfb447

Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 2048 524287 522240 255M c W95 FAT32 (LBA)
/dev/sdb2 524288 62521343 61997056 29.6G 83 Linux


The output of parted is



Model: Generic- SD/MMC/MS PRO (scsi)
Disk /dev/sdb: 32.0GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system Flags
1 1049kB 268MB 267MB primary boot, lba
2 268MB 32.0GB 31.7GB primary ext4


Edit: I follow this guide on the Alpine Wiki: https://wiki.alpinelinux.org/wiki/Classic_install_or_sys_mode_on_Raspberry_Pi#Preparation



Edit: I made some progress on trying. If I run the following script and copy the files it will boot.



sudo mkfs.fat /dev/sdb -I






linux raspberry-pi parted






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 19 at 22:39







Knerd

















asked Feb 19 at 16:01









KnerdKnerd

1011




1011












  • Are you following some instructions to make the bootable SD card? You've formatted the SD card but not yet installed the bootloader or OS, it seems.

    – Kevin Kruse
    Feb 19 at 20:19











  • I do follow the instructions of the alpine wiki. I updated my question.

    – Knerd
    Feb 19 at 20:31

















  • Are you following some instructions to make the bootable SD card? You've formatted the SD card but not yet installed the bootloader or OS, it seems.

    – Kevin Kruse
    Feb 19 at 20:19











  • I do follow the instructions of the alpine wiki. I updated my question.

    – Knerd
    Feb 19 at 20:31
















Are you following some instructions to make the bootable SD card? You've formatted the SD card but not yet installed the bootloader or OS, it seems.

– Kevin Kruse
Feb 19 at 20:19





Are you following some instructions to make the bootable SD card? You've formatted the SD card but not yet installed the bootloader or OS, it seems.

– Kevin Kruse
Feb 19 at 20:19













I do follow the instructions of the alpine wiki. I updated my question.

– Knerd
Feb 19 at 20:31





I do follow the instructions of the alpine wiki. I updated my question.

– Knerd
Feb 19 at 20:31










1 Answer
1






active

oldest

votes


















0














I found the issue. The script was completely fine. My sd card reader was a bit jacked after using a card with a ton of bad blocks.






share|improve this answer






















    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f501626%2fcreate-bootable-sd-card-with-parted%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    I found the issue. The script was completely fine. My sd card reader was a bit jacked after using a card with a ton of bad blocks.






    share|improve this answer



























      0














      I found the issue. The script was completely fine. My sd card reader was a bit jacked after using a card with a ton of bad blocks.






      share|improve this answer

























        0












        0








        0







        I found the issue. The script was completely fine. My sd card reader was a bit jacked after using a card with a ton of bad blocks.






        share|improve this answer













        I found the issue. The script was completely fine. My sd card reader was a bit jacked after using a card with a ton of bad blocks.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 4 at 6:36









        KnerdKnerd

        1011




        1011



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f501626%2fcreate-bootable-sd-card-with-parted%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown






            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Bahrain

            Postfix configuration issue with fips on centos 7; mailgun relay