LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 11-20-2008, 01:55 PM   #1
kinetic
Member
 
Registered: Aug 2007
Location: Fort Collins, Colorado
Distribution: Gentoo
Posts: 64

Rep: Reputation: 17
Linux won't read partitions on second hd!


Code:
root@XD:~# fdisk /dev/sdb

The number of cylinders for this disk is set to 19457.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x2569d78a

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       18236   146480638+  83  Linux
/dev/sdb2   *       18237       19457     9807682+   b  W95 FAT32

Command (m for help):
Code:
root@XD:~# ls /dev/sdb1
ls: cannot access /dev/sdb1: No such file or directory
Code:
root@XD:~# ls /dev/sdb2
ls: cannot access /dev/sdb2: No such file or directory
I really don't get it...
Using latest version of Ubuntu

Code:
root@XD:~# uname -a
Linux XD 2.6.27-7-generic #1 SMP Tue Nov 4 19:33:20 UTC 2008 i686 GNU/Linux
 
Old 11-20-2008, 02:07 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
The ls command works on filesystems. It does not work on devices or partitions. /dev/sdb1 and /dev/sdb2 are partitions, not filesystems. You have to mount a partition on a mountpoint before you can access the filesystem on the partition. Use the mount command to see if the partitions are already mounted:

mount

If they are mounted then you can use the ls command against the mountpoint. If they are not mounted then you can mount the partitions on mountpoints and then list the mountpoint with the ls command. See:

man mount

------------------------------
Steve Stites
 
Old 11-21-2008, 06:55 PM   #3
kinetic
Member
 
Registered: Aug 2007
Location: Fort Collins, Colorado
Distribution: Gentoo
Posts: 64

Original Poster
Rep: Reputation: 17
I understand the difference between a partition and a device file. I was simply trying to show that the device files for those partitions aren't being created on boot. I don't know what else to say, "mount /dev/sdb1" doesn't work because the file at "/dev/sdb1" doesn't exist!

I don't know where to even begin with this problem! Please help!

Answers to obvious questions:
  • Yes it's a SATA drive.
  • Yes it works.
  • Yes I'M SURE that the partitions are created properly.
  • Yes I'm using udev.
  • No, the partitions aren't showing up in /sys/block/sdb
  • Yes I have experience with linux and the way hardware is supposed to work!

The weird thing is that if I go through this process, the partitions show up:
  1. Open up parted
  2. Delete the partitions
  3. Exit parted
  4. Go back into parted and re-make the partitions
  5. Exit back out

So, I can tell everything is working hardware-wise, it's just every time I reboot, I have to go back through that process. Any ideas?
 
Old 11-21-2008, 07:00 PM   #4
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Nothing else useful in /dev?
 
Old 11-22-2008, 09:05 PM   #5
kinetic
Member
 
Registered: Aug 2007
Location: Fort Collins, Colorado
Distribution: Gentoo
Posts: 64

Original Poster
Rep: Reputation: 17
Oh, sure. Lots of useful things in /dev.

For instance, if I want to hear some static, I can type
cat /dev/random > /dev/dsp

But no, nothing as far as the partitions for the second hard drive. (Did you read my last post or do you just like posting esoteric responses?)

Last edited by kinetic; 11-22-2008 at 09:09 PM.
 
Old 11-22-2008, 09:23 PM   #6
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,363

Rep: Reputation: 172Reputation: 172
When you mount something you have to give it a mount point. mount /dev/sb1 /mountpont

The directory you are mounting to has to exist too.
 
Old 11-22-2008, 10:15 PM   #7
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Quote:
Originally Posted by kinetic View Post
Oh, sure. Lots of useful things in /dev.

For instance, if I want to hear some static, I can type
cat /dev/random > /dev/dsp

But no, nothing as far as the partitions for the second hard drive. (Did you read my last post or do you just like posting esoteric responses?)
All you said was you didn't have /dev/sdb1 you ....

You don't sound like you have much of a clue, so I assume you don't. Nothing to change my mind so far.

Hope you don't want too much help in the future.

Last edited by billymayday; 11-22-2008 at 10:17 PM.
 
