LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-03-2012, 08:45 AM   #1
shivanag
LQ Newbie
 
Registered: Aug 2012
Posts: 1

Rep: Reputation: Disabled
problem with the block device


Im using linux version linux-2.6.32

I created one block device using mknod command

mknod /dev/mtdblock10 b 31 10

It is showing in the list

ls -lrt /dev/mtdblock*
brw-rw-rw- 1 root root 31, 7 Jul 25 06:06 /dev/mtdblock7
brw-rw-rw- 1 root root 31, 6 Jul 25 06:06 /dev/mtdblock6
brw-rw-rw- 1 root root 31, 5 Jul 25 06:06 /dev/mtdblock5
brw-rw-rw- 1 root root 31, 4 Jul 25 06:06 /dev/mtdblock4
brw-rw-rw- 1 root root 31, 3 Jul 25 06:06 /dev/mtdblock3
brw-rw-rw- 1 root root 31, 2 Jul 25 06:06 /dev/mtdblock2
brw-rw-rw- 1 root root 31, 1 Jul 25 06:06 /dev/mtdblock1
brw-rw-rw- 1 root root 31, 0 Jul 25 06:06 /dev/mtdblock0
brw-rw-rw- 1 root root 31, 8 Aug 3 06:50 /dev/mtdblock8
brw-rw-rw- 1 root root 31, 10 Aug 3 12:52 /dev/mtdblock10

cp /tmp/example /dev/mtdblock10
cp: unable to open `/dev/mtdblock10': No such device or address


help me in this regard

Thanks in advance
 
Old 08-03-2012, 09:42 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
When you create device file specifying major/minor you're telling the system to use a physical device referenced by that major/minor. That device has actually exist. That is to say for example even though you might have entries for /dev/sda and /dev/sdb for your first two hard drives and can figure out what /dev/sdc should be then mknod for it you still wouldn't be able to use /dev/sdc unless there was actually a 3rd hard drive at the major/minor you specified. (In fact Linux creates multiple /dev/sd devices at install even though your system may only contain 1 hard drive.)

Also since device files are references to physical devices what you can do with them is heavily dependent on the device being referenced. That is to say cp from a file to say /dev/pts/10 because the device is a pseudo terminal not a directory.

I don't know what mdtblock is supposed to reference but the principles would be the same. You'd need to know there was an actual device to be referenced at the major/minor you had specified and know whether cp was a relevant command for such a device.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with ending requests asynchronously in my block device driver cable_plug2000 Programming 0 12-15-2007 05:12 PM
UL 1.0 GRUB: could not find device for /boot: not found or not a block device cma Linux - General 4 12-12-2005 03:35 AM
Grub problem : not found or not a block device bennethos Debian 1 01-04-2005 03:54 PM
mount-problem usb harddisk: not a valid block device micha Mandriva 2 11-21-2004 10:29 AM
Problem with USB Key and creating the /dev/sda1 block device Ben2210 Slackware 5 08-04-2004 02:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:21 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