1

I want to do two partitions for my SD card with FAT and EXT4 using Ubuntu.

For this, I found two commands:

mkdosfs /dev/sda1 -n 
mke2fs /dev/sda1 -L

But how should I specify the size, for FAT I need 200MB and rest with EXT4.

When tried to give mkdosfs /dev/sda1 -n I got an error.

sudo mkdosfs /dev/sda
mkfs.fat 3.0.28 (2015-05-16)
mkdosfs: unable to open /dev/sda: Device or resource busy
simhumileco
  • 641
  • 1
  • 10
  • 16
Sijith
  • 111
  • 1
  • 1
    When I see `/dev/sda1` I'm thinking that you try to edit a partition on the drive, that your system is booted from. You should boot from one drive and edit partitions on another drive. If you boot from a live USB drive with Ubuntu, you can use `gparted`, which has a graphical user interface. It is quite easy to use in order to edit partitions and create file systems. – sudodus Mar 04 '19 at 09:21
  • I cross checked and its my sdcard only, even the size is showing correctly – Sijith Mar 04 '19 at 09:25
  • So your Ubuntu system is booted from another drive. Fine :-) `gparted` is already there in Ubuntu live, but in an installed system, you must install it, `sudo apt install gparted`. You must also unmount all partitions on the SD card before you start editing the partitions. – sudodus Mar 04 '19 at 09:28
  • 4
    Possible duplicate of [How to resize partitions?](https://askubuntu.com/questions/126153/how-to-resize-partitions) You must create partitions first, then you can create a filesystem in them. Or you can do it all in Gparted. If you want specific help for your situation, please [edit] your question to include the output of the `lsblk` command. – Melebius Mar 04 '19 at 11:56
  • Iam using VM and gparted is throwing error – Sijith Mar 05 '19 at 05:40
  • _What_ error? Please [edit] your question with specific information (e.g. screenshot of GParted and/or the `lsblk` output I requested earlier). – Melebius Mar 05 '19 at 06:54

0 Answers0