LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 03-07-2006, 11:32 AM   #1
xushi
Senior Member
 
Registered: Jun 2003
Location: UK
Distribution: Gentoo
Posts: 1,288

Rep: Reputation: 45
Exclamation partitioning a new drive


Hi all.

I just got a new 300Gb IDE hard drive, of which i'm externally attaching to my laptop through USB2. But when i attach it, and try to use cfdisk or fdisk they both say they can't see it. my dmesg is as follows,

Code:
usb-storage: waiting for device to settle before scanning
  Vendor: WDC WD30  Model: 10KB-01KGA1 ! !   Rev:  0 0
  Type:   Direct-Access                      ANSI SCSI revision: 00
SCSI device sdb: 602849584 512-byte hdwr sectors (308659 MB)
sdb: assuming drive cache: write through
SCSI device sdb: 602849584 512-byte hdwr sectors (308659 MB)
sdb: assuming drive cache: write through
 sdb:<6>sd 15:0:0:0: SCSI error: return code = 0x8000002
sdb: Current: sense key=0xb
    ASC=0x8 ASCQ=0x3
end_request: I/O error, dev sdb, sector 0
Buffer I/O error on device sdb, logical block 0
sd 15:0:0:0: SCSI error: return code = 0x8000002
sdb: Current: sense key=0xb
    ASC=0x8 ASCQ=0x3
end_request: I/O error, dev sdb, sector 0
Buffer I/O error on device sdb, logical block 0
 unable to read partition table
sd 15:0:0:0: Attached scsi disk sdb
sd 15:0:0:0: Attached scsi generic sg1 type 0
usb-storage: device scan complete
sd 15:0:0:0: SCSI error: return code = 0x8000002
sdb: Current: sense key=0xb
    ASC=0x8 ASCQ=0x3
end_request: I/O error, dev sdb, sector 0
Buffer I/O error on device sdb, logical block 0
sd 15:0:0:0: SCSI error: return code = 0x8000002
sdb: Current: sense key=0xb
    ASC=0x8 ASCQ=0x3
end_request: I/O error, dev sdb, sector 8
Buffer I/O error on device sdb, logical block 1
sd 15:0:0:0: SCSI error: return code = 0x8000002
sdb: Current: sense key=0xb
    ASC=0x8 ASCQ=0x3
end_request: I/O error, dev sdb, sector 0
Buffer I/O error on device sdb, logical block 0
Code:
 # fdisk /dev/sdb

Unable to read /dev/sdb

I'm not sure what i'm missing.


One more thing, slightly off topic, when i make a partition, what is your recommendation for the choice of file system type? The hard drive will include ~150 Gb of small files at an avarage of 5Mb each, and the rest of the ~150Gb large files of an avarage of 350 & 700Mb.

is ext3 good for that ?

Thanks.


Edit: some extra info
Code:
 # hdparm /dev/sdb

/dev/sdb:
 readonly     =  0 (off)
 readahead    = 256 (on)
 geometry     = 32216/64/32, sectors = 308658987008, start = 0

Last edited by xushi; 03-07-2006 at 11:34 AM.
 
Old 03-07-2006, 12:52 PM   #2
nadroj
Senior Member
 
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,539

Rep: Reputation: 60
does fsck on the device give any useful information?

i searched around and afew things to check for are drivers for the disk (probably unlikely, as it seems to recognize it, right?) or replace the IDE cable.

not sure what else to say but check the results here, as you probably already have.
 
Old 03-08-2006, 06:19 AM   #3
xushi
Senior Member
 
Registered: Jun 2003
Location: UK
Distribution: Gentoo
Posts: 1,288

Original Poster
Rep: Reputation: 45
Thanks. Just incase i stuck it on my friend's Win laptop, and he used partition magic to sort it out.

I guess i'll use ext3 on it for now, seing as how that's the FS i used most and am most familiar, unless anyone else has any other recommendations.
 
