Fdisk Problem

I want to back up to an older SSD, but when I open it to look at it with fdisk, I get the message: “fdisk: cannot open /dev/sdb: Invalid argument”

Any ideas?

[Update Monday morning]

I gave up on the drive, and went out and bought a new one at Best Buy.

[July 17th update]

So, I copied my Linux OS to the new drive using dd. But it won’t boot. It acts like its starting to boot, but the Fedora thing just spins ad infinitum. It won’t boot in the same desktop that I copied the OS from, or from the laptop. Any ideas?

[Bumped]

22 thoughts on “Fdisk Problem”

  1. Does ‘lsblk’ help? That will tell you at least if the system is seeing anything. And silly as it sounds, are power cables secure?

    1. From lsblk:

      NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
      loop0 7:0 0 4K 1 loop /var/lib/snapd/snap/bare/5
      loop1 7:1 0 74.2M 1 loop /var/lib/snapd/snap/core22/1122
      loop2 7:2 0 504.2M 1 loop /var/lib/snapd/snap/gnome-42-2204/172
      loop3 7:3 0 91.7M 1 loop /var/lib/snapd/snap/gtk-common-themes/1535
      loop4 7:4 0 505.1M 1 loop /var/lib/snapd/snap/gnome-42-2204/176
      loop5 7:5 0 186.4M 1 loop /var/lib/snapd/snap/signal-desktop/642
      loop6 7:6 0 39.1M 1 loop /var/lib/snapd/snap/snapd/21184
      sda 8:0 0 1.8T 0 disk
      └─sda1 8:1 0 1.8T 0 part /home
      sdb 8:16 0 0B 0 disk
      sr0 11:0 1 2K 0 rom
      zram0 252:0 0 8G 0 disk [SWAP]
      nvme0n1 259:0 0 238.5G 0 disk
      ├─nvme0n1p1 259:1 0 600M 0 part /boot/efi
      ├─nvme0n1p2 259:2 0 1G 0 part /boot
      └─nvme0n1p3 259:3 0 231.3G 0 part /

      1. Um missing / on of parameter? of=/dev/sdb?

        If that’s just a typo, and the command was correct, try an lsblk and see if the partitions on sdb line up with those on nvme0n1.

        1. If not a typo check your default directory to see if you haven’t created a monster in a ./dev/sdb subdirectory! Might want to delete that first.

        2. One of the well-known Linux hacks is to always put dd commands in scripts that are debugged ahead of time using count=n where n is a very small number. This makes sure the command is correct before going full bore. Once the script is good you just invoke the script to do the copy, backup or whatever.

          dd is very powerful. if= and of= can get you into a lot a trouble very quickly.

    1. That was a typo. Here’s the output from lsblk:

      NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
      loop0 7:0 0 74.2M 1 loop /var/lib/snapd/snap/core22/1122
      loop1 7:1 0 4K 1 loop /var/lib/snapd/snap/bare/5
      loop2 7:2 0 505.1M 1 loop /var/lib/snapd/snap/gnome-42-2204/176
      loop3 7:3 0 504.2M 1 loop /var/lib/snapd/snap/gnome-42-2204/172
      loop4 7:4 0 91.7M 1 loop /var/lib/snapd/snap/gtk-common-themes/1535
      loop5 7:5 0 186.4M 1 loop /var/lib/snapd/snap/signal-desktop/642
      loop6 7:6 0 39.1M 1 loop /var/lib/snapd/snap/snapd/21184
      sda 8:0 0 1.8T 0 disk
      └─sda1 8:1 0 1.8T 0 part /home
      sdc 8:32 0 931.5G 0 disk
      ├─sdc1 8:33 0 600M 0 part
      ├─sdc2 8:34 0 1G 0 part
      └─sdc3 8:35 0 231.3G 0 part
      sr0 11:0 1 2K 0 rom
      zram0 252:0 0 8G 0 disk [SWAP]
      nvme0n1 259:0 0 238.5G 0 disk
      ├─nvme0n1p1 259:1 0 600M 0 part
      ├─nvme0n1p2 259:2 0 1G 0 part
      └─nvme0n1p3 259:3 0 231.3G 0 part /

      Looks to me like it’s a clean copy.

      1. So I will presume the ‘dd’ command given was:

        dd if=/dev/nvme0n1 of=/dev/sdc bs=4M status=progress

        I’m wondering why lsblk for sdc3 isn’t showing the ‘/’ character after part like it does for nvme0n1p3?
        Another typo?

        Not a definitive answer, but I would try a different block size. I know this is going to be annoying but try bs=4K and see what happens. This will take longer. Whether or not you have the patience for it is up to you.

  2. This sounds to me an issue with uefi. Have you downloaded and booted into Boot Repair, with just the backup connected and not the source disk?

        1. IIRC Boot Repair is a bootable image that runs standalone. One of the items you can boot via Ventoy.

          1. Boot Repair is a live cd utility. I’m now guessing that you are trying to boot from a copy drive, likely via usb. David is right about issues deriving from copying from a drive that you’ve booted from. If you’re trying to use dd, it would be smart to use it when booted from a cd like Parted Magic. But better yet is to use Clonezilla, either from Parted Magic or from a Clonezilla Live usb thumb drive.

            If you want to back up a dive that’s not removable, the best way to do it is to boot into Clonezilla, clone the drive to a drive connected via usb. But you’ll have a compressed image of your built in drive. It will be perfectly fine for restoring the image back to the original drive. However, you won’t be able to boot the image. Unlike dd, it does not copy empty space.

            If your built in drive dies, then you either replace it, or try to set up a new install on an SSD connected via usb.

            It sounds to me that you’re trying to have two identical drives, both connected at the same time and you want to select which one to boot from. If so, that selection would have to be in the uefi settings, not grub, as it’s likely that you’ll have multiple grubs. This sounds like a mess.

          2. It sounds to me that you’re trying to have two identical drives, both connected at the same time and you want to select which one to boot from.

            No, I’m trying to build a drive from which I can boot my laptop while traveling. I’m not after a dual boot backup.

  3. One more thing. For backing up drives, I always use Clonezilla. Rock solid and it fixes subtle problems than can crop up.

  4. I see on the Ask Fedora forums there are issues trying to use dd to clone from a running system disk. The most popular recommendation is to boot into Clonezilla from a USB stick and use it to clone because the system disk is not mounted or in use in this case.

    The other recommendation is to used gparted to change the UUID of the clone. But this gets into Grub issues as well. But if your laptop does not have a copy of the system disk on it as does your desktop this doesn’t explain your issue.

    I’d go the Clonezilla route if I were you.

  5. I suppose another possible route would be to boot off a ‘Live-USB’ stick copy of Fedora and then use dd to do the copy off your unmounted nvme drive to your new unmounted USB drive. I don’t know if this still has the UUID issue or not. But it doesn’t involve any non-Linux tools.

Comments are closed.