My user account doesnt have sudo despite being in sudoers. I cant run new commands i have to execute the binary. Grub takes very long to load with “welcome to grub” message. I just wanted a stable distro as arch broke and currupted my external ssd

  • mariahOP
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    sudo dd if=/dev/sdd1 status=progress skip=1024 of=/dev/null [sudo] password for mariah: 25847808 bytes (26 MB, 25 MiB) copied, 348 s, 74.2 kB/s dd: error reading ‘/dev/sdd1’: Input/output error 50488+0 records in 50488+0 records out 25849856 bytes (26 MB, 25 MiB) copied, 355.279 s, 72.8 kB/s

    • tal@lemmy.today
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      Okay, well, that’s not good in terms of being able to recover the data on the drive. So it’s getting read errors from other positions on the drive, and this isn’t right at the beginning.

      thinks

      Well, okay, two more things I’d try.

      I’d try running the above command again, and seeing if it fails on the same block:

      # dd if=/dev/sdd1 status=progress skip=1024 of=/dev/null
      

      If on this run you again see it transferring 50488 512-byte blocks successfully and then failing on 50489, that means that it’s the same locations failing each time. If so, that means that the errors are consistent at the same locations. That’s bad in that there are multiple unreadable portions of the drive and you probably won’t be able to read them, but at least it’s possible to isolate those.

      If not, if it fails at a different location, then maybe it’s a sporadic problem. Ddrescue might be able to deal with that by just retrying reads on failure until it gets a good read. I doubt that this is the case, but I’d want to check, since it might permit for recovery of all of the data.

      I don’t know if this is typically the behavior seen when SSDs fail, as I came late to the SSD party and have only seen rotational drives fail; my own SSDs still work.

        • tal@lemmy.today
          link
          fedilink
          arrow-up
          1
          ·
          edit-2
          1 year ago

          Gotcha, so the same spot.

          Well, okay. So whatever is on the drive at failing locations is probably not going to be recoverable. It might still be possible to recover the bulk of the data on the drive, if the filesystem can br’e recovered.

          I can’t speak as to your financial situation or how much you care about that particular data.

          First, it might be possible to hire a data recovery service to deal with it if you really care about it. I have no idea what, if anything, they can do with SSDs that are unreadable. With rotational drives, traditionally the problem was with the drive head, so they’d get a super-dust-free cleanroom, have duplicate hard drives of every model, open up your hard drive in the cleanroom and plop your platters and a fresh drive mechanism together, then pull the data off. That ran like a couple hundred to maybe two thousand bucks. Obviously, that’s not applicable to SSDs, but there may be other things that they can do with them. I also don’t know what they can do with Linux filesystems.

          Second, if you get a new hard drive that is at least as large as the existing one, what can be done is to create a partition on that drive that is at least as large, use ddrescue to copy over what can be copied of the data on the partition and hope that it’s enough for fsck to repair. Then, once you’ve got it working, if the new partition is larger, use resize2fs to grow the filesystem to the partition size. If it’s not possible for fsck to repair it, then just stick a new filesystem on there, probably have to rebuild the music video collection from scratch if possible.

          I can’t promise that the existing data will be recoverable if you get the drive. Even if it is, it’s possible that some music videos may have corrupt data, and it may be hard to easily identify which videos are corrupt. I hate advising people to spend their money, but I can’t think of fantastic alternative approaches at this point; this is what I would do in your shoes at this point.

          So that’s gonna have to be a call that you’re gonna have to make, as to whether you want to get a replacement drive. If you do, it’s possible to try recovering the data.

          If you pulled the music videos off YouTube – I don’t know where else one might have obtained thousands of them – it may be possible to automate re-downloading them, at least the ones that are still on YouTube, using something like yt-dlp. It may be possible to recover the filenames, even if the rest of the filesystem is unrecoverable, which might be used to search for the video. I’d do that via, after using ddrescue to try to pull as much data to the new partition as possible, running strings on the new partition and searching it for filenames.

          So, your call. If you want to try recovery to a new drive, that’s a possibility, but odds are that it won’t be possible to recover everything perfectly-intact.

          I don’t think that there’s a lot more that can be done without a new drive – in theory, it’d be possible to try recovery on the existing drive, but given the state of it, I would guess that it could just wipe out what’s there and still readable, and I’d advise not trying it. So at this point, this is probably blocked on you deciding whether you want to get and actually getting a new drive. If you do, it should be at least as large as the existing one, else it won’t be possible to create a direct copy of the existing partition, which will be a pain for recovery purposes.

          Of the other issues:

          • Boot time. I’d try my suggestion about disconnecting the external drive and seeing if your boot time problem goes away.

          • PATH. Setting PATH to include the /usr/local/sbin, /usr/sbin, and /sbin directories for non-root users should make those commands accessible to non-root users; I describe this in a top-level comment. Alternatively, just running su -l should give you a root shell with a PATH that includes those directories under Debian. I know what has to be done, but not the appropriate place to set it every login for the current desktop environments, as I don’t use them.

          • sudo rights to your user account. As long as you have added your user to the sudo group and logged them out and logged in again, you should be good to go here; I assume that this is working now.

          • Distro. I am inclined to believe that there was likely not anything wrong with your Arch installation other then the failing drive, from what you’ve told us. I’m not going to dissuade you from using Debian – I mean, it’s what I use – but if that was all you were concerned about with Arch, you could probably reinstall it if you were otherwise happy with it and don’t mind doing the reinstall. I can’t help much there, though, as I’ve never installed Arch.

          • mariahOP
            link
            fedilink
            arrow-up
            1
            ·
            1 year ago

            I have decided to just unplug the sdd. I have fixed the path issue by adding my user to sudo. Ill stick to debian as im not a hopper. Thanks for helping me