Results 1 to 7 of 7

Thread: fdisk & mount don't agree

  1. #1
    andyford NNTP User

    Question fdisk & mount don't agree

    After much moving of partitions (via gpartd) and installation of various OS's, I've got a bit of a problem: fdisk and mount don't agree about which partition corresponds to which device:

    wonder:~ # fdisk -l

    Disk /dev/sda: 160.0 GB, 160041885696 bytes
    255 heads, 63 sectors/track, 19457 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x43764c23

    Device Boot Start End Blocks Id System
    /dev/sda1 * 1 1782 14313883+ 83 Linux
    Partition 1 does not end on cylinder boundary.
    /dev/sda2 1783 2189 3269227+ 82 Linux swap / Solaris
    Partition 2 does not end on cylinder boundary.
    /dev/sda3 2190 19457 138705210 7 HPFS/NTFS
    Partition 3 does not end on cylinder boundary.

    But notice the disagreement with mount:

    wonder:~ # mount
    /dev/sda3 on / type ext3 (rw,acl,user_xattr)

    How can I fix this?

  2. #2
    Join Date
    Mar 2008
    Location
    Oz
    Posts
    11,731
    Blog Entries
    2

    Default Re: fdisk & mount don't agree

    I'm not an expert on this stuff but the "cylinder boundary" comments look ominous to me, or at least very unusual. Maybe NTFS shouldn't have been manipulated with Gparted especially if it was a vista partition. Where did the NTFS partition come from?

    In the meantime others should jump in with advice, because this is not a strong area of mine.
    Leap 42.3 & 15.1 &KDE
    FYIs from the days of yore

  3. #3

    Default Re: fdisk & mount don't agree

    mount reads from a textfile, /etc/mtab, which may not be in sync with the kernel fs table from /proc/filesystems.

  4. #4
    andyford NNTP User

    Default Re: fdisk & mount don't agree

    Quote Originally Posted by swerdna View Post
    I'm not an expert on this stuff but the "cylinder boundary" comments look ominous to me, or at least very unusual.
    It does look scary, but I've seen it many times over the years, and I vaguely remember reading that it's not a big deal.
    Quote Originally Posted by swerdna View Post
    Maybe NTFS shouldn't have been manipulated with Gparted especially if it was a vista partition. Where did the NTFS partition come from?
    .
    The NTFS partition is a XP install from scratch. gparted claims to work with NTFS and it did: I stretched and moved that partition a number of times and Windows works well still

  5. #5
    andyford NNTP User

    Default Re: fdisk & mount don't agree

    Quote Originally Posted by jengelh View Post
    mount reads from a textfile, /etc/mtab, which may not be in sync with the kernel fs table from /proc/filesystems.
    Right, you mean /proc/mounts:

    wonder:~ # cat /proc/mounts
    rootfs / rootfs rw 0 0
    udev /dev tmpfs rw,mode=755 0 0
    /dev/sda1 / ext3 rw,errors=continue,user_xattr,acl,barrier=1,data=ordered 0 0
    proc /proc proc rw 0 0
    sysfs /sys sysfs rw 0 0
    debugfs /sys/kernel/debug debugfs rw 0 0
    devpts /dev/pts devpts rw,gid=5,mode=620 0 0
    fusectl /sys/fs/fuse/connections fusectl rw 0 0
    none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0

    But how do I get them in sync?

  6. #6

    Default Re: fdisk & mount don't agree

    Quote Originally Posted by andyford View Post
    But how do I get them in sync?
    fdisk (and /proc/partitions) shows what partitions are there, /proc/mounts (and mtab) only those that are mounted. There is no way to get that in sync because they are two different things. Some partitions may not even be mountable (like swap).

  7. #7
    Join Date
    Jun 2008
    Location
    Atlanta, Georgia, USA
    Posts
    2,429

    Default Re: fdisk & mount don't agree

    andyford@

    As far as the cylinder boundaries, don't worry about it unless you are actually have a disk I/O problem. My memory is sketchy on this, but as I recall back in DOS land this was a consideration; DOS wrote and used start/end locations to the partition table. Later Windows began using only the start position, as does Linux. All that matters is that it can accurately find the first sector of each partition.

    And re the partition being flagged as NTFS, I suspect that partition was originally created by W2K/XP. Windows does rigidly use certain fields in the table like partition type, but Linux doesn't. A Linux format will write to the field, but what the kernel cares about is the filesystem actually on the partition and how it is mounted. So if you have ext3 formatted on that partition and are mounting it accordingly, Linux doesn't care what the type code is.

    The partition table can be edited by hand - but you don't want to go there unless it is absolutely necessary.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •