LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 10-04-2018, 06:54 AM   #1
Bledard
LQ Newbie
 
Registered: Oct 2018
Posts: 1

Rep: Reputation: Disabled
Exclamation command to format an sd card


Hello Guys,
I'm trying to format a sd card.
I'm using a embedded linux system.
i sent this command.
First Test:
> /bin/umount -l /dev/mmcblk0p1 --> unmount the Sd card.
> /sbin/mkdosfs -I /dev/mmcblk0p1

my device on this command answer :

mkfs.fat 3.0.26 (2014-03-07)
mkdosfs: unable to open /dev/mmcblk0p1: Device or resource busy

Second test
> bin/umount -l /dev/mmcblk0p1 --> unmount the Sd card.
> mkfs.fat -F 32 /dev/mmcblk0p1
Device answer:

mkfs.fat 3.0.26 (2014-03-07)
mkfs.fat: unable to open /dev/mmcblk0p1: Device or resource busy



What can i do?
how can i format my SD card from my system?
 
Old 10-04-2018, 07:20 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 24,985

Rep: Reputation: 5678Reputation: 5678Reputation: 5678Reputation: 5678Reputation: 5678Reputation: 5678Reputation: 5678Reputation: 5678Reputation: 5678Reputation: 5678Reputation: 5678
Welcome to LinuxQuestions.

What SBC are you running?

I assume your embedded system boots and runs from the SD card. If /dev/mmcblk0p1 is your /root partition it can not be unmounted and is why you see the "Device or resource busy" error message.

What are you trying to accomplish?

Last edited by michaelk; 10-04-2018 at 07:37 AM.
 
Old 10-04-2018, 07:40 AM   #3
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,068

Rep: Reputation: 7128Reputation: 7128Reputation: 7128Reputation: 7128Reputation: 7128Reputation: 7128Reputation: 7128Reputation: 7128Reputation: 7128Reputation: 7128Reputation: 7128
was there any respond to the umount command? Did you check the return code of it?
 
Old 10-04-2018, 11:51 AM   #4
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
yes, make sure it is NOT mounted, even if you have to pop it out the push it back in to engage it again, not letting a file manger mount it. also make sure that the tab is slid to write protection off.
 
Old 10-05-2018, 12:28 AM   #5
sdjf
LQ Newbie
 
Registered: Dec 2005
Location: California, United States
Distribution: Qtopia on Zaurus, ArchLinuxArm on RPi, Ubuntu variants on C.H.I.P.,
Posts: 6

Rep: Reputation: 0
I agree it will help to know what type of embedded hardware you are using and what operating system.

But the output I would most like to see is if you enter the "lsblk" command. It will show all block devices, along with their partitions, and whether they are mounted or not.

I am also not sure it is helpful to run "umount -l" instead of just plain "umount". Without the "-l", "umount" will tell you it cannot unmount because the partition on the card is being used.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Can't format micro sd card batabuntu Linux - Newbie 7 04-16-2015 12:41 AM
Any Linux command output to delimited format. Script should work for any command. torrelm@hotmail.com Linux - Newbie 9 09-04-2014 09:54 AM
[SOLVED] What does this command format mean? longli Linux - General 2 02-17-2011 06:40 PM
SD card format or init davidho3 Linux - Software 3 08-21-2009 08:39 AM
SD Card format problem drj000 Linux - Hardware 0 03-21-2005 12:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 05:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration