Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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:
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:
Open up parted
Delete the partitions
Exit parted
Go back into parted and re-make the partitions
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?
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.
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!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.