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.

Want to read Linux tips and tricks, but don't have time to check our blog everyday? Subscribe to our daily email newsletter to make sure you don't miss a single tip/tricks. Subscribe to our weekly newsletter here!

{ 6 comments… read them below or add one }

1 rocky 03.16.07 at 8:43 am

Thanks a lot

2 norman 03.27.07 at 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
Norman

3 Dan Saint-Andre 08.07.07 at 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?

4 lewis lipkin 08.27.07 at 8:46 pm

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

Lew Lipkin

5 kasi 09.26.07 at 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

6 Allen 04.27.09 at 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.

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Previous post: Ubuntu Linux install or add php gd support to Apache

Next post: Mysql remove duplicate data or rows with DISTINCT