LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 01-02-2008, 02:10 AM   #1
telemeister
Member
 
Registered: Dec 2007
Location: Brisbane Australia
Distribution: Slackware
Posts: 63

Rep: Reputation: 16
'Activation' of USB disk using cfdisk command.


Trying to better understand handling of USB disks.

It would help if anyone can explain something that I notice when I boot
using the original slackware install DVD.

dmesg indicates that the boot has seen the USB disk. For example, At the
very end of dmesg I get following references to the USB drive (sdb on
my machine):

sdb: sdb1 sdb2
sd 3:0:0:0: Attached scsi disk sdb

However, immediately after booting I can't mount either of these partitions.
(e.g. SPECIAL DEVICE /dev/sdb1 DOES NOT EXIST)
(If I look in /dev there are no devices sdb1 or sdb2).

By accident I discovered that if I do a "cfdisk sdb" the special files get
created and then I can mount them etc.

Is this expected - that you should have to run cfdisk before the /dev/sdb1
and /dev/sdb2 special files exist.

Thanks

Steve
 
Old 01-02-2008, 02:16 AM   #2
AceofSpades19
Senior Member
 
Registered: Feb 2007
Location: Chilliwack,BC.Canada
Distribution: Slackware64 -current
Posts: 2,079

Rep: Reputation: 58
Run fdisk -l as root and see what you get
the device files should exist no matter what
 
Old 01-02-2008, 07:03 AM   #3
telemeister
Member
 
Registered: Dec 2007
Location: Brisbane Australia
Distribution: Slackware
Posts: 63

Original Poster
Rep: Reputation: 16
OK here's what happens in sequence, using fdisk:

immediately after booting with slackware 12 install DVD,
with usb disk connected, dmesg indicates that usb disk (sdb)
was detected (dmesg entries as above).

Then as root:

# mkdir /mountpoint
# mount /dev/sdb2 /mountpoint
mount : special device /dev/sdb2 does not exist

# ls /dev/*sd*

sda sda1 .......sda10 (but NO sdb files shown in /dev)



#fdisk -l

Disk /dev/sda: (gives details of sda)

(also lists all partitions on sda)
(But Gives No indication of sdb)


However....

#mount /dev/sdb2 /mountpoint

(Now this works fine)

# ls /dev/*sd*

(now shows sda, sda1...sda10 plus sdb, sdb1, sdb2)


So it appears that the "fdisk " achieves the
same thing as the "cfdisk" , i.e. creates the
special files for the usb disk.


Does this make sense?
 
Old 01-02-2008, 01:13 PM   #4
AceofSpades19
Senior Member
 
Registered: Feb 2007
Location: Chilliwack,BC.Canada
Distribution: Slackware64 -current
Posts: 2,079

Rep: Reputation: 58
(c)fdisk does not create device files, because how would you format the disk if you didn't know what it was called
 
Old 01-02-2008, 04:24 PM   #5
telemeister
Member
 
Registered: Dec 2007
Location: Brisbane Australia
Distribution: Slackware
Posts: 63

Original Poster
Rep: Reputation: 16
Well the device files aren't visible before the (c)fdisk,
but they are present after the (c)fdisk.

So if (c)fdisk isnt actually creating them, are they being
created by something else in response to the actions
of (c)fdisk?

steve
 
Old 01-02-2008, 05:28 PM   #6
AceofSpades19
Senior Member
 
Registered: Feb 2007
Location: Chilliwack,BC.Canada
Distribution: Slackware64 -current
Posts: 2,079

Rep: Reputation: 58
Quote:
Originally Posted by telemeister View Post
Well the device files aren't visible before the (c)fdisk,
but they are present after the (c)fdisk.

So if (c)fdisk isnt actually creating them, are they being
created by something else in response to the actions
of (c)fdisk?

steve
They shouldn't be, I have never heard of this before, maybe some other members have heard of this happening before
 
Old 01-02-2008, 07:00 PM   #7
telemeister
Member
 
Registered: Dec 2007
Location: Brisbane Australia
Distribution: Slackware
Posts: 63

Original Poster
Rep: Reputation: 16
Just confirming - looking at the time stamps on the /dev/sdb, sdb1,sdb2
special files confirms they are created at the time the fdisk is done.

Anyway this is not a 'problem' as such, just interesting. I thought it might be a clue to some other issues I'm having actually booting off
the sdb disk, and thought perhaps someone more experienced with slackware may have seen it before.
 
Old 01-03-2008, 07:53 PM   #8
KnightHawk
Member
 
Registered: Aug 2005
Posts: 128

Rep: Reputation: 15
I tell ya, some of you have some real stumpers.

I've fdisk'd, cfdisk's many many different types of drives, plenty of USB. Never once have I ran into what your describing. What did you use to partition the usb in the first place?

Only thing that comes to mind, is that udev is for some reasong getting delayed in scanning for devices and creating the special files. Perhaps it doesn't understand something about the partition table, and somehow fdisk helps it make sense. Really really wierd.

If at all possible I'd try writing zero's to the whole drive, repartitioning cfdisk and see if it keeps it up.
 
Old 01-03-2008, 09:15 PM   #9
telemeister
Member
 
Registered: Dec 2007
Location: Brisbane Australia
Distribution: Slackware
Posts: 63

Original Poster
Rep: Reputation: 16
Glad you also think this is a 'stumper'! Thought I was losing the plot alone here.

To answer your question. The partition in question (/dev/sdb2) is a slackware install on the second partition of the USB harddrive. It was partitioned with cfdisk during the slackware install. (The first partition had been created earlier during a SUSE install -not sure what 'tool' was used there)

The main reason I put this problem on the forum was I thought it might throw light on my 'real' problem. When booting off the /dev/sdb2 slackware installation I got a panic - (unable to mount /dev/sdb2).

This has now been solved by including an initrd with a "sleep 10" to allow USB devices to settle (courtesy of a note on the explodingpanda website). So overall I'm now up and running slackware- just thought it was an interesting' thing that I hadnt ever seen before.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
MT882 (via USB) broadband activation megha6788 Linux - Networking 12 11-06-2007 08:06 AM
installing slackware to usb harddrive...no /dev/sda2 on disk to mount for cfdisk surfbass Slackware 7 05-09-2006 07:37 AM
Which Disk tool to USE? FDISK;CFDISK;SFDISK montyw47 Linux - Newbie 1 07-17-2004 03:21 AM
how can I have cfdisk command in Redhat 8.0? broodman Linux - Newbie 12 07-19-2003 12:14 PM
cfdisk command not found chappy011 Linux - Newbie 9 03-20-2002 04:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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