LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 10-12-2006, 09:12 AM   #1
hazmatt20
Member
 
Registered: Jan 2006
Distribution: FC5, Ubuntu
Posts: 126

Rep: Reputation: 15
mkfs fails even after creating new partition


I just ran fdisk on a sata drive (sda), deleted the partition (sda1), and recreated it (new, primary, 1, write changes). However, when I try mkfs, it fails. Here's what I get.

Code:
#end of fdisk

The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.

#mkfs.ext3 /dev/sda1
mke2fs 1.38 (30-Jun-2005)
/dev/sda1 is apparently in use by the system; will not make a filesystem here!
Here's df:
Code:
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/hda2              9920624   2905028   6503528  31% /
/dev/hda1               101086     12916     82951  14% /boot

#tmpfs is swap.  I don't know why it's labelled like that.

tmpfs                  1037884         0   1037884   0% /dev/shm
/dev/hda5            226391152 181170744  33534732  85% /home
192.168.0.1:/backup   17503584    846240  15768192   6% /backup
Fuser /dev/sda1 and lsof /dev/sda1 both return nothing. Here's the end of /var/log/messages:

Code:
Oct 12 10:05:21 kaoru kernel: sda: Write Protect is off
Oct 12 10:05:21 #### kernel: SCSI device sda: drive cache: write back
Oct 12 10:05:21 #### kernel:  sda: sda1
Oct 12 10:05:23 #### kernel: SCSI device sda: 781422768 512-byte hdwr sectors (400088 MB)
No change on reboot, either. Any suggestions?
 
Old 10-12-2006, 10:28 AM   #2
Xerop
Member
 
Registered: Jan 2004
Distribution: Suse, Red Hat
Posts: 129

Rep: Reputation: 15
Try using a livecd to format the drive.
Make sure it is not mounted.
run fdisk then reboot then try to mkfs.
Also in fdisk select linux for partition type. here is the guide for gentoo your will be similar (just substiture your mount points)

this should help you ay have to read the whole page.

Hope this helps.
 
Old 10-12-2006, 11:06 AM   #3
hazmatt20
Member
 
Registered: Jan 2006
Distribution: FC5, Ubuntu
Posts: 126

Original Poster
Rep: Reputation: 15
I booted into Knoppix 5, and it gave me the same error. Also, creating a new partition in fdisk is set to Linux by default.
 
Old 10-12-2006, 01:48 PM   #4
Xerop
Member
 
Registered: Jan 2004
Distribution: Suse, Red Hat
Posts: 129

Rep: Reputation: 15
1. post the partition table (ie fdisk the drive, write the changes reboot fdisk the drive again but hit p to print the partition table do not write the changes a second time.)

2. Is this a second hard drive to the system?

3. post the output of mount when you are in knoppix

4. Make sure the drive is dismounted, Your original post says it is in use (ie mounted)
 
Old 10-12-2006, 02:01 PM   #5
hazmatt20
Member
 
Registered: Jan 2006
Distribution: FC5, Ubuntu
Posts: 126

Original Poster
Rep: Reputation: 15
fdisk /dev/sdb:

Code:
Disk /dev/sda: 400.0 GB, 400088457216 bytes
255 heads, 63 sectors/track, 48641 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1       48641   390708801   83  Linux
Yes, it's a second drive, and it is not mounted. There is no way for a drive to be immediately mounted after rewriting the partition table. Trying to mount or mkfs in Knoppix give the same error. I almost thought I had it when mkfs.ext3 wouldn't work on another drive but mkfs -j did. However, mkfs -j on this drive still gave the same error.
 
Old 10-12-2006, 02:28 PM   #6
Xerop
Member
 
Registered: Jan 2004
Distribution: Suse, Red Hat
Posts: 129

Rep: Reputation: 15
Try using a different partitioning program.
Try erasing the partition table rebooting and writting one.

My guess is the drive wasn''t dismounted properly then you try to make the fs it reads the drive and thinks its mounted.
Hiren's boot cd may help with this but it legality is doubted... (partition magic specifically)
 
  


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
mkfs overwrites RAID partition table erick_el_rojo Linux - Enterprise 0 05-02-2005 11:06 AM
Partition mounting/KDE errors after creating Fat32 Partition BertBert Linux - General 1 07-07-2004 10:59 AM
creating new partition before boot partition?? rose_bud4201 Linux - General 17 02-07-2003 12:25 PM
Newbie Installing Debian3 on m68k w/250M Partition Needs help creating swap partition AppleMac Linux - Newbie 2 11-01-2002 08:45 AM
Problem creating filesystem MKFS Keith Hewitt Linux - General 1 08-04-2001 06:15 AM

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

All times are GMT -5. The time now is 06:09 AM.

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
Open Source Consulting | Domain Registration