LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-05-2013, 05:28 PM   #1
BlackTornado
LQ Newbie
 
Registered: Mar 2013
Posts: 5

Rep: Reputation: Disabled
fdisk shows wrong partition type


Hello

I just formatted a disk from terminal: I deleted the old partitions, created the new ones and saved the changes.

In the end, I got the following warning, which I guess is pretty normal:

Quote:
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 or after you run partprobe(8) or kpartx(8)
To be sure, I rebooted and I've been able to format the disk with mkfs.ext4, apparently without any problem, since the disk mounts correctly as ext4 and seems to work fine.

What bothers me is this:
Code:
root@Sheevaplug:~# fdisk -l /dev/sda1

Disk /dev/sda1: 1500.3 GB, 1500299395072 bytes
4 heads, 2 sectors/track, 366284032 cylinders, total 2930272256 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xb7bfec12

     Device Boot      Start         End      Blocks   Id  System
/dev/sda1p1            2048  2930272255  1465135104   83  Linux
root@Sheevaplug:~# fdisk /dev/sda1

Command (m for help): p

Disk /dev/sda1: 1500.3 GB, 1500299395072 bytes
4 heads, 2 sectors/track, 366284032 cylinders, total 2930272256 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xb7bfec12

     Device Boot      Start         End      Blocks   Id  System
/dev/sda1p1            2048  2930272255  1465135104   83  Linux

Command (m for help): q
For some reason, fdisk -l still shows the old file system, while printing the partition table shows the correct one.

I guess is because the kernel doesn't use the new partition table, but rebooting didn't help and neither did giving partprobe. If I give partprobe /dev/sda1, I get this:
Code:
root@Sheevaplug:~# partprobe /dev/sda1
Error: Error informing the kernel about modifications to partition /dev/sda1p1 -- Invalid argument.  This means Linux won't know about any changes you made to /dev/sda1p1 until you reboot -- so you shouldn't mount it or use it in any way before rebooting.
Error: Failed to add partition 1 (Invalid argument)
If I run partprobe without arguments, it doesn't give any error, but still doesn't solve the problem.

What is wrong?
The system is actually an external hard drive connected through eSata and no operative systems are on it.
 
Old 03-05-2013, 06:01 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,750

Rep: Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928
Basically you created a partition table on the first partition /dev/sda1p1 vs the MBR. When using fdisk make sure you use the drive device ID i.e. /dev/sda vs /dev/sda1.

Since you just formatted the drive you can recreate the partition table on the MBR and reformat sda1.

Last edited by michaelk; 03-05-2013 at 06:03 PM.
 
Old 03-06-2013, 02:17 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
Unless you have been particularly diligent in building /dev/sda1 (the partition) as a block device, none of the above commands are valid.

Try
Code:
fdisk /dev/sda
partprobe /dev/sda
 
Old 03-06-2013, 02:39 AM   #4
BlackTornado
LQ Newbie
 
Registered: Mar 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
using fdisk on /dev/sda made everything work like a charm.
Thank you!
 
  


Reply



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
fdisk created fat32 partition, which type 0b or 0c? onedingo Linux - General 14 09-25-2022 12:55 PM
Fdisk..removed wrong partition...help please air4time Slackware 10 06-18-2006 06:28 PM
Fdisk..removed wrong partition...help please air4time Linux - Newbie 11 06-17-2006 09:53 PM
fdisk partition type question downinthemine Slackware - Installation 5 12-22-2003 07:52 AM
root partition shows wrong total size Dergro Linux - General 12 10-08-2003 12:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10: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
Open Source Consulting | Domain Registration