LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Unable to Format brand new HPFS/NTFS drive (https://www.linuxquestions.org/questions/linux-newbie-8/unable-to-format-brand-new-hpfs-ntfs-drive-862663/)

JeffC1 02-14-2011 03:30 PM

Unable to Format brand new HPFS/NTFS drive
 
Hello all

I'm unable to format a new drive. I've tried commands, which complete without error, yet the drive is still listed as NTFS.


===========Ive tried the following

[root@server ~]# mke2fs -j -m1 /dev/sdb1
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
244203520 inodes, 488375992 blocks
4883759 blocks (1.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
14905 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000, 214990848

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 20 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.



=========also tried


[root@server ~]# mkfs.ext3 /dev/sdb1
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
244203520 inodes, 488375992 blocks
24418799 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
14905 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000, 214990848

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 27 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.


==============fdisk p output

The number of cylinders for this disk is set to 243199.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): p

Disk /dev/sdb1: 2000.3 GB, 2000388063744 bytes
255 heads, 63 sectors/track, 243199 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System



help?

corp769 02-14-2011 03:40 PM

Are you getting any errors or warnings about the drive itself? And have you tried using gparted?

JeffC1 02-14-2011 03:54 PM

I dont have access to GUI on this system. I have not tried any other tools.
So far i haven't seen any warnings or errors. Where can I check them?

corp769 02-14-2011 03:59 PM

Post your /var/log/messages and the output of dmesg, hopefully we can resolve your issue. One more question though, is the drive accessible at all, and can you mount it?

fordeck 02-14-2011 04:16 PM

Quote:

==============fdisk p output

The number of cylinders for this disk is set to 243199.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): p

Disk /dev/sdb1: 2000.3 GB, 2000388063744 bytes
255 heads, 63 sectors/track, 243199 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
It would appear that you have not created the partition, judging from your fdisk output. So I have to ask the question:

Did you create a partition first?

Example:

Code:

$ fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xa4838b04.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Command (m for help): n
Command action
  e  extended
  p  primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-19457, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-19457, default 19457):
Using default value 19457

Command (m for help): p

Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xa4838b04

  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1              1      19457  156288321  83  Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

The above example would show the required steps to create a partition using fdisk. If you've already done this then disregard the example. It just was not clear from your post whether or not you had created the partition first.

Regards,

Fordeck

JeffC1 02-14-2011 04:24 PM

I didnt do that step! Thanks trying now

corp769 02-14-2011 04:32 PM

It's always the simple things....

JeffC1 02-14-2011 04:47 PM

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 22: Invalid argument.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.

---------- Post added 02-14-11 at 05:47 PM ----------

The change didnt save.

fordeck 02-14-2011 04:54 PM

Could you post the output from:

Code:

fdisk -l
Regards,

Fordeck

JeffC1 02-14-2011 04:59 PM

Disk /dev/sdb: 2000.3 GB, 2000396746752 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 243200 1953503968+ 7 HPFS/NTFS

fordeck 02-14-2011 05:04 PM

Is this disk mounted by any chance?

Also are you going to make the whole disk a single partition?

Regards,

Fordeck

JeffC1 02-14-2011 06:12 PM

The disk may be mounted, yes.. I will double check.
It will also be a single partition.

JeffC1 02-14-2011 06:14 PM

The disk isnt mounted

fordeck 02-14-2011 06:39 PM

You should probably delete the existing HPFS/NTFS partition, and then create the new linux partition. This can all be done with fdisk, just use the 'd' command prior to creating the new partition.

Regards,

Fordeck

JeffC1 02-14-2011 07:12 PM

fdisk /dev/sdb1


Disk /dev/sdb1: 2000.3 GB, 2000388063744 bytes
255 heads, 63 sectors/track, 243199 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1p1 1 243199 1953495936 83 Linux


mount -l
Disk /dev/sdb: 2000.3 GB, 2000396746752 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 243200 1953503968+ 7 HPFS/NTFS



I'm getting conflicting results with a fdisk-l and fdisk


All times are GMT -5. The time now is 06:41 PM.