Old 03-08-2006, 06:30 AM   #4
kevkim55
Member
 
Registered: Dec 2005
Location: Edmonton
Distribution: BLFS, Gentoo
Posts: 353

Rep: Reputation: 32
I'd suggest reiserfs as it works faster compared to ext2/3. Creating a partition of ~150GB for files about 5MB - I think it would be better to create 2-3 partitions of smaller size as this would make the filesystem more managable and faster too.
 
Old 03-10-2006, 11:00 AM   #5
xushi
Senior Member
 
Registered: Jun 2003
Location: UK
Distribution: Gentoo
Posts: 1,288

Original Poster
Rep: Reputation: 45
Thanks Kevkim55,

Unfortunately I hate ending up in ~10 partitions to manage data. I prefer to have a limit of 1 partition to 1 drive i have. It's easier to manage my data, and not to worry if this file is too big to fit in partition X or Y when they become full.

I'll give reiserfs a readthrough. Sounds like its good

Last edited by xushi; 03-10-2006 at 11:02 AM.
 
Old 04-03-2006, 04:00 AM   #6
xushi
Senior Member
 
Registered: Jun 2003
Location: UK
Distribution: Gentoo
Posts: 1,288

Original Poster
Rep: Reputation: 45
So i was minding my own business yesterday, when suddenly out of the blue the ext3 journal fails on me.. after hours of fsck recovery, it loses over 50 gigs of data, and the rest sticks in lost+found/ with bogus numbers for names... I've managed to recover the movies by renaming them, but there's no way i can do that with 130 gigs of music =/ So.. any ideas to why the @#$$ ^%$#@@ this happened in the first place?

So i wouldn't mind taking some advice again... Should i stick to ext3 and hope this doesn't happen again? Or should i move to a better (in some terms) file system? Does reiserfs or jfs have protection against such corruptions?

I'm basically looking for a rock solid file system that can recover itself incase something bad like this happens.. And can hold hundreds of thousands of files on a 300Gb partition. Any advice?

Thanks!

edit:
reading a bit on ext3 in http://en.wikipedia.org/wiki/Ext3 and http://en.wikipedia.org/wiki/Comparison_of_file_systems.

From what i see, ext3 is indeed quite strong, especially for data recovery.. hmm, what are your oppinions?

edit2:
ok.. more research shows me that ext3 is indeed a trouble maker.. here's what i got from #slackman
Quote:
ReiserFS 3.6 works fine here. I have heard mostly positive things about XFS. JFS is light in terms of CPU usage, but I cannot say much more about it. JFS is special so that it uses NLS modules; you can change the character encoding of the filesystem with mount options.
But NLS also means that if you specify e.g. iocharset=utf-8, you cannot save a file with a name that is invalid UTF-8 string.

Last edited by xushi; 04-03-2006 at 05:06 PM.
 
Old 04-03-2006, 11:12 PM   #7
Sören Schneider
Member
 
Registered: Apr 2005
Location: Brazil
Distribution: SUSE 9.0 Pro, SUSE OSS 10.0, KDE 3.4.2
Posts: 156

Rep: Reputation: 30
I would use ReiserFS, because the FSCheck is much faster.
To recover files i recomend Foremost.
See what I did:

http://www.linuxquestions.org/questi...d.php?t=428962

Sören
 
Old 04-22-2006, 04:37 AM   #8
xushi
Senior Member
 
Registered: Jun 2003
Location: UK
Distribution: Gentoo
Posts: 1,288

Original Poster
Rep: Reputation: 45
A small update to anyone reading this thread.

Here's a post on osnews today that has a nice review of different filesystems.
http://osnews.com/comment.php?news_id=14400
and the article
http://www.debian-administration.org/articles/388

In short, ext3 is best for reliability and recovery, and ReiserFS is also good (with some speculation).

And here's a thread about fragmentation with two small scripts to scan and defrag respectively,
http://forums.gentoo.org/viewtopic-t-429915.html
 
