LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   fdisk not working? (https://www.linuxquestions.org/questions/linux-newbie-8/fdisk-not-working-749114/)

Zeno McDohl 08-20-2009 03:11 PM

fdisk not working?
 
Code:

[root@localhost ~]# fdisk -l

Disk /dev/sda: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1              1          7      56196  de  Dell Utility
/dev/sda2  *          8        522    4136737+  42  SFS

Disk /dev/sdb: 68.5 GB, 68502552576 bytes
255 heads, 63 sectors/track, 8328 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1  *          1          13      104391  83  Linux
/dev/sdb2              14        8328    66790237+  8e  Linux LVM

Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/sdc1              1      121601  976760001    7  HPFS/NTFS

Okay, so I want to reformat sdc1 to be Linux or anything, just not NTFS.

Quote:

[root@localhost ~]# fdisk /dev/sdc1
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.


The number of cylinders for this disk is set to 121600.
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):
Command (m for help): p

Disk /dev/sdc1: 1000.2 GB, 1000202241024 bytes
255 heads, 63 sectors/track, 121600 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

No partitions, so creating a new one...
Quote:

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-121600, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-121600, default 121600):
Using default value 121600

Command (m for help): p

Disk /dev/sdc1: 1000.2 GB, 1000202241024 bytes
255 heads, 63 sectors/track, 121600 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdc1p1 1 121600 976751968+ 83 Linux

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 83

Command (m for help): p

Disk /dev/sdc1: 1000.2 GB, 1000202241024 bytes
255 heads, 63 sectors/track, 121600 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdc1p1 1 121600 976751968+ 83 Linux

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

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.
Okay so it's done and is Linux.

Quote:

[root@localhost ~]# mkfs -t ext2 /dev/sdc1
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
122109952 inodes, 244190000 blocks
12209500 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
7453 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
Writing superblocks and filesystem accounting information: done

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

Code:

[root@localhost ~]# fdisk -l

Disk /dev/sda: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1              1          7      56196  de  Dell Utility
/dev/sda2  *          8        522    4136737+  42  SFS

Disk /dev/sdb: 68.5 GB, 68502552576 bytes
255 heads, 63 sectors/track, 8328 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1  *          1          13      104391  83  Linux
/dev/sdb2              14        8328    66790237+  8e  Linux LVM

Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/sdc1              1      121601  976760001    7  HPFS/NTFS

Why is it still NTFS?

Quote:

[root@localhost ~]# fsck -f -y /dev/sdc1
fsck 1.39 (29-May-2006)
fsck: fsck.ntfs-3g: not found
fsck: Error 2 while executing fsck.ntfs-3g for /dev/sdc1
Tried a reboot.
Code:

[root@localhost ~]# fdisk -l

Disk /dev/sda: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1              1          7      56196  de  Dell Utility
/dev/sda2  *          8        522    4136737+  42  SFS

Disk /dev/sdb: 68.5 GB, 68502552576 bytes
255 heads, 63 sectors/track, 8328 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1  *          1          13      104391  83  Linux
/dev/sdb2              14        8328    66790237+  8e  Linux LVM

Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/sdc1              1      121601  976760001    7  HPFS/NTFS

What did I miss?

adam999 08-20-2009 03:22 PM

do fdisk /dev/sdc rather than /dev/sdc1

chrism01 08-20-2009 06:24 PM

Also, like it said, unless you reboot, the kernel still has the old partition table in memory (HPFS/NTFS).
You can try

partprobe to force it (works on RH systems) or reboot.
Also, why not ext3 (ext2+journalling) its the default std?


All times are GMT -5. The time now is 11:23 AM.