PDA

View Full Version : Brand new disk, '/dev/hda is not a valid block device'



rollo11
02-24-2006, 11:56 PM
I am trying to use Knoppix to partition and format the hard disk of a new laptop (the machine was sold with Knoppix).

Is it normal that Knoppix can't see the disk?

In qtparted the only drives detected are:


/UNIONFS/dev/hdc
/UNIONFS/dev/sda

Other outputs:


# fdisk /dev/hda
Unable to open /dev/hda


# mount -t ext2 /dev/hda /mnt/hda
mount: /dev/hda is not a valid block device

In cfdisk the disk shown is /dev/sda, which is identical in size to the machine's hard drive. So it must be mapped in some way.

How can I get access to the disk in order to partition and format? Can't find information on this anywhere.

Thanks.

UnderScore
02-25-2006, 04:30 AM
I have seen instances where the linux kernel through its various version (2.6.8 - current) detect SATA devices as /dev/sd? or /dev/hd?.

Find out of the hda is now sda:
dmesg | grep -i hd
dmesg | grep -i sd
dmesg | grep -i ide

nad
02-25-2006, 01:29 PM
One does not mount devices. One mounts filesystems. /dev/hda1 is a partition. /dev/hda is the device itself. If this drive has no partitions and/or filesystems use a partition editor to create a partition(s), then a filesystem utility to create a ... filesystem.

In any case, you must be acting as root in order to perform any of these functions.

rollo11
02-25-2006, 01:54 PM
I appreciate your assistance guys. Here are the outputs requested by UnderScore:


root@0[knoppix]# dmesg | grep -i hd
ide1: BM-DMA at 0x1418-0x141f, BIOS settings: hdc:DMA, hdd:pio
hdc: PHILIPS CD-RW/DVD-ROM SCB5265, ATAPI CD/DVD-ROM drive
hdc: ATAPI 24X DVD-ROM CD-R/RW drive, 2048kB Cache
SCSI device sda: 78140160 512-byte hdwr sectors (40008 MB)
SCSI device sda: 78140160 512-byte hdwr sectors (40008 MB)

root@0[knoppix]# dmesg | grep -i sd
ACPI: RSDP (v000 PTLTD ) @ 0x000f64a0
ACPI: RSDT (v001 PTLTD RSDT 0x06040000 LTP 0x00000000) @ 0x0beb3c1c
ACPI: SSDT (v001 PmRef Cpu0Cst 0x00003001 INTL 0x20030224) @ 0x0beb3d91
ACPI: SSDT (v001 PmRef CpuPm 0x00003000 INTL 0x20030224) @ 0x0beb3c54
ACPI: DSDT (v001 FIC LM7R 0x06040000 MSFT 0x0100000e) @ 0x00000000
SCSI device sda: 78140160 512-byte hdwr sectors (40008 MB)
SCSI device sda: drive cache: write back
SCSI device sda: 78140160 512-byte hdwr sectors (40008 MB)
SCSI device sda: drive cache: write back
sda:
Attached scsi disk sda at scsi0, channel 0, id 0, lun 0

root@0[knoppix]# dmesg | grep -i ide
BIOS-provided physical RAM map:
ACPI: IRQ0 used by override.
ACPI: IRQ9 used by override.
CPU: After generic identify, caps: afe9fbff 00000000 00000000 00000000 00000000 00000000 00000000
CPU: After vendor identify, caps: afe9fbff 00000000 00000000 00000000 00000000 00000000 00000000
Boot video device is 0000:01:00.0
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
VP_IDE: IDE controller at PCI slot 0000:00:0f.1
VP_IDE: chipset revision 6
VP_IDE: not 100% native mode: will probe irqs later
VP_IDE: VIA vt8237 (rev 00) IDE UDMA133 controller on pci0000:00:0f.1
ide1: BM-DMA at 0x1418-0x141f, BIOS settings: hdc:DMA, hdd:pio
Probing IDE interface ide1...
ide1 at 0x170-0x177,0x376 on irq 15
Probing IDE interface ide0...
Probing IDE interface ide2...
Probing IDE interface ide3...
Probing IDE interface ide4...
Probing IDE interface ide5...
input: AlpsPS/2 ALPS GlidePoint on isa0060/serio4
input: AlpsPS/2 ALPS GlidePoint on isa0060/serio4
ACPI: Video Device [VGA] (multi-head: yes rom: no post: no)


This suggests that my machine is detecting the hard drive as a SCSI device. Is that usual?

My aim is to install a distro of Linux from an installation disk image. This will mean partitioning and installing Grub to the bootable partition. But first I have to get write access to the disk, correct? Knoppix is so clever it's confusing...

nad
02-25-2006, 02:17 PM
Your machine will detect and configure hardware according to the firmware used in the attached controllers. This information is then interpreted by any drivers for your operating system. There is no _usual_.

You need write access to install any operating system...

nad
02-26-2006, 11:07 AM
Perhaps my last answer was a bit obtuse.

The low level utilitities used to partition and create filesystems require that the device _not_ be mounted. They will write directly to the device.

As far as installing grub to a bootable partition: If grub is not installed to the MBR of your boot drive, you will need a method to point to its' location.

rollo11
02-26-2006, 01:15 PM
Thanks for the enlightenment nad.

Anyway, it seems to be the case that my hard disk is detected as a SCSI device. So be it. I am assuming I can now continue as though nothing is different except the 'sda' in place of 'hda'.

I have partitioned the disk using cfdisk without problem. Next stage, mount the partitions. But it won't. Check this out:


root@0[mnt]# mount /dev/sda1 /mnt/sda1
mount: you must specify the filesystem type

root@0[mnt]# mount -t ext2 /dev/sda1 /mnt/sda1
mount: wrong fs type, bad option, bad superblock on /dev/sda1,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

root@0[mnt]# dmesg | tail
eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
NET: Registered protocol family 10
Disabled Privacy Extensions on device c0381d00(lo)
IPv6 over IPv4 tunneling driver
eth0: no IPv6 routers present
EFS: 1.0a - http://aeschi.ch.eu.org/efs/
VFS: Can't find an ext2 filesystem on dev sda1.
root@0[mnt]#

Any idea what I'm doing wrong?

marx
02-26-2006, 06:39 PM
root@0[mnt]# mount /dev/sda1 /mnt/sda1
mount: you must specify the filesystem type


Any idea what I'm doing wrong?


Are you sure that the partition is formatted??

I think this could be done with "mke2fs /dev/sda1"...

Best Regards,
marx

nad
02-26-2006, 08:36 PM
The last answer is correct. See my first reply: "One mounts filesystems". If there is no filesystem, there is nothing to mount.

As far as creating a filesystem; ext2 is okay, but for a more modern, journalled filesystem, try mkfs.ext3 or mkfs.reiserfs (which knoppix uses) or mkfs.xfs or mkfs.jfs or ...

rollo11
02-26-2006, 09:06 PM
Thanks both of you. I knew this one was simple but for some reason I got mixed up over the 'mount' and 'format' concepts. I'll format with ReiserFS because that's what Suse uses.

Before I go ahead I have to get the partitioning strategy right (I intend to run two versions of Linux). But that will perhaps be for another post!

Tchüss.