Old 11-23-2008, 02:07 AM   #8
Electro
LQ Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
Linux or any OS does not re-scan the partition table after it has been created. In DOS, fdisk warns that if partitions are created or deleted, the system needs to be rebooted. In Linux there is a quick way to do a force re-scan of the partition table using the hdparm utility. Any new partitions will have to be re-scanned. The following syntax is used to rescan the partitions of a desire hard drive.

hdparm -z /dev/sdb

Mounting SCSI hard drives upon boot up are a little tricky. Using a device node can not be used since it changes depending what drive the BIOS detects first. You have to mount using either LABEL, UUID, PATH, or ID. LABEL and UUID is the preferred choice.

If the drive is not being recognized by the kernel, look at the logs.
 
Old 11-23-2008, 02:22 PM   #9
kinetic
Member
 
Registered: Aug 2007
Location: Fort Collins, Colorado
Distribution: Gentoo
Posts: 64

Original Poster
Rep: Reputation: 17
Thank you so much for the helpful response Electro!

It's the oddest thing... Even though the two partitions were recognized (in the /dev folder and the /sys/block/sdb folder) after I went through the previously-mentioned process, when I ran "hdparm -z /dev/sdb" they disappeared again!

Here is the output of "dmesg | grep hdb":
Code:
[    6.819683] sd 6:0:1:0: [sdb] 312581808 512-byte hardware sectors (160042 MB)
[    6.819701] sd 6:0:1:0: [sdb] Write Protect is off
[    6.819703] sd 6:0:1:0: [sdb] Mode Sense: 00 3a 00 00
[    6.819733] sd 6:0:1:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    6.819794] sd 6:0:1:0: [sdb] 312581808 512-byte hardware sectors (160042 MB)
[    6.819811] sd 6:0:1:0: [sdb] Write Protect is off
[    6.819813] sd 6:0:1:0: [sdb] Mode Sense: 00 3a 00 00
[    6.819843] sd 6:0:1:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    6.819847]  sdb:<4>Driver 'sr' needs updating - please use bus_type methods
[    6.863764]  sdb1 sdb2
[    6.863896] sd 6:0:1:0: [sdb] Attached SCSI disk
[ 1019.083051] sd 6:0:1:0: [sdb] 312581808 512-byte hardware sectors (160042 MB)
[ 1019.083758] sd 6:0:1:0: [sdb] Write Protect is off
[ 1019.083763] sd 6:0:1:0: [sdb] Mode Sense: 00 3a 00 00
[ 1019.084697] sd 6:0:1:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 1019.085505]  sdb: sdb1 sdb2
[260044.963731] sd 6:0:1:0: [sdb] 312581808 512-byte hardware sectors (160042 MB)
[260044.964562] sd 6:0:1:0: [sdb] Write Protect is off
[260044.964567] sd 6:0:1:0: [sdb] Mode Sense: 00 3a 00 00
[260044.965652] sd 6:0:1:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[260044.965978]  sdb: sdb1 sdb2
[260077.984570] sd 6:0:1:0: [sdb] 312581808 512-byte hardware sectors (160042 MB)
[260077.985340] sd 6:0:1:0: [sdb] Write Protect is off
[260077.985344] sd 6:0:1:0: [sdb] Mode Sense: 00 3a 00 00
[260077.986327] sd 6:0:1:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[260077.987166]  sdb: sdb1 sdb2
It looks like the kernel sees the partitions but udev doesn't. I'll try upgrading my udev and my kernel and see how it works.
 
  


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
How to read outside of your Linux partitions. CyberLord_7 Linux - Newbie 2 03-07-2006 09:22 AM
NEEDED NOW : How to read Linux RAID partitions ? johnlefevre Mandriva 19 10-10-2005 05:31 AM
NEEDED NOW : How to read Linux RAID partitions ? johnlefevre Linux - Newbie 4 10-08-2005 06:41 PM
How to get XP to read Linux partitions? XxAndyxX General 14 02-06-2005 09:15 PM
Linux can read NTFS partitions...how? Quew Linux - Newbie 4 12-28-2003 04:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 09:17 PM.

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