# [SOLVED] External Harddrive XFS "Structure needs cleaning"

## baschni

Hi there!

Today I got my external harddrive which I just installed and formated with XFS. Then I wanted to backup some files from other harddrives and copied it to the harddrive, about 300 GB. On the last files it suddenly said: "cp: cannot create directory ... Structure needs cleaning". What does that mean   :Embarassed:  ?

Is XFS a good filesystem for external harddrives? Is it normal that these drives are shown at the /dev/sd* tree instead of /dev/hd*?

Yours

baschniLast edited by baschni on Mon Nov 19, 2007 4:31 pm; edited 1 time in total

----------

## baschni

I think i found it: XFS seems not to work with UTF8 special characters, like german letters. Is that right?

----------

## baschni

no it isn't ... still getting the error

----------

## termite

have you run fsck on it?

----------

## Akkara

fsck doesn't do anything on xfs.

Use xfs_check to check whether there's a problem.

Use xfs_repair to fix it.

They are both available in sys-fs/xfsprogs

Good luck!

----------

## baschni

 *Quote:*   

> localhost surgeon # xfs_check /dev/sdf
> 
> bad magic # 0xa5000000 in inobt block 6/3
> 
> agi_count 4672, counted 0 in ag 6
> ...

 

bad magic? Have to fight the evil   :Evil or Very Mad: 

Well, what does that mean? It's not a hardware problem, is it *hopefully*

Greetings

baschni

----------

## Akkara

 *Quote:*   

> Well, what does that mean?

 

It means the filesystem is somewhat corrupted.  Use xfs_repair to fix it. Then check your copy to be sure your files made it over OK.

You say this is a new drive?  Make sure that the cables are well-seated and if it needs an external power unit, that it is making good connection.

Does dmesg report anything unusual when trying to copy?

Sometimes an external drive will automatically spin down, and the kernel doesn't try to spin it back up. This can cause corruption if there's still buffers that need to be flushed.  Similar to what's reported in this thread.

Does the drive use an external power source?  If it has an option to use one, try it.  Sometimes drives can overload a usb's power capability.

Or it could mean the usb port you're using is bad or maybe the drive itself is bad.

----------

## baschni

hehe, i found the problem^^

I just decided to switch back to ext3... when i started fdisk and noticed there were no partitions on the disk! I had created it, but i didn't quit fdisk with w...

I just formatted a partitionless disk, try that! And that explains, why i always mounted /dev/sdf and not /dev/sdf1^^

----------