Old 04-22-2006, 05:40 AM   #9
Electro
LQ Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
I strongly do not recommend using ReiserFS. EXT3 is fine for USB. FAT32 is better for portability.

Before removing the drive, make sure you run sync and then run umount to unmount it.

From the logs. It looks like the drive is bad.
 
Old 04-24-2006, 03:59 AM   #10
xushi
Senior Member
 
Registered: Jun 2003
Location: UK
Distribution: Gentoo
Posts: 1,288

Original Poster
Rep: Reputation: 45
Quote:
Originally Posted by Electro
From the logs. It looks like the drive is bad.
Physically?

Here's what i get everytime i stick it in... note: i have ext3 on it at the moment, nothing to do with NTFS or FAT ..

Code:
ieee1394: The root node is not cycle master capable; selecting a new root node and resetting...
ieee1394: Node added: ID:BUS[0-00:1023]  GUID[0050770e00071002]
ieee1394: Node changed: 0-00:1023 -> 0-01:1023
scsi2 : SBP-2 IEEE-1394
ieee1394: sbp2: Logged into SBP-2 device
ieee1394: Node 0-00:1023: Max speed [S400] - Max payload [2048]
  Vendor: WDC WD30  Model: 00JB-00KFA0       Rev:     
  Type:   Direct-Access-RBC                  ANSI SCSI revision: 04
SCSI device sdb: 586072368 512-byte hdwr sectors (300069 MB)
sdb: Write Protect is off
sdb: Mode Sense: 00 13 00 00
SCSI device sdb: drive cache: write back
SCSI device sdb: 586072368 512-byte hdwr sectors (300069 MB)
sdb: Write Protect is off
sdb: Mode Sense: 00 13 00 00
SCSI device sdb: drive cache: write back
 sdb: sdb1
sd 2:0:0:0: Attached scsi disk sdb
sd 2:0:0:0: Attached scsi generic sg1 type 14
UDF-fs: No partition found (1)
Unable to identify CD-ROM format.
FAT: bogus number of reserved sectors
VFS: Can't find a valid FAT filesystem on dev sdb1.
NTFS-fs error (device sdb1): read_ntfs_boot_sector(): Primary boot sector is invalid.
NTFS-fs error (device sdb1): read_ntfs_boot_sector(): Mount option errors=recover not used. Aborting without trying to recover.
NTFS-fs error (device sdb1): ntfs_fill_super(): Not an NTFS volume.
ext3: No journal on filesystem on sdb1
localhost ~ #
and on mount,
/dev/sdb1 on /media/sdb1 type ext2 (rw,noexec,nosuid,nodev)

I can read/write into it, and i can see the content, but it's still strange to me to see all that... and very strange at the fact that it's being mounted as ext2. I ran another fsck on it and it reported no problems.

Last edited by xushi; 04-24-2006 at 04:01 AM.
 
Old 04-24-2006, 04:32 AM   #11
Electro
LQ Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
The message "ext3: No journal on filesystem on sdb1" is your problem. By default mke2fs formats with out journal. You need to include the -j option to format EXT2 with journal which will be EXT3. You can turn an extisting EXT2 into EXT3 (EXT2 with journal) by doing 'tune2fs -j /dev/sdb1' as root. Hopefully, it does not corrupt your files in the process.
 
Old 04-24-2006, 05:50 AM   #12
xushi
Senior Member
 
Registered: Jun 2003
Location: UK
Distribution: Gentoo
Posts: 1,288

Original Poster
Rep: Reputation: 45
Thanks. That brought it back to ext3. I still have that weird message in dmesg though,

Code:
SCSI device sdb: drive cache: write back
 sdb: sdb1
