≡ Menu

Linux format external USB hard disk Partition

Q. I have an external new hard drive connected using USB port under Red Hat Fedora Core Linux. I want to use it for backup. There are two partition /dev/sda1 and /dev/sda2. This hard disk was setup and formatted by friend under Windows XP (NTFS partition). Now I want to format and use one partition for Linux and another for Windows XP.

How do I format sda1 without losing data from /dev/sda2?

A. To format /dev/sda1 as Linux ext3 partition use command mkfs.ext3. It is used to create an ext2/ext3 filesystem

Type the command as follows:
# mkfs.ext3 /dev/sda1

Before hitting [enter] key make sure you double check partition device name (/dev/sda1). If unsure make backup of important data on USB pen or DVD disk.

Tweet itFacebook itGoogle+ itPDF itFound an error/typo on this page?

{ 15 comments… add one }

  • rocky March 16, 2007, 8:43 am

    Thanks a lot

  • norman March 27, 2007, 10:31 am

    I have put ubuntu onto a hard drive and would like to know if I could format it so I can use windows xp
    most obliged

  • Dan Saint-Andre August 7, 2007, 5:40 pm

    I have a usb drive without any partitions. Win-doze sees a drive but will not partition same. Linux sees the connect, but /dev/sdXX never gets created. Maybe it comes and goes, but there is nothing I can find.

    How do you access an empty hard drive out on a usb port?

  • lewis lipkin August 27, 2007, 8:46 pm

    Have you received any replies to your query?
    If so can you pass on the solution.

    Lew Lipkin

  • kasi September 26, 2007, 11:49 am

    I had a usb drive it was detecting under linux and windows ,but after some time it was not detected under windows, now i want to format the usb under knopix linux

  • Allen April 27, 2009, 2:32 am

    I have installed USB drive and created a single partition for data only. Everything seems to be working except my ability to move a file to the partition with a file name. Then I need the ability to extract that file or any file on the partition for the purpose of edit, then move back.

  • Vadim Motorine August 5, 2009, 1:39 pm

    Thanks a lot. It indeed works.

  • Mandy February 16, 2010, 5:09 pm

    Hi, I am a first time user on Ubuntu Linux and I am trying to format my USB Flash Drive. I am able to fdisk and type the format command mkfs.xxx /dev/sdb1 but then I get a long list of commands to choose from. I have no idae which one to choose. All I really want to do is format my USB, I want everything off.

    Please help. I honestly am lost.

    Thank you

  • Blerim February 22, 2010, 4:06 pm

    Hi,can someone tell me how to install two OS (first Linux is installed) now Windows,but my laptop dosnt have DVD-ROM?

  • charlie maaere February 28, 2010, 12:37 pm

    hey guys, to format a USB, Flash drive in Linux there is graphical tool created check this link



  • OhHenree March 4, 2010, 6:54 pm

    After a lot of deliberation I am finally getting off the procrastination and trying to migrate away from the MS arena; but even though the Linux crowd defend it so, I find the obscurity just as dark as windows. Upon reading this post I see other new users have run into the same problem I have and the time I have spent, together with the multiple Linux books leaves me still in the dark. Why is it so difficult to buy a sata drive, plug it into a usb port and set it up? Linux does not even detect it, or at least say “there’s something out there” – nothing. So I have to format it in the system I want to leave and then bring it to Linux just so it will acknowledge it. Oh and the wireless is just as difficult, WPA-personal allows for 16 characters in the text box to set it up, damn and my network was using 31 characters, break out the CAT5 and run the extensions down all the hallways “Its back to yesterdays technology!” – great.

  • Manshell July 20, 2010, 4:43 pm

    Hi, i installed Ubuntu in my external Hardisk and now i want to format it so the disk can be fully empty. How can i do it?
    Thanks in advanced

  • another September 20, 2010, 7:56 pm

    mkntfs -Q -v -L “DISKLABEL” /dev/sdc1

  • PitaJé December 19, 2010, 10:43 pm

    In ubuntu, you can use gparted to manage disk partitions via a gui.

    # sudo apt-get install gparted

  • swetha January 11, 2011, 6:45 am

    If a new hard disk is given to you what are the commands you use in
    order to make partition & format the hard disk in linux

Leave a Comment