-   Slackware (
-   -   fdisk fails in Slackware 14 - why? (

ramchip 02-25-2013 09:00 PM

fdisk fails in Slackware 14 - why?
Downloading Slackware 14 and burning the DVD was new territory for me, yet it appeared full of promise. However, when I booted from the DVD and tried to use fdisk I was unexpectedly confronted with this error message: "fdisk.bin: unable to open /dev/hdb".

My command was "fdisk /dev/hdb" because that is where I had previously installed an early version of Slackware to test the hardware. The primary IDE slave drive (40GB) is to be dedicated to Linux. The primary IDE master drive (80GB) boots into WinXP Pro as an option at the LILO prompt. Note: the default boot is Linux.

The AMI BIOS in the dual-booting 'LinWin' box has these parameters set: cylinders=10011, heads=255, sectors=63.
The original Slackware version allowed me to configure the same parameters in fdisk by selecting expert mode. The machine happily boots Linux version 1.2.1 (!) and fdisk reports four partitions /dev/hdb1, 2, 3 and 4.

Here's the current hard drive config.:
Disk 1 (/dev/hda)
Filesystem Size

Ext2 (lilo) 1.0MB
NTFS (C drive) 68.4GB
osshare (D drive) 8.2GB

Disk 2 (/dev/hdb)
Filesystem Size

Ext2 2.0GB (156MB used)
other 2.0GB
other 2.0GB
other 2.0GB
unallocated 30.5GB

The plan is to reallocate the whole of the second disk to the latest version of Slackware with partitions sized appropriately for the intended mount points, which will probably be /, /usr, /X11 and swap.

Why is the new Slackware not recognising the partition table on disk 2?

Any help in resolving this curious problem will be greatly appreciated!

T3slider 02-25-2013 09:24 PM

Modern kernels use libata instead of the old IDE system, so even IDE drives will appear as sd* instead of hd*. If you look in /dev you will probably see /dev/sda and /dev/sdb (but you should verify with fdisk to make sure you know which is which -- don't rely on it still being sdb).

fdisk -l
should list all drives.

lee88abc 02-25-2013 11:06 PM

yah, like he said, its sda...sdb...etc..
no more hda.
after you tried fdisk -l
please paste output here.

ramchip 02-26-2013 05:43 AM

Thanks guys, I didn't know the hd* devices were history! Here's the output from the command "# fdisk -l"

Disk /dev/sda: 82.3 GB, 82348277760 bytes
255 heads, 63 sectors/track, 10011 cylinders, total 160836480 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: 0x99539953

Device Boot Start End Blocks Id System
/dev/sda1 63 160649 80293+ 83 Linux
/dev/sda2 * 160650 143524709 71682030 7 HPFS/NTFS/exFAT
/dev/sda3 143524710 160826714 8651002+ c W95 FAT32 (LBA)

Disk /dev/sdb: 41.2 GB, 41174138880 bytes
255 heads, 63 sectors/track, 5005 cylinders, total 80418240 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: 0xd336d336

Device Boot Start End Blocks Id System
/dev/sdb1 63 4112639 2056288+ 83 Linux
/dev/sdb2 4112640 8241344 2064352+ 83 Linux
/dev/sdb3 8241345 12370049 2064352+ 83 Linux
/dev/sdb4 12370050 16514819 2072385 83 Linux
Now I can re-partition at will :)

Btw, I tried printing the above to an old dot matrix line printer that was known as /dev/lp1 on the old Slackware. I also tried using /dev/parport0 and /dev/parport1 but they didn't work either. The tunelp command is apparently not available during the DVD boot session so I don't know how to check other than look at the system messages in dmesg, which has this to say about the parallel printer port config.:
"parport0: PC-style at 0x378 (0x778), irq 7 [PCSPP, TRISTATE, EPP]"

Any ideas on how to get the printer going?

ramchip 02-26-2013 08:52 AM

Ok, no worries, now that Slackware 14 is installed the printer is /dev/lp0 and it prints!
However, the video mode is upset during the boot.
I configured Lilo to take care of the dual booting and it starts up fine with vga=normal.
Near the end of the boot messages the font/video mode changes and I lose the first character
on every line. The vidmode command is not found so how can I set the video mode back to normal?
Which startup script is responsible for changing it in the first place?

TobiSGD 02-26-2013 09:27 AM

The resolution is set by the driver, not a startup script. The vga= option is deprecated for modern drivers with Kernel Mode Setting, append the option

to your append line in liloconfig, where you replace 1024x768 with your favorite resolution.

w1k0 02-27-2013 02:46 PM


When you’ll partition the hard drive for the next time instead of fdisk use cfdisk. The fdisk causes the problems with the partitions boundaries. Even the fdisk developers advise to use cfdisk:

man fdisk

There are several *fdisk programs around. Each has its problems and strengths. Try them in the order cfdisk, fdisk, sfdisk. (Indeed, cfdisk is a beautiful program that has strict requirements on the partition tables it accepts, and produces high quality partition tables. Use it if you can. fdisk is a buggy program that does fuzzy things -- usually it happens to produce reasonable results. Its single advantage is that it has some support for BSD disk labels and other non-DOS partition tables. Avoid it if you can. sfdisk is for hackers only -- the user interface is terrible, but it is more correct than fdisk and more powerful than both fdisk and cfdisk. Moreover, it can be used noninteractively.)

ramchip 02-28-2013 07:55 AM

Thanks for that advice.

I've partitioned the disk and installed Slackware 14 but I don't have any swap space and question the necessity for it considering that the
LinWin box has 3GB of ram! I left a small primary partition (1.4GB) unallocated at the end of the Linux disk with the idea that this *could* be assigning as a swap partition, if necessary.

Using cfdisk and selecting partition type 82 and choosing 'write' for this last partition gives me the warning that doing so "might destroy data". Surely, in this case I can ignore the warning. If the partition table is already complete apart from one type assignment, i.e. no size changes, can
I go ahead and 'write' without any disaster?

w1k0 03-12-2013 06:20 PM

Sorry. I forgot about that thread and it seems that the whole world did the same.

The answer is yes. You can change the type of the partition and write that without spoiling the other partitions.

Then use:

mkswap /dev/sdaX


swapon /dev/sdaX

Finally put something like this at the beginning of /etc/fstab:


/dev/sdaX        swap            swap        defaults        0  0

ramchip 03-29-2013 10:05 AM

Thanks w1k0 and other contributors. I think we can consider this thread closed now!

xj25vm 04-01-2013 03:38 PM

ramchip - you might want to mark this thread as 'solved' so that people scanning the forum for posts to answer to will know this thread is closed. You will find the option under "Thread tools" at the top of the thread, above the first post.

ramchip 04-05-2013 06:29 AM

Thanks xj25vm, thread now closed as recommended.

All times are GMT -5. The time now is 05:20 PM.