View previous topic :: View next topic |
Author |
Message |
Lord.DragonFly.of.Dawn Advanced Member

Joined: 18 Jul 2025 Posts: 607 Location: South Portland, Maine, USA, Earth, Sol System
|
Posted: Wed Oct 29, 2025 2:59 pm Post subject: Writing a daemon. need help with FUSE. |
|
|
I am working on a program that manipulates raw block devices and it requires knowledge of the exact partition size.
I've tried a couple of different approaches (fopen/fseek, and statvfs)
both give incorrect results (at least when I tried) and statvfs has the limitation that one or more of the block devices i will be manipulating is not formatted so it would fail.
because of the libraries i am using i am limited to standard GNU C99 so I'm hoping someone knows how i can pull this off, or has better google-fu than I and can find out how.
Thanks in advance!
-Patrick
_________________ ArchLinux x86_64 - Custom Built Desktop
ArchLinux x86_64 - Compaq CQ50 Laptop
ArchLinux i686 - Acer Aspire One Netbook
ArchLinux i686 - Dell Presario ze2000 (w/ shattered LCD)
PuppyLinux, CloneZilla, PartedMagic, DBAN - rescue thumbdrives
Windows 7 (x86_64 desktop alternate boot)
Last edited by Lord.DragonFly.of.Dawn on Sun Nov 02, 2025 4:08 am; edited 2 times in total |
|
Back to top |
|
Rootboy Sr. Member

Joined: 11 Aug 2025 Posts: 1947 Location: Lewisburg, Tennessee
|
|
Back to top |
|
nukes Linux Guru

Joined: 29 Aug 2025 Posts: 4558
|
|
Back to top |
|
Lord.DragonFly.of.Dawn Advanced Member

Joined: 18 Jul 2025 Posts: 607 Location: South Portland, Maine, USA, Earth, Sol System
|
Posted: Sat Nov 01, 2025 8:27 pm Post subject: |
|
|
Actually. I had already solved the problem. (about ten minutes ago actually)
After doing some research I determined that the device i was working with was only a 2GiB hard drive rather than the 20GiB i had been told it was. That does explain the factor of ten error i was getting.
so an open + lseek is working and will work for devices up to (with a 64 bit off_t type) 2^64 bytes or 16EiB! Plenty big enough for me!
Still wish i had been told the accurate drive sizes ahead of time. Wouldn't have wasted as much time trying to debug a algorithm that was already working.
_________________ ArchLinux x86_64 - Custom Built Desktop
ArchLinux x86_64 - Compaq CQ50 Laptop
ArchLinux i686 - Acer Aspire One Netbook
ArchLinux i686 - Dell Presario ze2000 (w/ shattered LCD)
PuppyLinux, CloneZilla, PartedMagic, DBAN - rescue thumbdrives
Windows 7 (x86_64 desktop alternate boot)
|
|
Back to top |
|
Lord.DragonFly.of.Dawn Advanced Member

Joined: 18 Jul 2025 Posts: 607 Location: South Portland, Maine, USA, Earth, Sol System
|
Posted: Sun Nov 02, 2025 4:08 am Post subject: |
|
|
okay. new problem, same program so i'll reuse the thread.
The program is a file system daemon using the fuse libraries.
<strike>It's working for almost everything i want it to, but for some reason the file system exported by fuse is completely unreadable by anyone other than the user that created it (this includes the superuser) Since i intend to export a file (statistics) that should at least be readable by everyone on the system this is a bit of a problem.
Does anyone know a trick that can solve this? I could simply write it to a file sitting outside of the fuse file system, but that is a rather inelegant solution to me.</strike>
.... never mind..... I'm just an idiot is all.
_________________ ArchLinux x86_64 - Custom Built Desktop
ArchLinux x86_64 - Compaq CQ50 Laptop
ArchLinux i686 - Acer Aspire One Netbook
ArchLinux i686 - Dell Presario ze2000 (w/ shattered LCD)
PuppyLinux, CloneZilla, PartedMagic, DBAN - rescue thumbdrives
Windows 7 (x86_64 desktop alternate boot)
|
|
Back to top |
|
|