libera/#devuan/ Friday, 2024-11-01

AhmadRaniriHello, Could I get the example of network service for sysvinit ? I'm not on devuan rn. The service I'm looking for is related to /etc/network/interfaces. Thanks.10:18
AhmadRaniriMy email : lidgnulinux@gmail.com10:19
foresterGood evening. I have installed devuan daedalus on PC with sda1 /, sda2 /home, sda3 another linux, sda4 swap. Then was trying to set zram using instractions on internet, this way and that way. As a result something went wrong, and now there are sda1 /, sda2 swap, sda3 swap, sda4 swap. I again have install new daedalus on sda1. I am still hoping to save my sda2 with many years collected data... Somehow it is needed to change swap on ext4 (18:17
foresteras it was before). Could someone tell me direction how to save that data without external harddrive (because I have no one). Thank you.18:17
rwpforester, No backups of your /home elsewhere?  I don't really know if an ext4 file system overwritten with mkswap is recoverable.  But you want to avoid doing any writing to it further which would only make things worse.  Also make a bit copy of the partition in order to have a backup to work through attempts at recovery of it.18:38
foresterrwp: Thank you. No backups. I do not touch sda2 (where /home was).18:39
foresterI use sda1.18:39
foresterNew /home is on sda1.18:40
foresterNow trying to ask on another channels.18:40
rwpI am not an expert on this type of recovery.  I assume it was ext4?  mkswap will have overwritten the ext4 partition signature with a swap signature.  That might be, not sure, the only bits that were overwritten.18:40
foresterI hope you are right.18:41
rwpIt seems plausible, I don't know, that writing over that swap signature with an ext4 signature might be enough.18:41
foresterI think it was due to mkswap too.18:41
rwpYou don't have any place to store a backup of the data?  I really think a backup for safety is needed.18:42
foresterAlas, I don't.18:42
n4dirwhat amount of data we speak of?18:42
rwpVery scary to be trying to do anything with data that is important without a backup of it.  Not even an SD card on a USB that could store the data?18:43
n4dirwell, the amount really doesn't matter. You want a backup.18:43
forestern4dir: about 250 Gb18:44
n4diron Amazon for a stick that is like 20 Dollars18:45
n4dirnot much help if you don't have them, but you really want a backup.18:45
foresterrwp: The data on former /home on sda2 is unseen. Do you mean to use util to recover data?18:45
rwpI have only been working with Unix and Linux systems since the 1990s and I would not myself attempt this type of recovery without a backup.18:46
n4diri backup on old computers people don't need anymore.18:46
rwpThat's a good option.  Back up to another computer.18:46
rwpCaution on those cheap but very large Amazon USB sticks as most of those are counterfeits and don't actually have the storage.18:47
yetiI'd not use flash storage for backups18:47
rwpAnything bought off Amazon needs to be tested to verify that it is not a counterfeit!  Let me stress that point strongly!18:47
n4dirjust the general idea what amount of money would be needed.18:48
foresterrwp: I even think about saving sda2 as it is and try to fetch file from there by portions with special util.18:48
rwpI am pretty sure that mkswap only writes a swap signature to the partition.18:49
rwpIn which case replacing exactly the bytes that mkswap has written with an ext4 signature seems plausible.18:49
rwpI would not do this without fully testing the process elsewhere in ideal laboratory conditions to verify that it has a chance before touching the actual critical data.18:50
foresterExcuse me.18:57
foresterBefore my exit I did not read last message.18:58
Xenguyforester, See http://reisenweber.net/irclogs/libera/_devuan/18:59
foresterI hope the same about changing swap to ext418:59
gnarfaceforester: here's what i would do if this has any value to you: 1) immediately power off the computer, DO NOT SHUT IT DOWN BECAUSE the "deactivating swap" phase, i dunno what that might do. 2) get a spare drive with enough space you can connect by USB 3) get ANOTHER spare drive you can boot from USB and put the devuan live iso on it, and boot that...18:59
gnarface... 4) use dd to copy the partitions to the spare drive one at a time as whole files18:59
gnarface... 5) mount those files as loopback devices, and then proceed with whatever ext4 boot sector voodoo you can muster18:59
gnarfacesorry, not mount, mount would not be the right term, i guess you'd probably connect them as loopback devices but stop short of actually mounting them19:00
gnarfacethen in theory you could edit them raw as though they were actual devices19:01
gnarfacein theory the live iso should not actually change any data, so this should at least give you the ability to try again if you screw up the first try19:02
rwpIs it possible that there might be a friend you could have help to provide space and experience who might be able to help you?19:02
rwpI understand you do not have anything in your hands at this time.  But making a mistake now can turn a recoverable problem into an impossible to recover situation.19:02
forestergnarface:  Thank you a lot for your participation in my situation. But I have no that equipment.19:03
foresterrwp: It's ok. It's a lesson.19:03
rwpLife is where you get the test first and the lesson second.19:03
rwpI am considering if I have time to set up a VM with a /home partition just as you have done.  Then mkswap over it.  Then see what bytes were changed and attempt to replace them.19:04
gnarfaceforester: yea, unfortunately i don't see a sane/safe way out of this without buying or borrowing some equipment. in theory if you had access to even enough spare space on a remote server that would be enough to carry out this process, but uploading 250GB over even fast consumer internet connections is gonna be punishingly slow19:04
gnarfacewere these partitions quite full? if they weren't, and you dd with the "conv=sparse" flag then that might help it take less time19:05
rwpforester, Do you know what file system type /home was before?  You said it had years of your stuff on it.  Was it ext4?  Or ext3?  Or xfs?19:05
forestergnarface: sda2 was almost full.19:13
foresterrwp: ext419:13
gnarfaceforester: so what you're gonna need is at least the amount of space sda2 was using on a generous friend's spare server, and probably at least a solid 2-3 days of time and a internet plan with unlimited bandwidth19:17
gnarfaceand a lot of patience...19:17
gnarfaceand possibly also a reliable source of power19:17
gnarfacethough i suppose if it's a laptop with a good battery that should be less vital19:18
foresterNow I am reading this https://www.reddit.com/r/linuxquestions/comments/k9m61h/accidentally_ran_mkswap_on_ext4_partition/?rdt=5122719:20
gnarfaceforester: looks legit, but i'd still be hesitant to try it on the bare metal before testing on a copy first19:22
gnarfacesounds like, in theory, as long as nothing "swapon'd" it, maybe your data is still all there19:23
gnarfacealso, i know this probably seems to be a petty thing to add now, but just fyi devuan has a package called "zram-tools" that would have set this all up for you completely safely and automatically19:25
forestergnarface: no it dows not.19:26
gnarfacethere's often advice you can find out there for doing various things through cludgey manual setups that generically applies to most all distros, but for something that isn't bleeding-edge new, it's usually a better idea to seek distro native solutions first19:26
foresterit does not19:26
rwpI skimmed that Reddit and it seems plausible.19:26
gnarfaceuh, i'm pretty sure it does, and if it doesn't all you have to do is make a minor change to /etc/default/zramswap19:26
gnarfacei'm using this right now on several arm devices19:27
gnarfacei swear to you i didn't have to call mkswap once19:27
forestergnarface: your approach is good indeed.19:27
gnarfacei know it doesn't help right now, but you know... something to consider for next time you're trying something new. there's like 70,000 packages in the repos just for x86, and one of the best pieces of advice i got from the old days in #debian before all this systemd crap appeared was to always when trying to solve a problem check to see if someone had already solved and packaged it first19:30
gnarface(the second best piece of advice was to always keep a backup, but probably the third best was to ask for help in IRC before breaking everything)19:31
forester:)19:31
rwpI read through the recoveries suggested in that Reddit in more detail and honestly I am going to save those off into MY notes.  It's definitely more detailed there than what I know about these things.  It all seems plausible.  I think you found a possible to way rescue yourself in that article.19:33
foresterrwp: Thank you. Your opinion is very important for me. I need take a break before going on.19:38
rwpforester, I am stepping away from the keyboard but before doing so wanted to wish you good luck in your recovery.  I think you have a path to success.  You must be very careful though.  Good Luck!19:51
foresterThank you. I am trying. And  bash: dumpe2fs: command not found19:54
gnarfaceforester: it's in the e2fsprogs package19:55
fsmithredforester, it's in /sbin. If you used 'su' to become root it's probably not in your path.19:55
foresterIt looks like devuan does not have that stuff. Isn't it?19:55
fsmithredUse 'su -19:55
fsmithredsu -19:55
gnarfaceoh, yea might be just a path issue19:55
fsmithreddevuan has whatever debian has (except systemd)19:56
foresterMaybe you could give a quick solution how to allow my user to use sudo?19:57
gnarfaceyou should have sudo access by default if it's installed...19:57
gnarfaceshouldn't you? maybe you have to add yourself to the sudo group19:57
gnarfaceyea, maybe you have to be in the sudo group19:58
fsmithredyeah, you only automatically get into sudo group if you don't set up a root account19:58
fsmithredsu -19:58
fsmithredthe dash at the end is important19:58
fsmithredor su --login19:58
foresterok. I see su -19:58
fsmithrednote that it will move you to /root instead of keeping you in your current directory20:00
fsmithredI need an alias to 'su -' that puts me back in the directory where I was.20:01
foresterhome: ***** FILE SYSTEM WAS MODIFIED *****20:12
foresterhome: ********** WARNING: Filesystem still has errors **********20:12
foresterhome: 709761/18038784 files (2.0% non-contiguous), 59257567/72142334 blocks20:12
gnarfacewell, i would backup the important stuff if you can mount it now, then fsck it20:15
_ds_Also, make sure to mount it read-only.20:16
gnarfaceyea, good call20:17
gnarfaceto be clear, you don't fsck it while mounted, but you should mount read-only and try to copy any important files off before fscking it, just to avoid the relatively rare risk of fsck shredding the whole partition20:18
foresterWhy should I use fsck at all?20:19
gnarface(and the reason to mount read-only is also because the mount action itself might trigger some journal mechanism that in theory could otherwise shred the partition accidentally)20:19
gnarfaceoh, uh, fsck will correct the errors, in theory20:19
gnarfaceit's just not quite 100% safe20:20
gnarfacenot in the situation you're in anyway20:20
foresteris it possible to use partition without fscking?20:20
gnarfacewell, obviously there's no need to fsck at all though if you can get all the files off first and just reformat it then copy them back20:20
gnarfacebut if you're gonna keep using it, definitely either fsck or reformat are gonna be necessary at some point20:21
gnarfaceotherwise this filesystem will just continue to unravel like the sweater in that one weezer song20:21
gnarfacebut mounting it read-only will give you the chance to safely suss out whether you can get your files copied off first or not20:23
foresterI have a 64Gb usb drive, where some important files were copied from 250 Gb. I have inserted in and it is shown than usb drive with fat32 is swap too!20:24
gnarfaceuh... that's weird20:24
gnarfacedid you maybe change the partition type to be swap accidentally?20:25
gnarfacethe partition table stores a filesystem type label independently of whatever the filesystem inside has set internally, and it's possible for them to disagree20:25
foresterI don't know. I am trying take a look on my sda220:26
gnarfacenow i'm really disturbed about what order of events might have lead to this outcome...20:26
gnarfacethis usb drive wasn't actually connected to the machine while you were setting up zramswap was it?20:27
gnarfaceyou should be able to check the partition types in fdisk20:28
forestergnarface: It was. I listen audio from it.20:31
gnarfaceah20:31
gnarfacethat probably explains it20:31
gnarfaceyou gotta really figure out what you typed that caused that change to be made to every partition on every drive connected and... don't type it ever again20:33
foresterI am slowly breathing out with hope. Thank you. Thank you all who took a part in the situation.20:37
foresterNow I need to check sda3. And then somehow try to fix usb with fat32.20:38

Generated by irclog2html.py 2.17.0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!