LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (https://www.linuxquestions.org/questions/red-hat-31/)
-   -   Can not switch off DOS compatible mode. (https://www.linuxquestions.org/questions/red-hat-31/can-not-switch-off-dos-compatible-mode-4175465732/)

walterbyrd 06-12-2013 10:57 AM

Can not switch off DOS compatible mode.
 
I just installed CentOS 6.4 (64 bit) and I am new to LVM. I am trying to figure out how to make the LVM partitions usable.

When I do an fdisk /dev/sda I get this message:


----------------
# fdisk /dev/sda

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to switch off the mode (command 'c') and change display units to sectors (command 'u').

----------------

I follow the instructions, including reboot, but the next time I do an fdisk, I get the same thing.

I do not really understand why the latest version of CentOS would install a deprecated mode. Or why CentOS would install unusable partitions.

Any help appreciated, thanks in advance.

smallpond 06-12-2013 12:38 PM

fdisk is probably useful for floppy drives and USB sticks. Current large drives don't use DOS format, they use GPT, so you must use the horrible parted program. If you are ambitious get GPT Fdisk from Sourceforge.

TobiSGD 06-12-2013 12:55 PM

This has nothing to do with LVM or GPT at all, it is a display mode of fdisk . This is what the manpage for fdisk (util-linux 2.21.2) says about that:
Quote:

fdisk does not use DOS-compatible mode and cylinders as display units by default. The old deprecated DOS behavior
can be enabled with the '-c=dos -u=cylinders' command-line options.
So you should check if some reason you have an alias for fdisk with that options, otherwise just press the keys fdisk recommends and continue your work with fdisk.
By the way, fdisk has nothing at all to do with LVM and won't help you to work with or learn about LVM.

jlinkels 06-12-2013 01:21 PM

You could follow the directions of what fdisk proposes.

You could also try cfdisk which is a more friendly interface. Not sure if cfdisk is a layer around fdisk.

But I do agree that this is not fdisk default behaviour and you could be calling a script instead of fdisk.

jlinkels

chrism01 06-13-2013 12:18 AM

Actually , at least on Centos6.4 it does seem to be hardcoded
Code:

which fdisk
/sbin/fdisk
[root@boole log]# fdisk /dev/sdb

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
        switch off the mode (command 'c') and change display units to
        sectors (command 'u').

Command (m for help): q

[root@boole log]# file /sbin/fdisk
/sbin/fdisk: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped

# double check - specify full cmd path
/sbin/fdisk /dev/sdb

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
        switch off the mode (command 'c') and change display units to
        sectors (command 'u').

Command (m for help): q


jlinkels 06-13-2013 07:34 AM

Yuk, look what Debian Squeeze says:

Code:

sudo fdisk /dev/sdb

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
        switch off the mode (command 'c') and change display units to
        sectors (command 'u').

Command (m for help):

Although I used this command the day before yesterday I was sure this message had not appeared. How wrong can someone be! :redface:

jlinkels

TobiSGD 06-13-2013 07:41 AM

Seems that Slackware is more progressive here:
Code:

root ~ ☺ # fdisk /dev/sdb
Welcome to fdisk (util-linux 2.21.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help):

In Debian Wheezy I don't get that message. Since both, Squeeze and the latest CentOS, use util-linux 2.17, but Wheezy has 2.20 and Slackware -current 2.21 it may be that this default behavior switched between the versions or DOS mode simply was removed in later versions.

chrism01 06-13-2013 08:18 AM

At the end of the day, its just a display mode, so it still works just fine.
@jlinkels; you probably got so used to it you don't remember seeing it.
I'd forgotten until I got into this thread.
Centos/RHEL are long term products and the upstream probably hasn't made it down yet.

jefro 06-13-2013 09:01 PM

https://code.google.com/p/fusecompress/

walterbyrd 06-13-2013 10:58 PM

Quote:

Originally Posted by jlinkels (Post 4970451)
You could follow the directions of what fdisk proposes.

As I said, I did. That did not work. That is the problem.


Quote:

Originally Posted by jlinkels (Post 4970451)
You could also try cfdisk which is a more friendly interface. Not sure if cfdisk is a layer around fdisk.


I am not sure what good that would do.


Quote:

Originally Posted by jlinkels (Post 4970451)
But I do agree that this is not fdisk default behaviour and you could be calling a script instead of fdisk.

As I said, this is a fresh install. I am using what redhat setup.

rknichols 06-13-2013 11:23 PM

The mode in which fdisk starts up is independent of how your disk is currently partitioned. The version of fdisk that you have (2.17.2) will, unless you include the "-c" option in the command line, always start up in DOS compatible mode and give you that warning. Older versions of fdisk always started up in DOS compatible mode (there was no "-c" command line option) and did not give that deprecation warning. Newer versions start up with DOS compatible mode turned off by default. Your version is somewhere in between. You can either live with it or keep venting about it, but it is extremely unlikely that Red Hat will change that behavior within the current OS major release.

chrism01 06-14-2013 12:58 AM

As above post & see my example; its baked in but nothing to worry about.
If you really can't stand it, try parted.


All times are GMT -5. The time now is 08:32 AM.