0

Hai

I bought a 1 TB new hard disk. When installed in linux it say's fsck.ext3 file system not found. when i checked the BIOS it detected the hard disk. what to do to solve the problem in linux?.

Thank you

wzzrd
  • 10,269
  • 2
  • 32
  • 47
  • Just to make things clear, this is a newly bought hard disk, on which noone has created any partitions or file systems? – andol Dec 05 '09 at 09:35
  • No file system was created –  Dec 05 '09 at 09:36
  • I think you need to provide a little more information on exactly what you are doing. What commands are you running, what does your /etc/fstab look like etc. – Roy Dec 05 '09 at 09:59

3 Answers3

5

If you say 'no filesystem was created', I suggest you use fdisk to create partition(s) and the mke2fs or a similar utility to create a filesystem. Filesystems do not magically appear; you need to create them.

More specifically, you run

fdisk -l

to check whether the disk is detected by the OS at all. Then you run

fdisk /dev/yourdisk

and create partition(s) with the appropriate commands. fdisk has a fine help function, but basically, you create a new partition with 'n', and fdisk will ask you for more information.

Then, you might have to run

partprobe /dev/yourdisk

to make sure Linux sees your new partition(s) correctly.

Then, at last, you run

mke2fs -j /dev/yourparition

on each created partition to create ext3 filesystems. For ext2, leave off the -j. But you can also use any mkfs.* utility available on your system.

Finally, add the new partition(s) to your /etc/fstab file, by adding (a) line(s) following this convention:

device     mountpoint   filesystem     filesystemoptions     fs_freq     fs_passno

So, for example:

/dev/sda1     /u01     ext2     defaults     1     2

and you're all done.

wzzrd
  • 10,269
  • 2
  • 32
  • 47
  • 1
    Shouldn't the last number be 2 on the fstab entry? As I understand it, it's rather important that the pass number is higher than the one set for root. – Roy Dec 05 '09 at 10:43
  • You are absolutely right. Missed that. +1 for you and edited my post. – wzzrd Dec 05 '09 at 10:55
  • 1
    Also, suggesting something else than ext2 for a modern 1TB harddrive might make better use of that disk. Perhaps XFS or something similar :) – pauska Dec 05 '09 at 11:52
  • ...and he probably does NOT want it mounted in boot. A safer example might be /export/disk2 – David Mackintosh Dec 05 '09 at 22:56
  • @pauska: I am not suggesting ext2, I am suggesting ext3, which makes perfect sense to me, as it is the default on virtually all distros today. I am merely telling what the -j option does. @David Mackintosh: the /etc/fstab snippet is an example, I am certainly not suggesting mounting a 1TB drive at boot. Where he wants it mounted is his thing to decide on. – wzzrd Dec 06 '09 at 07:54
  • ext3 is terribly inefficient for large partitions. XFS or ext4 are usually the recommended file systems unless you're running something mission critical that values ultra-stability over anything else. – Ophidian Dec 07 '09 at 14:53
  • In case someone visits this as a resource, an update: you should use flags -cu with fdisk: fdisk -cu /dev/sda to ensure partition table compatibility with advanced disk format common to drivers manufactured in 2011 and later having 4K sector sizes. – labradort Jun 07 '11 at 19:19
3

Sounds like you need to use a utility like Gparted to create a partition, then use the appropriate utility for the filesystem you want to create the FS.

phoebus
  • 8,370
  • 1
  • 31
  • 29
0

You need to create a filesystem with mkfs on the disk before using it. You may want to partition it first too. Partitions aren't mandatory to linux if you simply want to use it as a data disk, however you'll need to partition it to be able to boot from it.

wazoox
  • 6,782
  • 4
  • 30
  • 62