I purchased an external drive (250GB) and would like to format ext3 to use for back-ups or additional storage. Since, I'm new to Linux not sure how to start the process. Any help would be greatly appreciated...
Daniel Jensen writes:
I purchased an external drive (250GB) and would like to format ext3 to use for back-ups or additional storage. Since, I'm new to Linux not sure how to start the process. Any help would be greatly appreciated...
Before you go that route, see if there's an easier way. It's fairly likely that the drive is already formatted as a FAT filesystem. Also, I presume that by "external drive" you mean a USB drive.
Plug that drive in, and see what happens. Chances are that an icon will pop up for your new drive, which you can simply open, and you're ready to go.
Unless you have some specific reason to use an external ext3-formatted drive, you might just find that the way things work by default is perfectly usable for you.
You can always screw around with it later, but why make life difficult for yourself, if the defaults work out just fine?
On Friday 23 March 2007, Daniel Jensen wrote:
I purchased an external drive (250GB) and would like to format ext3 to use for back-ups or additional storage. Since, I'm new to Linux not sure how to start the process. Any help would be greatly appreciated...
First, do a 'df' from a shell, which will show you the currently mounted drives so that you can make sure you are not accidentally formatting your system drive as that might be embarrasing.
Then start a "tail -f /var/log/messages" so you can watch it in real time as you plug this drive in.
Note where the drive shows up this tail of the messages log when you plug it in. Cancel any automount requestor's thrown up.
The find a shell, become root and do 'fdisk /dev/name-from-messages-log', where this name-from-messages-log will probably something in the sda through sdf set of devices. We'll use sdb here since sda has a small chance of being the system drive if all your internal drives are SATA drives.
When its up, hit p once to see what the drives says it is now. Probably some M$ format. I'd assume it only has one partition showing so hit a 't'. fdisk will ask you for the partition number, give it a 1 for the first one, and a new partition type number, and linux ext2/3 is a type 83 so enter that and hit the return. Do another 'p' and verify it was changed correctly. If it was, hit 'w' which will actually do the write to the drive and exit after doing a synch operation so the kernel knows it has this new partition. If it doesn't exit, hit a 'q' and it should.
Now its an ext drive, but its not yet formatted, so, Still as root, do:
mke2fs -j /dev/name-from-messages-log but append a 1 to the devicename to indicate the first partition.
This will install the ext3 filesystem on that partition.
Now its a mountable drive/partition, so do:
mkdir /mnt/sdb1 <make this the same name as above but with the partition #
And then:
mount -t ext3 /dev/sdb1 /mnt/sdb1
Now the drive should be usable, and its capacity should show up as a new entry in the 'df' report when a df is run.
HTH
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Daniel Jensen a écrit : | I purchased an external drive (250GB) and would like to format ext3 to | use for back-ups or additional storage. Since, I'm new to Linux not | sure how to start the process. Any help would be greatly appreciated... |
Have you any reason why you want to change the file system on your drive? Usually these HD ara M$ formatted and so they can be use on every computer (sigh), so if you want to use it to make some exchange from your computer with a M$ one, you'd better keep it as it is.
If you want it linux file system formatted it is quite easy to do (remember also that you will loose about 5% if you format in ext3, because of the journal, do you need ext3?):
plug your drive, execute the df command to see on which device it is mounted. Assuming this device is /dev/sdd1 (df will return something like:
/dev/sdd1 <some numbers...> /media/usbdisk)
execute: umount /media/usbdisk
then: mkfs.ext3 /dev/sdd1
That's all
If you want to partition your disk, use fdisk, sfdisk, whatever... before formating each partition you have created. If you want to make exchanges with M$ systems, you culd format a partition of your drive as a M$ file system (mkfs.msdos)
- -- François Patte UFR de mathématiques et informatique Université René Descartes http://www.math-info.univ-paris5.fr/~patte
Before you go that route, see if there's an easier way. It's fairly likely that the drive is already formatted as a FAT filesystem. Also, I presume that by "external drive" you mean a USB drive.
I think these days it is more likely that it is formatted NTFS than FAT32. FAT32 doesn't support very large volume AFAIK.
So I would suggest first finding out what it is currently formatted as. (You can do this under linux or windows, but probably easier under windows if it is NTFS as FC does not support this out the box. Under XP just plug it, right click on the icon and check out its properties).
The other question is what do you want to do with this disk ? If you are going to use it 100% ONLY under linux, and reformatting it as ext3 is probably a good idea. If you wish to share it because OSes (linux, windows, MacOS) then you will need to use a format all support.
ext3 : Native under linux, third party drivers exist for windows. Not native in Mac OS (never really understood why..) but again I believe third party packages exist
ntfs : native in windows, read support stable for linux. read/write for linux available but rather new, so stability not so certain. I guess native in MacOS ?
fat32 : generally works read/write everywhere, but unfortunately does really support the big drives these days.
I recently went through this myself. Since I use linux most of the time, with very occasional win XP, I choose to use ext3.
Chris
François Patte wrote:
If you want it linux file system formatted it is quite easy to do (remember also that you will loose about 5% if you format in ext3, because of the journal, do you need ext3?):
That's not right. A default journal size on an ext3 drive is 0.4% of the drive which is nothing.
The reason you lose 5% of an ext2/3 drive by default is because it is reserved solely for use by root. This is so that if you drive is filled by a user you can still go in as root and have some space to help clean things up without losing any data. It also helps to reduce fragmentation in your data (which gets much worse as the drive nears becoming completely full).
If you don't want to create this reserved space then use the -m flag to mke2fs to reduce it as low as you like.
Simon.
On Thu, 2007-04-12 at 14:11 +0100, Simon Andrews wrote:
François Patte wrote:
If you want it linux file system formatted it is quite easy to do (remember also that you will loose about 5% if you format in ext3, because of the journal, do you need ext3?):
That's not right. A default journal size on an ext3 drive is 0.4% of the drive which is nothing.
The reason you lose 5% of an ext2/3 drive by default is because it is reserved solely for use by root. This is so that if you drive is filled by a user you can still go in as root and have some space to help clean things up without losing any data. It also helps to reduce fragmentation in your data (which gets much worse as the drive nears becoming completely full).
a friend did that to an old Unisys 5000/80 I bought. He had some sortof log running that ate up the monster harddrive that thing had, and there was suddenly no room for the tmp logging to occur and the entire machine went south. Sure, I could have called in the Sperry-Unisys guys but one hour of their time was more than the monster was worth at surplus. Another friend hauled it off to make a gun rack out of the cabinet, as it had a locking door and he had a warped sense of humor. :) Ric