LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-10-2002, 10:53 AM   #1
frankietomatoes
Member
 
Registered: Oct 2002
Posts: 44

Rep: Reputation: 15
fdisk -> unable to open


Hi

I'm workikng with a ramdisk and cannot access my local HD once I've booted to the ramdisk.

used mknod to create /dev/hda, /dev/hdb

initrd# mknod hda b 3 0
initrd# mknod hda1 b 3 1
initrd# mknod hdb b 3 64
initrd# mknod hdb1 b 3 65
initrd# ls -al
...
brw-rw-r-- 1 root root 3, 0 Jan 1 01:00 hda
brw-rw-r-- 1 root root 3, 1 Jan 1 01:00 hda1
brw-rw-r-- 1 root root 3, 64 Jan 1 01:01 hdb
brw-rw-r-- 1 root root 3, 65 Jan 1 01:01 hdb1
...

initrd# fdisk /dev/hda

Unable to open /dev/hda

initrd# fdisk /dev/hdb

Unable to open /dev/hdb


Any ideas?

Thanks
 
Old 12-10-2002, 11:01 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Fdisk works on partitions, so try "fdisk /dev/hda<number>"
 
Old 12-10-2002, 11:07 AM   #3
Thymox
Senior Member
 
Registered: Apr 2001
Location: Plymouth, England.
Distribution: Mostly Debian based systems
Posts: 4,368

Rep: Reputation: 64
Could you check the output of dmesg to see if your disk has been recognised? Have you got your /proc mounted? You could also check in there to see if the disk has been identified.

<edit>
UnSpawn, does fdisk not work on disks... when you have a blank disk, lets say, and you want to create partitions, would you not need to work on the disk rather than partition?
</edit>

Last edited by Thymox; 12-10-2002 at 11:09 AM.
 
Old 12-10-2002, 11:17 AM   #4
frankietomatoes
Member
 
Registered: Oct 2002
Posts: 44

Original Poster
Rep: Reputation: 15

initrd# dmesg

...
Kernel command line: console=ttyS0,115200 root=/dev/ram rw init=/linuxrc
Calibrating delay loop... 200.29 BogoMIPS
Memory: 125296k available (1128k kernel code, 360k data, 172k init, 0k highmem)
Dentry-cache hash table entries: 16384 (order: 5, 131072 bytes)
Inode-cache hash table entries: 8192 (order: 4, 65536 bytes)
Mount-cache hash table entries: 2048 (order: 2, 16384 bytes)
Buffer-cache hash table entries: 8192 (order: 3, 32768 bytes)
Page-cache hash table entries: 32768 (order: 5, 131072 bytes)
PCI: Probing PCI hardware
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
devfs: v1.7 (20011216) Richard Gooch (rgooch@atnf.csiro.au)
devfs: boot_options: 0x1
pty: 256 Unix98 ptys configured
Serial driver version 5.05c (2001-07-08) with MANY_PORTS SHARE_IRQ SERIAL_PCI enabled
ttyS00 at 0xfdf04500x (irq = 3) is a 16550A
block: 256 slots per queue, batch=32
RAMDISK driver initialized: 16 RAM disks of 8192K size 1024 blocksize
loop: loaded (max 8 devices)
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 1024 buckets, 8Kbytes
TCP: Hash tables configured (established 8192 bind 16384)
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
RAMDISK: Compressed image found at block 0
Freeing initrd memory: 2288k freed
VFS: Mounted root (ext2 filesystem).
Mounted devfs on /dev
Freeing unused kernel memory: 172k init
pcimem: started
pcimem: open
pcimem: close
pcimem: open
pcimem: pci_addr 0x800000b4 (f=0x00000002) mapped to 0xc90020b4
pcimem: close
pcimem: terminated
initrd# ~
...

The drive is new and has no partitions.

Last edited by frankietomatoes; 12-10-2002 at 11:20 AM.
 
Old 12-10-2002, 11:22 AM   #5
Thymox
Senior Member
 
Registered: Apr 2001
Location: Plymouth, England.
Distribution: Mostly Debian based systems
Posts: 4,368

Rep: Reputation: 64
If the disk has no partitions, then there is no reason to mknod /dev/hda1. Also, your dmesg shows that hdb=your cd/dvd drive... do you need to mknod /dev/hdb1? Does fdisk /dev/hda throw a paddy if you do not mknod anything? What are you trying to put onto the disk, anyway?
 
Old 12-10-2002, 11:22 AM   #6
frankietomatoes
Member
 
Registered: Oct 2002
Posts: 44

Original Poster
Rep: Reputation: 15
initrd# ls -l /proc/

dr-xr-xr-x 3 root root 0 Jan 1 01:33 1
dr-xr-xr-x 3 root root 0 Jan 1 01:33 1028
dr-xr-xr-x 3 root root 0 Jan 1 01:33 2
dr-xr-xr-x 3 root root 0 Jan 1 01:33 21
dr-xr-xr-x 3 root root 0 Jan 1 01:33 26
dr-xr-xr-x 3 root root 0 Jan 1 01:33 3
dr-xr-xr-x 3 bin bin 0 Jan 1 01:33 31
dr-xr-xr-x 3 root root 0 Jan 1 01:33 4
dr-xr-xr-x 3 root root 0 Jan 1 01:33 5
dr-xr-xr-x 3 root root 0 Jan 1 01:33 74
dr-xr-xr-x 3 root root 0 Jan 1 01:33 75
dr-xr-xr-x 3 root root 0 Jan 1 01:33 76
dr-xr-xr-x 3 root root 0 Jan 1 01:33 77
dr-xr-xr-x 3 root root 0 Jan 1 01:33 78
dr-xr-xr-x 3 root root 0 Jan 1 01:33 79
dr-xr-xr-x 3 root root 0 Jan 1 01:33 84
dr-xr-xr-x 3 root root 0 Jan 1 01:33 85
dr-xr-xr-x 3 root root 0 Jan 1 01:33 852
dr-xr-xr-x 3 root root 0 Jan 1 01:33 853
dr-xr-xr-x 3 root root 0 Jan 1 01:33 86
dr-xr-xr-x 3 root root 0 Jan 1 01:33 bus
-r--r--r-- 1 root root 0 Jan 1 01:33 cmdline
-r--r--r-- 1 root root 0 Jan 1 01:33 cpuinfo
-r--r--r-- 1 root root 0 Jan 1 01:33 devices
-r--r--r-- 1 root root 0 Jan 1 01:33 dma
dr-xr-xr-x 2 root root 0 Jan 1 01:33 driver
-r--r--r-- 1 root root 0 Jan 1 01:33 execdomains
-r--r--r-- 1 root root 0 Jan 1 01:33 filesystems
dr-xr-xr-x 2 root root 0 Jan 1 01:33 fs
-r--r--r-- 1 root root 0 Jan 1 01:33 interrupts
-r--r--r-- 1 root root 0 Jan 1 01:33 iomem
-r--r--r-- 1 root root 0 Jan 1 01:33 ioports
dr-xr-xr-x 2 root root 0 Jan 1 01:33 irq
-r-------- 1 root root 134221824 Jan 1 01:33 kcore
-r-------- 1 root root 0 Jan 1 01:33 kmsg
-r--r--r-- 1 root root 0 Jan 1 01:33 ksyms
-r--r--r-- 1 root root 0 Jan 1 01:33 loadavg
-r--r--r-- 1 root root 0 Jan 1 01:33 locks
-r--r--r-- 1 root root 0 Jan 1 01:33 meminfo
-r--r--r-- 1 root root 0 Jan 1 01:33 misc
-r--r--r-- 1 root root 0 Jan 1 01:33 modules
-r--r--r-- 1 root root 0 Jan 1 01:33 mounts
dr-xr-xr-x 3 root root 0 Jan 1 01:33 net
-r--r--r-- 1 root root 0 Jan 1 01:33 partitions
-r--r--r-- 1 root root 0 Jan 1 01:33 pci
-rw-r--r-- 1 root root 0 Jan 1 01:33 ppc_htab
lrwxrwxrwx 1 root root 64 Jan 1 01:05 self -> 1028
-rw-r--r-- 1 root root 0 Jan 1 01:33 slabinfo
-r--r--r-- 1 root root 0 Jan 1 01:33 stat
-r--r--r-- 1 root root 0 Jan 1 01:33 swaps
dr-xr-xr-x 10 root root 0 Jan 1 01:33 sys
dr-xr-xr-x 2 root root 0 Jan 1 01:33 sysvipc
dr-xr-xr-x 4 root root 0 Jan 1 01:33 tty
-r--r--r-- 1 root root 0 Jan 1 01:33 uptime
-r--r--r-- 1 root root 0 Jan 1 01:33 version
 
Old 12-10-2002, 11:24 AM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Yeah, you're right Thymox, guess I was thinking of fsck instead of reading "fdisk", which is sad.
Btw good work on the stats, you did as well. Which isn't sad :-]
 
Old 12-10-2002, 11:29 AM   #8
frankietomatoes
Member
 
Registered: Oct 2002
Posts: 44

Original Poster
Rep: Reputation: 15
I am not 100% sure of the interface the HD is on or if there were any partitions on it.

To be safe I did mknod hda,b,a1,b1.

I need to have the root filesytem on this drive.

Currently I boot to the ramdisk(from flash) and twiddle my thumbs
 
Old 12-10-2002, 11:30 AM   #9
Thymox
Senior Member
 
Registered: Apr 2001
Location: Plymouth, England.
Distribution: Mostly Debian based systems
Posts: 4,368

Rep: Reputation: 64
Quote:
Originally posted by frankietomatoes
initrd# ls -l /proc/
...
-r--r--r-- 1 root root 0 Jan 1 01:33 partitions
...
What does this say? cat /proc/partitions
Did you try doing the fdisk without mknoding anything?
 
Old 12-10-2002, 11:31 AM   #10
frankietomatoes
Member
 
Registered: Oct 2002
Posts: 44

Original Poster
Rep: Reputation: 15
initrd# cat /proc/partitions
major minor #blocks name rio rmerge rsect ruse wio wmerge wsect wuse running use aveq

fdisk without mknod anything?

initrd# fdisk

Usage: fdisk [-l] [-b SSZ] [-u] device
E.g.: fdisk /dev/hda (for the first IDE disk)
or: fdisk /dev/sdc (for the third SCSI disk)
or: fdisk /dev/eda (for the first PS/2 ESDI drive)
or: fdisk /dev/rd/c0d0 or: fdisk /dev/ida/c0d0 (for RAID devices)
...
initrd# cat /proc/partitions
major minor #blocks name rio rmerge rsect ruse wio wmerge wsect wuse running use aveq

initrd# fdisk /dev/hda

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

Unable to open /dev/hdb
 
Old 12-10-2002, 11:51 AM   #11
nxny
Member
 
Registered: May 2002
Location: AK - The last frontier.
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771

Rep: Reputation: 30
Try
fdisk /dev/discs/disc0
fdisk /dev/cdroms/cdrom0

respectively for the first hard disk or the CDROM since you're using devfs.

or turn off DEVFS altogether and compile a new kernel.

More information here:
http://www.atnf.csiro.au/people/rgoo...ocs/devfs.html

HTH
 
Old 12-10-2002, 12:03 PM   #12
frankietomatoes
Member
 
Registered: Oct 2002
Posts: 44

Original Poster
Rep: Reputation: 15
I editted my original post with cdrom info, it was taken from a different console, wrong machine)




Noticed ide support was compiled as a module.

insmod ide-mod.o
insmod ide-probe-mod.o
insmod ide-disk.o

demsg
...
Uniform Multi-Platform E-IDE driver Revision: 6.31
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
HPT371: IDE controller on PCI bus 00 dev e0
PCI: Enabling device 00:1c.0 (0000 -> 0001)
HPT371: chipset revision 1
HPT371: not 100% native mode: will probe irqs later
HPT370: using 33MHz PCI clock
hdh: TOSHIBA MK6015MAP, ATA DISK drive
ide3 at 0x1810-0x1817,0x180e on irq 4
hdh: 11733120 sectors (6007 MB), CHS=12416/15/63
Partition check:
/dev/ide/host2/bus1/target1/lun0: [PTBL] [730/255/63] p1
...

initrd# ls /proc/ide/ -l
-r--r--r-- 1 root root 0 Jan 1 00:12 drivers
lrwxrwxrwx 1 root root 8 Jan 1 00:12 hdh -> ide3/hdh
-r--r--r-- 1 root root 0 Jan 1 00:12 hpt366
dr-xr-xr-x 3 root root 0 Jan 1 00:12 ide3


I created the hdh node, can anyone explain the

mknod //dev/hdh b 34 64

what do 34 and 64 stand for?

Thanks
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
fdisk: unable to open /dev/hda andykerouac Linux - Newbie 7 07-18-2008 07:49 AM
weird fdisk problem (Fdisk unable to see winxp partitions) khidot Slackware - Installation 5 04-07-2007 09:26 PM
fdisk unable to open hdb dr_zayus69 Linux - Hardware 2 01-11-2005 08:04 PM
fdisk unable to read hard drive scottie Linux - Hardware 1 01-10-2004 01:11 PM
unable to fdisk /dev/hdc aqoliveira Red Hat 4 10-01-2003 04:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:59 AM.

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