Can filesystems be created only on block devices, but not on character devices?
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
Can filesystems be created only on block devices, but not on character devices?
Can a filesystem be viewed as a block device itself (for example, when programming to use a file system)?
My guess is yes, not very surely based on the followings:
There is a diagram for Linux, from Operating System Concepts:
It seems that in Understanding the Linux Kernel, the IO operations on regular files and on block device files are largely implemented similarly to each other above device drivers, compared to IO operations on character device files.
Thanks.
I seem to remember there are filesystems not built upon physical devices, such as /proc
. But I am not thinking about them, or just think of them as being built upon RAM, which is a block device, isn't it?
filesystems devices block-device character-device
add a comment |Â
up vote
0
down vote
favorite
Can filesystems be created only on block devices, but not on character devices?
Can a filesystem be viewed as a block device itself (for example, when programming to use a file system)?
My guess is yes, not very surely based on the followings:
There is a diagram for Linux, from Operating System Concepts:
It seems that in Understanding the Linux Kernel, the IO operations on regular files and on block device files are largely implemented similarly to each other above device drivers, compared to IO operations on character device files.
Thanks.
I seem to remember there are filesystems not built upon physical devices, such as /proc
. But I am not thinking about them, or just think of them as being built upon RAM, which is a block device, isn't it?
filesystems devices block-device character-device
Are you after a conceptual answer, or the answer based on the Linux implementation?
â Stephen Kitt
Sep 25 at 16:43
Thanks for asking. Actually both. If not possible, either is fine. I prefer Linux for more practical reason. But I like to be clear at concept level in the first place.
â Tim
Sep 25 at 16:44
1
This question rather presumes the falsehood that all Unix and Linux operating systems have block devices. unix.stackexchange.com/questions/89887 unix.stackexchange.com/questions/259193
â JdeBP
Sep 25 at 16:45
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Can filesystems be created only on block devices, but not on character devices?
Can a filesystem be viewed as a block device itself (for example, when programming to use a file system)?
My guess is yes, not very surely based on the followings:
There is a diagram for Linux, from Operating System Concepts:
It seems that in Understanding the Linux Kernel, the IO operations on regular files and on block device files are largely implemented similarly to each other above device drivers, compared to IO operations on character device files.
Thanks.
I seem to remember there are filesystems not built upon physical devices, such as /proc
. But I am not thinking about them, or just think of them as being built upon RAM, which is a block device, isn't it?
filesystems devices block-device character-device
Can filesystems be created only on block devices, but not on character devices?
Can a filesystem be viewed as a block device itself (for example, when programming to use a file system)?
My guess is yes, not very surely based on the followings:
There is a diagram for Linux, from Operating System Concepts:
It seems that in Understanding the Linux Kernel, the IO operations on regular files and on block device files are largely implemented similarly to each other above device drivers, compared to IO operations on character device files.
Thanks.
I seem to remember there are filesystems not built upon physical devices, such as /proc
. But I am not thinking about them, or just think of them as being built upon RAM, which is a block device, isn't it?
filesystems devices block-device character-device
filesystems devices block-device character-device
edited Sep 25 at 16:46
asked Sep 25 at 16:37
Tim
23.8k67232417
23.8k67232417
Are you after a conceptual answer, or the answer based on the Linux implementation?
â Stephen Kitt
Sep 25 at 16:43
Thanks for asking. Actually both. If not possible, either is fine. I prefer Linux for more practical reason. But I like to be clear at concept level in the first place.
â Tim
Sep 25 at 16:44
1
This question rather presumes the falsehood that all Unix and Linux operating systems have block devices. unix.stackexchange.com/questions/89887 unix.stackexchange.com/questions/259193
â JdeBP
Sep 25 at 16:45
add a comment |Â
Are you after a conceptual answer, or the answer based on the Linux implementation?
â Stephen Kitt
Sep 25 at 16:43
Thanks for asking. Actually both. If not possible, either is fine. I prefer Linux for more practical reason. But I like to be clear at concept level in the first place.
â Tim
Sep 25 at 16:44
1
This question rather presumes the falsehood that all Unix and Linux operating systems have block devices. unix.stackexchange.com/questions/89887 unix.stackexchange.com/questions/259193
â JdeBP
Sep 25 at 16:45
Are you after a conceptual answer, or the answer based on the Linux implementation?
â Stephen Kitt
Sep 25 at 16:43
Are you after a conceptual answer, or the answer based on the Linux implementation?
â Stephen Kitt
Sep 25 at 16:43
Thanks for asking. Actually both. If not possible, either is fine. I prefer Linux for more practical reason. But I like to be clear at concept level in the first place.
â Tim
Sep 25 at 16:44
Thanks for asking. Actually both. If not possible, either is fine. I prefer Linux for more practical reason. But I like to be clear at concept level in the first place.
â Tim
Sep 25 at 16:44
1
1
This question rather presumes the falsehood that all Unix and Linux operating systems have block devices. unix.stackexchange.com/questions/89887 unix.stackexchange.com/questions/259193
â JdeBP
Sep 25 at 16:45
This question rather presumes the falsehood that all Unix and Linux operating systems have block devices. unix.stackexchange.com/questions/89887 unix.stackexchange.com/questions/259193
â JdeBP
Sep 25 at 16:45
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
File systems in general are built on block devices, unless they are used as an interface to the kernel or access files across the network or are implemented in user space. If you want to store files on a hard disk or ssd, accessing it as a block device is the easiest way. There exist file systems like SquashFS that don't align data on block boundaries, but they still use the underlying buffer cache that works on block devices. Some Unix systems present character devices to access the disk without using the buffer cache, on Linux open
with the O_DIRECT
flag is used for this.
You can use a file as a block device, see losetup
.
A file system is not a block device.
Thanks. "they are used as an interface to the kernel or access files across the network or are implemented in user space". Can you give examples for the three cases?
â Tim
2 hours ago
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
File systems in general are built on block devices, unless they are used as an interface to the kernel or access files across the network or are implemented in user space. If you want to store files on a hard disk or ssd, accessing it as a block device is the easiest way. There exist file systems like SquashFS that don't align data on block boundaries, but they still use the underlying buffer cache that works on block devices. Some Unix systems present character devices to access the disk without using the buffer cache, on Linux open
with the O_DIRECT
flag is used for this.
You can use a file as a block device, see losetup
.
A file system is not a block device.
Thanks. "they are used as an interface to the kernel or access files across the network or are implemented in user space". Can you give examples for the three cases?
â Tim
2 hours ago
add a comment |Â
up vote
1
down vote
File systems in general are built on block devices, unless they are used as an interface to the kernel or access files across the network or are implemented in user space. If you want to store files on a hard disk or ssd, accessing it as a block device is the easiest way. There exist file systems like SquashFS that don't align data on block boundaries, but they still use the underlying buffer cache that works on block devices. Some Unix systems present character devices to access the disk without using the buffer cache, on Linux open
with the O_DIRECT
flag is used for this.
You can use a file as a block device, see losetup
.
A file system is not a block device.
Thanks. "they are used as an interface to the kernel or access files across the network or are implemented in user space". Can you give examples for the three cases?
â Tim
2 hours ago
add a comment |Â
up vote
1
down vote
up vote
1
down vote
File systems in general are built on block devices, unless they are used as an interface to the kernel or access files across the network or are implemented in user space. If you want to store files on a hard disk or ssd, accessing it as a block device is the easiest way. There exist file systems like SquashFS that don't align data on block boundaries, but they still use the underlying buffer cache that works on block devices. Some Unix systems present character devices to access the disk without using the buffer cache, on Linux open
with the O_DIRECT
flag is used for this.
You can use a file as a block device, see losetup
.
A file system is not a block device.
File systems in general are built on block devices, unless they are used as an interface to the kernel or access files across the network or are implemented in user space. If you want to store files on a hard disk or ssd, accessing it as a block device is the easiest way. There exist file systems like SquashFS that don't align data on block boundaries, but they still use the underlying buffer cache that works on block devices. Some Unix systems present character devices to access the disk without using the buffer cache, on Linux open
with the O_DIRECT
flag is used for this.
You can use a file as a block device, see losetup
.
A file system is not a block device.
answered Sep 25 at 17:14
RalfFriedl
4,2481725
4,2481725
Thanks. "they are used as an interface to the kernel or access files across the network or are implemented in user space". Can you give examples for the three cases?
â Tim
2 hours ago
add a comment |Â
Thanks. "they are used as an interface to the kernel or access files across the network or are implemented in user space". Can you give examples for the three cases?
â Tim
2 hours ago
Thanks. "they are used as an interface to the kernel or access files across the network or are implemented in user space". Can you give examples for the three cases?
â Tim
2 hours ago
Thanks. "they are used as an interface to the kernel or access files across the network or are implemented in user space". Can you give examples for the three cases?
â Tim
2 hours ago
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f471376%2fcan-filesystems-be-created-only-on-block-devices-but-not-on-character-devices%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Are you after a conceptual answer, or the answer based on the Linux implementation?
â Stephen Kitt
Sep 25 at 16:43
Thanks for asking. Actually both. If not possible, either is fine. I prefer Linux for more practical reason. But I like to be clear at concept level in the first place.
â Tim
Sep 25 at 16:44
1
This question rather presumes the falsehood that all Unix and Linux operating systems have block devices. unix.stackexchange.com/questions/89887 unix.stackexchange.com/questions/259193
â JdeBP
Sep 25 at 16:45