LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   formatting my external hard drive (https://www.linuxquestions.org/questions/linux-newbie-8/formatting-my-external-hard-drive-512775/)

twelvenine 12-22-2006 12:23 AM

formatting my external hard drive
 
i have this external hard drive and i want to use it to back up some files from my linux box, which can't write ntfs. the external drive is broken into two partitions(sda1 and sda2), both are ntfs.

i want to take one of the partitions(sda1) and format it in something that linux can write to(i'm thinking fat32), so i can store files from my linux box on it. My probelm is that i'm not sure how to go about doing this without messing up the other partition on the drive. i thought i would start by using cfdisk to change sda1 to a linux partition, then mkfs to write a new filesystem, but i'm afraid that re-writing the partition table will damage sda2. am i going about this correctly?

my memory is fuzzy on this, but i think i may have done something like this before during a linux install: even though i had only changed one partition, re-writing that partition table caused some problems with another drive partition.

Electro 12-22-2006 12:41 AM

The partition table can be re-written several times with out the data be affected. The partition table just gives the OS where a partition starts and ends using cylinders. Use sfdisk to help you backup the information of present partition table, so you revert to the partition table where you started from.

Use mkdosfs to format the desire partition to FAT32 and make sure you specify -F32 or else it still going to be FAT16. Double check the syntax of mkdosfs before hitting enter.

Bruce Hill 12-22-2006 01:03 AM

If you issue "fdisk -l" as root you can double check your partitions.

Then if you want to change the label of the partition, use "cfdisk /dev/sda"
and change it to type "0C W95 FAT32 (LBA)".

If you want to format /dev/sda1 as FAT32 (both Windows and Linux can write):
Code:

/sbin/mkdosfs -F32 -v /dev/sda1
will do the job just fine.

JZL240I-U 12-22-2006 07:02 AM

If you use it for linux backups only (you didn't specify in the OP) I'd suggest a linux file system e.g. like ext3, since FAT doesn't store the permissions and owner attributes.

twelvenine 12-22-2006 07:11 PM

sounds good, thanks for the help :)

Electro 12-22-2006 10:50 PM

If you want to have access to your files with out Linux and using FAT32 as the filesystem, but still keep the Linux permissions, use tar or dar.

archtoad6 12-24-2006 02:21 PM

If you're really worried about your partition table, check out sfdisk w/ the "-d" option. (See man sfdisk.)

JZL240I-U 12-27-2006 02:53 AM

Quote:

Originally Posted by Electro
If you want to have access to your files with out Linux and using FAT32 as the filesystem, but still keep the Linux permissions, use tar or dar.

Whoa. Thanks for this one :).


All times are GMT -5. The time now is 04:48 AM.