element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Avnet Boards Forums
  • Products
  • Dev Tools
  • Avnet Boards Community
  • Avnet Boards Forums
  • More
  • Cancel
Avnet Boards Forums
Avnet Boards General Reformat SD Card from petaLinux
  • Forum
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Avnet Boards Forums to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 1 reply
  • Subscribers 336 subscribers
  • Views 826 views
  • Users 0 members are here
Related

Reformat SD Card from petaLinux

Former Member
Former Member over 10 years ago

Hello. I believe an SD card has become corrupt, as the Microzed doesn't boot up properly anymore. Normally, I'd just take it out, stick it into a card reader on windows or linux machine, and reformat it, but I cannot do that (I'm in a very controlled area, and card readers are not permitted, nor is removing the sd card from a controlled area).

I have several working Microzeds right beside it, and what I can do is boot up one microzed, hot swap the SD cards, and then use SSH2 to log into the petaLinux console. At this point, I tried remounting the SD card and using FTP to reload all of the files, but that still did not work. Is there a way to reformat the SD card, in petaLinux running on the Microzed?

I tried the fdisk command on /dev/mmcblk0, but I was not entirely sure what commands to write, and also when I type "w" (the "finalize and exit command"), it says that the reformatting was not successful.

Any ideas?

  • Sign in to reply
  • Cancel
  • Former Member
    0 Former Member over 10 years ago

    Hi,

    I haven't tried this specifically, but if you can get PetaLinux (or any Linux) running from memory on the board, you should be able to repartition and format the microSD card using the same procedure we use to format eMMC memory.  Here's the process:

    1. Log into (Peta)Linux as root

    2. Check that the microSD card is registered with the controller:  ls /dev/mmc*

    You should see /dev/mmcblk0 at least, and possibly /dev/mmcblk0p1 if your card is not too badly damaged. 

    3. Use the Linux fdisk facility to create a new partition:  fdisk /dev/mmcblk0

    This should give you a command prompt for fdisk.

    4. At the fdisk command prompt, create a new partition:  n

    5. Create a primary partition:  p

    6. Partition number:  1

    7:  First cylinder:  1

    8:  Last cylinder:  Response here depends on the card.  You can take the default, or look at the information that comes on the command line to specify a size.  For example, for an eMMC on the PicoZed, we say +128M to set up 128 MB of memory.  You probably want something much larger on your microSD card, but you can play around here to find something that works for you.

    9. Write the partition:  w

    If this works, fdisk should tell you the partition table has been altered.  you should now have a new partition 1 on the blk0 device that we will reference in the final command.   The last thing you need to do is format the partition as FAT32, which you can also do from the Linux command line:

    mkdosfs -F 32  /dev/mmcblk0p1

    Give that a try and see how that works for you. 

    Ron

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube