Write-protected file with Extents attribute refuses to die (ubuntu)

FingerBob

New Member
Joined
Apr 16, 2024
Messages
16
Reaction score
7
Credits
136
gm ...newbie here struggling with something that should be easy.

I'm installing bitcoin core on linux (ubuntu), and have a problem overwriting a write-protected file (bitcoind.service). I've Googled and asked ChatGPT and searched the forum archive/FAQs. The solutions I've tried include the following ...but these haven't worked:

This does not work: sudo chmod +w filename
This does not work: sudo rm filename
This does not work: sudo rm -f filename
This does not work: rm -f filename

When I check via lsattr I get (something like): ---------------e------- bitcoind.service (I believe the 'e' stands for Extents).

Been at this for hours. Basically, my "bitcoind.service" file is faulty and when I recreated it I got "bitcoind.service.1". So I'm trying to replace "bitcoind.service" with "bitcoind.service.1"

Hope this makes sense. I'd appreciate any pointers - thanks in advance
 


This does not work: sudo chmod +w filename
This does not work: sudo rm filename
This does not work: sudo rm -f filename
This does not work: rm -f filename
What error message do you get when doing that? Permission denied?
Share the output of the following?
Code:
ls -l bitcoind.service
 
Hello and welcome to forums.

Question: why is there need to rewrite the service file?
Hi thanks and thanks for your reply.

I was following a YouTube step-by-step until I got stuck. Then I looked in the supporting text below and the YouTuber said that the bitcoind.service file provided didn't work - and provided a link for one that does.

Thanks again!
 
What error message do you get when doing that? Permission denied?
Share the output of the following?
Code:
ls -l bitcoind.service
Hi, thanks for coming back to me - much appreciated.

I get a few different error messages typically mentioning a read-only file system, or Operation not permitted etc.

When I type in
ls -l bitcoind.service
I get:
-rw-r--r-- 1 root root 2274 Apr 16 07:40 bitcoind.service

Thanks
 
Also, when I type: sudo cp bitcoind.service.1 bitcoind.service, I get: cp: cannot create regular file 'bitcoind.service': Read-only file system
 
Also, when I type: sudo cp bitcoind.service.1 bitcoind.service, I get: cp: cannot create regular file 'bitcoind.service': Read-only file system
Can you open the original file (not the one from youtube) with nano editor? sudo nano bitcoind.service

This assumes you're in /lib/systemd/system/ directory which is where systemd unit files are located.
If you're able to open it then you should be able to replace it's contents with those which work, but before that make a backup of the original file:

Bash:
# Assumes you're in the /lib/systemd/system/
sudo cp bitcoind.service bitcoind.service.backup
 
@FingerBob
Anyway I think this is just wrong, the software should work without hackery like this, if it doesn't then it should be removed and updated version installed.

I certainly wouldn't copy config from YT to my system.
 
@FingerBob
Anyway I think this is just wrong, the software should work without hackery like this, if it doesn't then it should be removed and updated version installed.

I certainly wouldn't copy config from YT to my system.
Thanks for coming back to me - I'll try that ...it may take a bit of time though as I'm brand new to Linux.

Hear what you're saying about copying from YT - it's less than ideal. On the plus side, I'm installing a standalone system so if I have problems they'll be isolated from my main PC.
 
So, sudo cp bitcoind.service bitcoind.service.backup doesn't work, I get: cp: cannot create regular file 'bitcoind.service.backup': Read-only file system.

And when I type: sudo nano bitcoind.service the file is loaded. It states in a red block that it's unwritable. I haven't tried to change it yet, as I haven't created a back-up of the original file.

FYI the reason I'm not overly keen on reinstalling is I'd need to find another step-by-step (which might also have problems), plus Bitcoin Core is about 700GB which took over a day to download and I'm running short on time now.

Thanks for this - I'll keep on chipping away as this may offer a solution somehow - it gives me something to go on whereas I had run out of things to try.
 
Good thought - thanks again. Yes, I originally booted from a ubuntu boot drive - although like you I'm unsure of the implications of this. Think I might need to take a time-out, been at this for ~ten hours now and I've gone round in circles so many times I'm beginning to doubt what I've done.

Now would be a perfect time to have a cigarette or e-cig if I did that sort of thing!
 
So I tried using nano as suggested by CaffeineAddict above (sudo nano bitcoind.service). Basically, I edited the original file line by line to make the changes to the updated file. This meant I had the opportunity to have a close look at the code. Nothing looked suspicious to me - but I'm a rookie. Once I finished, I saved it and got: [ Error writing bitcoind.service: Read-only file system]. Something somewhere is preventing me from editing, deleting, renaming or otherwise altering the file.
 
Hi, sure - thanks very much for the suggestion.

I'll try to use code tags. Here goes:

Code:
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sdb2 during installation
UUID=e1e96ad9-778c-49e0-bb23-4b9961d2c05c /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
UUID=6443-90B8  /boot/efi       vfat    umask=0077      0       1
/swapfile                                 none            swap    sw              0       0
 
errors=remount-ro
It appears your root filesystem is remounted as read-only due to errors, although I never saw this option errors=, it doesn't appear in docs.

Try replacing errors=remount-ro with defaults.

Do sudo nano /etc/fstab and then replace it.
To save CTRL+O followed by CTRL+X but since it's read only I suspect you'll be able to do that.
if it succeeds reboot system.
 
It appears your root filesystem is remounted as read-only due to errors, although I never saw this option errors=, it doesn't appear in docs.

Try replacing errors=remount-ro with defaults.

Do sudo nano /etc/fstab and then replace it.
To save CTRL+O followed by CTRL+X but since it's read only I suspect you'll be able to do that.
if it succeeds reboot system.
Thanks very much CaffeineAddict - I'll give this a go and report back either way. Thanks again!
 
Thanks very much CaffeineAddict - I'll give this a go and report back either way. Thanks again!
Keep in mind that you likely need your Linux installed on a hard drive, not booted from USB or DVD.
Otherwise it makes no sense to change any settings.
 
Yes, I've installed it on a 2TD SSD, on standalone hardware.

I did what you suggested and when I tried to save the file I got:
Code:
[ Error writing bitcoind.service: Read-only file system]
highlighted in red.

Thanks for the suggestion though - I genuinely appreciate your help.

It's 7pm in the UK, so I should probably break for dinner and a rethink. Maybe I should go back to the start of the step-by-step video and see if I can spot something that I've missed. However, the notes below the video specifically refer to the issue, so that's probably looking for something that's already apparent under my nose. And, the solution appear to be as simple as replacing one file with another.

Thanks once again!
 
UPDATE: After trying a number of other things, I decided it was time to shut the system down and restart.

This was an error. I should have archived-off Bitcoin Core (700GB) before shutting down, as Linux will now not start up. This has likely killed my schedule/roadmap. There is a way of starting Linux in safe mode - I've done this and it still won't load. There may be some other things I can try. I'll be doing this, but realise that it's beginning to look like going back to the beginning ...unless I can somehow reinstall Linux without losing Bitcoin Core. Thanks again
 


Latest posts

Top