| AhmadRaniri | Hello, 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 |
|---|---|---|
| AhmadRaniri | My email : lidgnulinux@gmail.com | 10:19 |
| forester | Good 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 |
| forester | as 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 |
| rwp | forester, 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 |
| forester | rwp: Thank you. No backups. I do not touch sda2 (where /home was). | 18:39 |
| forester | I use sda1. | 18:39 |
| forester | New /home is on sda1. | 18:40 |
| forester | Now trying to ask on another channels. | 18:40 |
| rwp | I 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 |
| forester | I hope you are right. | 18:41 |
| rwp | It seems plausible, I don't know, that writing over that swap signature with an ext4 signature might be enough. | 18:41 |
| forester | I think it was due to mkswap too. | 18:41 |
| rwp | You don't have any place to store a backup of the data? I really think a backup for safety is needed. | 18:42 |
| forester | Alas, I don't. | 18:42 |
| n4dir | what amount of data we speak of? | 18:42 |
| rwp | Very 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 |
| n4dir | well, the amount really doesn't matter. You want a backup. | 18:43 |
| forester | n4dir: about 250 Gb | 18:44 |
| n4dir | on Amazon for a stick that is like 20 Dollars | 18:45 |
| n4dir | not much help if you don't have them, but you really want a backup. | 18:45 |
| forester | rwp: The data on former /home on sda2 is unseen. Do you mean to use util to recover data? | 18:45 |
| rwp | I 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 |
| n4dir | i backup on old computers people don't need anymore. | 18:46 |
| rwp | That's a good option. Back up to another computer. | 18:46 |
| rwp | Caution on those cheap but very large Amazon USB sticks as most of those are counterfeits and don't actually have the storage. | 18:47 |
| yeti | I'd not use flash storage for backups | 18:47 |
| rwp | Anything bought off Amazon needs to be tested to verify that it is not a counterfeit! Let me stress that point strongly! | 18:47 |
| n4dir | just the general idea what amount of money would be needed. | 18:48 |
| forester | rwp: I even think about saving sda2 as it is and try to fetch file from there by portions with special util. | 18:48 |
| rwp | I am pretty sure that mkswap only writes a swap signature to the partition. | 18:49 |
| rwp | In which case replacing exactly the bytes that mkswap has written with an ext4 signature seems plausible. | 18:49 |
| rwp | I 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 |
| forester | Excuse me. | 18:57 |
| forester | Before my exit I did not read last message. | 18:58 |
| Xenguy | forester, See http://reisenweber.net/irclogs/libera/_devuan/ | 18:59 |
| forester | I hope the same about changing swap to ext4 | 18:59 |
| gnarface | forester: 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 files | 18:59 |
| gnarface | ... 5) mount those files as loopback devices, and then proceed with whatever ext4 boot sector voodoo you can muster | 18:59 |
| gnarface | sorry, 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 them | 19:00 |
| gnarface | then in theory you could edit them raw as though they were actual devices | 19:01 |
| gnarface | in 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 try | 19:02 |
| rwp | Is 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 |
| rwp | I 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 |
| forester | gnarface: Thank you a lot for your participation in my situation. But I have no that equipment. | 19:03 |
| forester | rwp: It's ok. It's a lesson. | 19:03 |
| rwp | Life is where you get the test first and the lesson second. | 19:03 |
| rwp | I 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 |
| gnarface | forester: 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 slow | 19:04 |
| gnarface | were these partitions quite full? if they weren't, and you dd with the "conv=sparse" flag then that might help it take less time | 19:05 |
| rwp | forester, 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 |
| forester | gnarface: sda2 was almost full. | 19:13 |
| forester | rwp: ext4 | 19:13 |
| gnarface | forester: 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 bandwidth | 19:17 |
| gnarface | and a lot of patience... | 19:17 |
| gnarface | and possibly also a reliable source of power | 19:17 |
| gnarface | though i suppose if it's a laptop with a good battery that should be less vital | 19:18 |
| forester | Now I am reading this https://www.reddit.com/r/linuxquestions/comments/k9m61h/accidentally_ran_mkswap_on_ext4_partition/?rdt=51227 | 19:20 |
| gnarface | forester: looks legit, but i'd still be hesitant to try it on the bare metal before testing on a copy first | 19:22 |
| gnarface | sounds like, in theory, as long as nothing "swapon'd" it, maybe your data is still all there | 19:23 |
| gnarface | also, 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 automatically | 19:25 |
| forester | gnarface: no it dows not. | 19:26 |
| gnarface | there'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 first | 19:26 |
| forester | it does not | 19:26 |
| rwp | I skimmed that Reddit and it seems plausible. | 19:26 |
| gnarface | uh, i'm pretty sure it does, and if it doesn't all you have to do is make a minor change to /etc/default/zramswap | 19:26 |
| gnarface | i'm using this right now on several arm devices | 19:27 |
| gnarface | i swear to you i didn't have to call mkswap once | 19:27 |
| forester | gnarface: your approach is good indeed. | 19:27 |
| gnarface | i 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 first | 19: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 |
| rwp | I 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 |
| forester | rwp: Thank you. Your opinion is very important for me. I need take a break before going on. | 19:38 |
| rwp | forester, 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 |
| forester | Thank you. I am trying. And bash: dumpe2fs: command not found | 19:54 |
| gnarface | forester: it's in the e2fsprogs package | 19:55 |
| fsmithred | forester, it's in /sbin. If you used 'su' to become root it's probably not in your path. | 19:55 |
| forester | It looks like devuan does not have that stuff. Isn't it? | 19:55 |
| fsmithred | Use 'su - | 19:55 |
| fsmithred | su - | 19:55 |
| gnarface | oh, yea might be just a path issue | 19:55 |
| fsmithred | devuan has whatever debian has (except systemd) | 19:56 |
| forester | Maybe you could give a quick solution how to allow my user to use sudo? | 19:57 |
| gnarface | you should have sudo access by default if it's installed... | 19:57 |
| gnarface | shouldn't you? maybe you have to add yourself to the sudo group | 19:57 |
| gnarface | yea, maybe you have to be in the sudo group | 19:58 |
| fsmithred | yeah, you only automatically get into sudo group if you don't set up a root account | 19:58 |
| fsmithred | su - | 19:58 |
| fsmithred | the dash at the end is important | 19:58 |
| fsmithred | or su --login | 19:58 |
| forester | ok. I see su - | 19:58 |
| fsmithred | note that it will move you to /root instead of keeping you in your current directory | 20:00 |
| fsmithred | I need an alias to 'su -' that puts me back in the directory where I was. | 20:01 |
| forester | home: ***** FILE SYSTEM WAS MODIFIED ***** | 20:12 |
| forester | home: ********** WARNING: Filesystem still has errors ********** | 20:12 |
| forester | home: 709761/18038784 files (2.0% non-contiguous), 59257567/72142334 blocks | 20:12 |
| gnarface | well, i would backup the important stuff if you can mount it now, then fsck it | 20:15 |
| _ds_ | Also, make sure to mount it read-only. | 20:16 |
| gnarface | yea, good call | 20:17 |
| gnarface | to 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 partition | 20:18 |
| forester | Why 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 |
| gnarface | oh, uh, fsck will correct the errors, in theory | 20:19 |
| gnarface | it's just not quite 100% safe | 20:20 |
| gnarface | not in the situation you're in anyway | 20:20 |
| forester | is it possible to use partition without fscking? | 20:20 |
| gnarface | well, 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 back | 20:20 |
| gnarface | but if you're gonna keep using it, definitely either fsck or reformat are gonna be necessary at some point | 20:21 |
| gnarface | otherwise this filesystem will just continue to unravel like the sweater in that one weezer song | 20:21 |
| gnarface | but mounting it read-only will give you the chance to safely suss out whether you can get your files copied off first or not | 20:23 |
| forester | I 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 |
| gnarface | uh... that's weird | 20:24 |
| gnarface | did you maybe change the partition type to be swap accidentally? | 20:25 |
| gnarface | the partition table stores a filesystem type label independently of whatever the filesystem inside has set internally, and it's possible for them to disagree | 20:25 |
| forester | I don't know. I am trying take a look on my sda2 | 20:26 |
| gnarface | now i'm really disturbed about what order of events might have lead to this outcome... | 20:26 |
| gnarface | this usb drive wasn't actually connected to the machine while you were setting up zramswap was it? | 20:27 |
| gnarface | you should be able to check the partition types in fdisk | 20:28 |
| forester | gnarface: It was. I listen audio from it. | 20:31 |
| gnarface | ah | 20:31 |
| gnarface | that probably explains it | 20:31 |
| gnarface | you 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 again | 20:33 |
| forester | I am slowly breathing out with hope. Thank you. Thank you all who took a part in the situation. | 20:37 |
| forester | Now 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/!