sd 3:0:0:0: Attached scsi disk sdb
sd 3:0:0:0: Attached scsi generic sg1 type 14
UDF-fs: No partition found (1)
Unable to identify CD-ROM format.
FAT: bogus number of reserved sectors
VFS: Can't find a valid FAT filesystem on dev sdb1.
NTFS-fs error (device sdb1): read_ntfs_boot_sector(): Primary boot sector is invalid.
NTFS-fs error (device sdb1): read_ntfs_boot_sector(): Mount option errors=recover not used. Aborting without trying to recover.
NTFS-fs error (device sdb1): ntfs_fill_super(): Not an NTFS volume.
kjournald starting.  Commit interval 5 seconds
EXT3 FS on sdb1, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
localhost ~ #
 
Old 04-24-2006, 06:54 AM   #13
kevkim55
Member
 
Registered: Dec 2005
Location: Edmonton
Distribution: BLFS, Gentoo
Posts: 353

Rep: Reputation: 32
What does 'fdisk -l /dev/sdb' tells you ?
 
Old 04-24-2006, 08:34 AM   #14
xushi
Senior Member
 
Registered: Jun 2003
Location: UK
Distribution: Gentoo
Posts: 1,288

Original Poster
Rep: Reputation: 45
Quote:
Originally Posted by kevkim55
What does 'fdisk -l /dev/sdb' tells you ?
Code:
localhost ~ # fdisk -l /dev/sdb

Disk /dev/sdb: 300.0 GB, 300069052416 bytes
255 heads, 63 sectors/track, 36481 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       36481   293033601    6  FAT16
Code:
localhost ~ # hdparm /dev/sdb

/dev/sdb:
 readonly     =  0 (off)
 readahead    = 256 (on)
 geometry     = 36481/255/63, sectors = 586072368, start = 0
Code:
localhost ~ # hdparm /dev/sdb1

/dev/sdb1:
 readonly     =  0 (off)
 readahead    = 256 (on)
 geometry     = 36481/255/63, sectors = 586067202, start = 63
And strange, even cfdisk reports sdb1 as FAT16 ... ?! 3 letters.. w, t, f ? heh.
 
Old 04-25-2006, 01:06 AM   #15
kevkim55
Member
 
Registered: Dec 2005
Location: Edmonton
Distribution: BLFS, Gentoo
Posts: 353

Rep: Reputation: 32
Formatting a partition with a filesystem other than what it was before, doesn't automatically change the partition type to the desired type.

Run 'fdisk /dev/sdb' which, will drop you to fdisk prompt. Then at the fdisk prompt type the letter 'p' and hit enter. This will show you the partitions list which, is the same as running 'fdisk -l /dev/sdb'. You would see that the partition type listed is FAT16 as your previous posting shows. Now, type the letter 't' and hit Enter. This will ask you the partition number for which you want to chnge the partition type. Enter the number '1' and hit enter as, you wanna change the partition type of partition type sdb1. Now, it would ask you to enter the parition type identifier. Enter the number '83' and hit enter. This would change the partition type to linux type viz, ext3, reiserfs, ext2.....

To ensure you followed the instructions correctly, type the letter 'p' followed by enter again, to get the listing. This time all the details should be the same except, the partition type which shall be '83' "Linux Native". If you have come this far, all is well.

Now, it is time to save the modifications. Type the letter 'w' followed by enter. This would write the partition table to the disk thus, saving changes that you have made and quit the fdisk prompt automatically, dropping you to shell prompt.

Next time you mount the disk, there will be no errors and the partition is mounted quicker compared to the case where, the partition type was FAT16.

If you've got anything important on the disk, back it up, just to be sure. This would save trouble, should you do anything wrong at the fdisk prompt.

Good luck !
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
drive partitioning barleykorn Linux - Hardware 3 11-16-2005 08:34 PM
Partitioning Hard Drive - Help simplyskate Slackware - Installation 13 07-04-2005 08:23 AM
Drive Partitioning BiPolar Linux - General 8 04-01-2005 01:44 AM
Re partitioning a drive DiabloDan Linux - Software 12 06-18-2003 09:42 PM
Partitioning new drive ander45 Linux - Software 1 02-09-2002 05:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 03:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration