[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Does the vfat partition need defrag under Gnu/Linux ?



On 2009-05-27_11:41:09, Hashimoto wrote:
> Hello,
> 
> I have an external disk actually using one vfat partition type, so I'm
> wondering if it's necessary to defrag it since I used to save and remove
> a lot and large files. 
> 
> Any suggestions ?

It sounds like the external disk is in active write/read use on a
Debian/GNU/Linux system. For me, this is a ligit. question on this
list. 

The disk has a vfat fs, so it probably could benefit from a defrag,
but let be suggest a solution that I have found quite workable:

IF, and this is a BIG IF, you never intend to unplug the disk from
your Debian box and plug it into a Microsoft Windows box, then you
should consider converting to ext3 or ext4 file system. It is easy
but the exact steps depend on details of how your Debian system is
configured. 

And, if someone else might 'borrow' your external drive for
'temporary' use on a Windows box, they might mistakenly think that it
is broken and try reformatting it, just to be 'helpful'. If, so, your
data will be lost. Consider your work environment carefully.

If you are running a recent Lenny installation, with Gnome as installed
by tasksel, then you can follow these steps:

1) Start with the disk plugged in and mounted so that there is a
visible icon for it on the desktop.

2) Copy ALL the files that you want to keep onto some other storage
medium, and check that they all got there correctly.

3) Run: cat /etc/mtab This will tell you the device name that the
system assigned to your disk when you plugged it in. It should be
something like /dev/sda1 or /dev/sdb1 Remember this.

4) Right-click on the disk icon and select unmount volume. The icon
should disappear. If it doesn't, there will be an error message 
about the disk being in use by a running program. Figure out what
program that is. Shut it down and try again to unmount volume. When
disk icon is gone, DO NOT unplug the disk! Instead do

5) Write a new file system onto the device name that you remember from
step (3), above. I give here the command for ext3:

mke2fs -j -L <put-your-label-here-16-characters-only>

Note: mke2fs has a lot of options, but -j and -L are enough in my
experience. Whatever you give as the volume label string will be used
as the mount point within /media/ . I use WDP-1, WDP-2, etc. for my
Western Digital Passport drives.

(If you got the dev-name wrong in step (3), you may be saved from
wiping some other disk of its data by virtue of that other disk still
being mounted, and the mke2fs program isn't supposed to touch mounted
volumes. Also, you can verify the device name because it is the one
that disappears from mtab, when you unmount your external drive.)

6) When mke2fs finishes (wait, be sure it is finished), unplug the newly
formatted disk, wait a few seconds and plug it in again. It should mount
automatically with it's new volume name. Copy the data back onto it
from wherever you saved it in step (2)

HTH
-- 
Paul E Condon           
pecondon@mesanetworks.net


Reply to: