LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 11-19-2013, 09:13 AM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,119

Rep: Reputation: 46
mknod: does the creation of a block device write data into the device?


Kernel 3.6.29, Slackware 14.0.

Hi: /dev/sda4, in my system, is an extended partition, to allocate two logical partitions, /dev/sda5 and /dev/sda6. Now I get
Code:
root@server:~# ls -l /dev/sda
brw-rw---- 1 root disk 8, 0 2013-11-19 08:37 /dev/sda
root@server:~# ls -l /dev/sda5
/bin/ls: cannot access /dev/sda5: No such file or directory
root@server:~# ls -l /dev/sda6
/bin/ls: cannot access /dev/sda6: No such file or directory
root@server:~# 
root@server:~# fdisk -l
fdisk: unable to seek on /dev/sda: invalid argument
[/code]

You can see /dev/sda is a _block device_ according to ls, that is, it exists. If I use mknod to have /dev/sda5, /dev/sda6 again, shall I be destroying my data on the logical partitions?
 
Old 11-19-2013, 09:17 AM   #2
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,751

Rep: Reputation: 462Reputation: 462Reputation: 462Reputation: 462Reputation: 462
What does 'ls -l /dev/sd*' show? mknod doesn't write any data at all. Did you create the sda node with mknod?
 
1 members found this post helpful.
Old 11-19-2013, 09:21 AM   #3
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,014

Rep: Reputation: 146Reputation: 146
Quote:
Originally Posted by stf92 View Post
Code:
fdisk: unable to seek on /dev/sda: invalid argument
The position fdisk wants to read from is beyond the end of the device. You device has a size of zero. Check dmesg for more information.
 
1 members found this post helpful.
Old 11-19-2013, 09:22 AM   #4
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,119

Original Poster
Rep: Reputation: 46
Left blank intentionally

Last edited by stf92; 11-19-2013 at 09:31 AM. Reason: Double post.
 
Old 11-19-2013, 09:25 AM   #5
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,119

Original Poster
Rep: Reputation: 46
Quote:
Originally Posted by gnashley View Post
What does 'ls -l /dev/sd*' show? mknod doesn't write any data at all. Did you create the sda node with mknod?
Thanks so much.
Code:
root@server:~# ls -l /dev/sda*
brw-rw---- 1 root disk 8, 0 2013-11-19 08:37 /dev/sda
brw-rw---- 1 root disk 8, 1 2013-11-19 08:37 /dev/sda1
brw-rw---- 1 root disk 8, 2 2013-11-19 08:37 /dev/sda2
brw-rw---- 1 root disk 8, 3 2013-11-19 08:37 /dev/sda3
brw-rw---- 1 root disk 8, 4 2013-11-19 08:37 /dev/sda4
root@server:~#
Quote:
Originally Posted by gnashley View Post
Did you create the sda node with mknod?
No, I did not.
 
Old 11-19-2013, 09:55 AM   #6
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,119

Original Poster
Rep: Reputation: 46
Quote:
Originally Posted by guanx View Post
The position fdisk wants to read from is beyond the end of the device. You device has a size of zero. Check dmesg for more information.
Thanks. I know what happens, I think. I told FDISK from a modern free DOS distro to allocate a logical partition on sda4, an extended partition. He seemed to do everything OK. I now see he did not. I followed the advice in the cfdisk about letting the particular O.S. to do the partition. The first time I installed FreeDOS I partitioned sda4 with linux fdisk and everything went OK!

Last edited by stf92; 11-19-2013 at 11:26 AM.
 
Old 11-19-2013, 10:28 AM   #7
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,517
Blog Entries: 2

Rep: Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018
OFFTOPIC: Kernel 3.6 is EOL and totally unsupported for quite some time, I recommend to switch to one of the longterm kernels 3.4 or 3.10.
 
Old 11-20-2013, 11:54 AM   #8
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,119

Original Poster
Rep: Reputation: 46
Everything fine now. I sacrificed some unimportant files I had there and backup the other, after which a DISKPART'ed the extended partition and recreated the two logical partitions. After running lilo and booting the devices where created again. Thanks allthesame for you advices.

@TobiSGD: thanks for your notice.
 
  


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
read/write in block device driver zali Programming 4 05-05-2012 03:14 AM
[SOLVED] samba mount: block device is write-protected, onlystream Linux - Newbie 1 03-31-2012 12:30 PM
block on write call to ttyACM device gkogut Programming 1 11-04-2010 09:23 AM
How to get event when device creation is completed by mknod on linux Ubuntu 8.04? ankur_hill Programming 2 08-06-2009 07:21 AM
writing raw data to a block device nacio Linux - Software 4 05-17-2007 10:37 PM


All times are GMT -5. The time now is 11:47 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration