Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

12
  • 146
    This will wipe out your current drive !! Commented Jan 26, 2019 at 2:03
  • 1
    @Kosta you must run the command as a superuser (i.e. sudo) Commented May 13, 2019 at 12:54
  • 4
    @SudarP it wipes out the /dev/sdb1 device. Not your current. Just execute if you are sure of what you are doing (linux.die.net/man/8/mkfs.ext4) Commented Aug 2, 2019 at 7:56
  • 1
    @tremendows, rudimeier: I agree that the command is appropriate for the OP, but also agree with SudarP that a command like this that can mess up an existing filesystem should come with a prominent warning. Other people reading question may have intended /dev/sdc1 or somesuch and could seriously regret executing this command. Commented May 23, 2020 at 12:28
  • 1
    It's important to mention that the "device" that gets wiped is only the partition that is selected, not the entire drive. So mkfs.ext4 /dev/sda4 will keep sda1-sda3 intact. So, as clarified, it will not wipe your current drive, unless you attempt to wipe it by missing to provide the device number in the command, in which case a prompt will ask for confirmation. Commented May 11, 2022 at 18:13