Linux - NewbieThis 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
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.
I think you need to back up and tell us what it is you're trying to accomplish here though. With a more focused discussion we'd be able to provide much more applicable and accurate advice.
Basically I am an Oracle DBA.
Somewhat i need good knowledge on LINUX also.
To provide ASM disk, i need to understand differences between Block devices Vs Raw devices.
1) How ASM treats Block Devices and Raw devices to provide ASM disks ?
ASM - Automatic Storage Management from Oracle.
Simply Difference between raw device and a block device in ASM.
We're not going to sit down and explain in layman's terms the entirety of how Linux handles storage devices to you. You need to do this research on your own. If you end up with a couple of specific questions, you can ask them here, but not everything under the sun. I said to run "fdisk -l /dev/sda", not "cat /proc/partitions". The major/minor numbers for block devices has nothing to do with anything else you've asked in this thread.
Last edited by suicidaleggroll; 08-02-2017 at 01:58 PM.
What specifically do you NOT understand about the explanation?
Quote:
You can see that the disks are numbered with major 8, which is the number for scsi drives (SATA disks are seen as SCSI drives) as said on the header of that section (8 block SCSI disk devices). There are several numbers for IDE drives, grep that file to see them. Minor numbers are as specified. The whole device is numbered as 0, 16, 32.. (n-1)*16. The partitions are numbered with the minor number for the drive + the number of partition. Thus, if sdb is 16, sdb1 is 17. Note that it's the partition number which counts, and not the order. For example, if sdc is 32, sdc3 is 35, and sdc5 is 37 even if sdc4 doesn't exist.
I'm not sure there is a non-technical way to describe this technical information.
On MBR:
One extended, it has to be one of the four primary partitions, and serves as a container for logical partitions.
Actually, Linux is happy with more than one extended partition. DOS/Windows is not, and that is the reason partition type 0x85 "Linux extended" was defined so that a second extended partition can exist for Linux without confusing DOS/Windows.
There are a few other partition types that contain subpartitions (e.g., 0xa5 "FreeBSD partition"), and those behave much like extended partitions in Linux.
On MBR:
One extended, it has to be one of the four primary partitions, and serves as a container for logical partitions.
I'm not aware of any limit on the number of logical partitions.
This is a common misconception. Extended partitions (or extended boot records) are actually chained internally and contain one logical partition and a pointer to the next extended partition if it exists. The first extended partition must be one of the four primary partitions and is the only one given a device node in Linux such as /dev/sdb4.
If you have an MBR disk with 2 or more logical partitions this can be shown with sudo sfdisk --show-extended /dev/sdX
If someone reading this has an MBR disk with 3 or more logical partitions please run the above command and post the results in a code block.
The following is a listing of my only remaining MBR disk with two extended partitions each containing a logical partition which can contain data. The first extended is labelled /dev/sd4. The second is hidden. They are both underlined for clarity.
The two logical partitions /are /dev/sdc5 and /dev/sdc6. Two of the four entries in each extended boot record are always empty.
Code:
sudo sfdisk --show-extended /dev/sdc
Disk /dev/sdc: 77825 cylinders, 255 heads, 63 sectors/track
Old situation:
Units: cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End #cyls #blocks Id System
/dev/sdc1 0+ 12 13- 104391 83 Linux
/dev/sdc2 13 1970 1958 15727635 83 Linux
/dev/sdc3 2493 55042 52550 422107875 83 Linux
/dev/sdc4 55043 77824 22782 182996415 5 Extended
/dev/sdc5 55043+ 61544- 6502- 52224000 83 Linux
- 61545 62067- 523- 4194667+ 5 Extended
- 55043 55042 0 0 0 Empty
- 55043 55042 0 0 0 Empty
/dev/sdc6 61545+ 62067- 523- 4194304 83 Linux
- 61545 61544 0 0 0 Empty
- 61545 61544 0 0 0 Empty
- 61545 61544 0 0 0 Empty
Here some partitions are missing.
/sda4, sda6 - where are they ? How do i check ?
There are simple explanations for both of these.
/dev/sda4 is the first extended partition which is one of the four primary partitions and is the only one given a /dev/sdX device node in Linux. As it is a container for other partitions it has no data or file systems itself so can't be mounted. You can see it is extended by noticing that its size is only 1 512-byte block. From your post cat /proc/partitions "8 4 1 sda4"
As for /dev/sda6 that could very well be the Linux swap partition. Swap partitions are mounted by the kernel and don;t have file systems that are written to by users and so don't show up in df. You can verify this with lsblk as follows:
A raw device is generally a block device that hasn't been formatted with a linux file system such as ext4 or xfs.
You are saying if a device is NOT partitioned, we can call that disk as 'RAW DISK or BLOCK DISK.
1) What is the difference between raw device and block device ?
2) All following disk partitions are block devices because first letter starts with 'b'
but raw devices will start with 'c' - am i right ?
PHP Code:
[root@CATALOG ~]# ls -l /dev/sd* brw-r----- 1 root disk 8, 0 Aug 4 00:21 /dev/sda brw-r----- 1 root disk 8, 1 Aug 4 00:21 /dev/sda1 brw-r----- 1 root disk 8, 2 Aug 4 00:21 /dev/sda2 brw-r----- 1 root disk 8, 3 Aug 4 00:21 /dev/sda3 brw-r----- 1 root disk 8, 4 Aug 4 00:21 /dev/sda4 brw-r----- 1 root disk 8, 5 Aug 4 00:21 /dev/sda5 brw-r----- 1 root disk 8, 6 Aug 4 00:21 /dev/sda6 brw-r----- 1 root disk 8, 7 Aug 4 00:21 /dev/sda7 brw-r----- 1 root disk 8, 16 Aug 4 00:21 /dev/sdb brw-r----- 1 root disk 8, 17 Aug 4 00:21 /dev/sdb1 brw-r----- 1 root disk 8, 32 Aug 4 00:21 /dev/sdc brw-r----- 1 root disk 8, 33 Aug 4 00:21 /dev/sdc1 brw-r----- 1 root disk 8, 48 Aug 4 00:21 /dev/sdd brw-r----- 1 root disk 8, 49 Aug 4 00:21 /dev/sdd1 brw-r----- 1 root disk 8, 64 Aug 4 00:21 /dev/sde brw-r----- 1 root disk 8, 65 Aug 4 00:21 /dev/sde1 brw-r----- 1 root disk 8, 80 Aug 4 00:21 /dev/sdf
I hope, some differences are there between raw devices and block devices.
They are mutually NOT exclusive.
You are saying if a device is NOT partitioned, we can call that disk as 'RAW DISK or BLOCK DISK.
I am not saying this at all. You are saying this and asking people to confirm ideas that you are essentially making up.
First of all no one has yet explained this but the concept of a block device and a "raw disk" are completely separate. Disks are always block devices at low level regardless of whether they are formatted or partitioned.
This has nothing to do with partitioning as well. It is possible to format an unpartitioned disk with a file system such as with mkfs.ext4 /dev/sda. Therefore a disk could be unpartitioned and formatted and thus not a raw device. It is better to have partitions however.
An HDD or SSD is always a block device regardless of whether it has been partitioned or formatted.
A Block ('b') Device is one with which the Driver communicates by sending entire blocks of data.
Quote:
1) What is the difference between raw device and block device ?
As mentioned they are completely separate concepts.
Quote:
2) All following disk partitions are block devices because first letter starts with 'b'
but raw devices will start with 'c' - am i right ?
No, actually you are very wrong and making things up at this point. Block devices start with 'b' while character devices start with 'c'.
If you are having a hard time understanding all of this,.. you are using Oracle Enterprise and have to pay for support. Why not use that support and call them up?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.