Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

3 votes
1 answers
18972 views
Recover from emergency mode on Centos 7
I have a Dell PowerEdge R420 which has installed Centos 7 and was working fine. One day I removed the disks that Centos 7 was installed (2 disks with RAID-1 layout) and I installed another clean disk to the rack in order to install Red Hat Enterprise Linux 7. For reasons I cannot describe here I wan...
I have a Dell PowerEdge R420 which has installed Centos 7 and was working fine. One day I removed the disks that Centos 7 was installed (2 disks with RAID-1 layout) and I installed another clean disk to the rack in order to install Red Hat Enterprise Linux 7. For reasons I cannot describe here I wanted to have a disk with RHEL 7 installed so I can use it with another server. The installation of RHEL was also fine, but when I tried to put back the initial disks with Centos 7 into my initial Dell server I saw that I was stuck in Grub rescue mode. I used these steps in order to reinstall grub and know I am stuck into emergency mode. I see the following message: > Welcome to emergency mode! After logging in type "journalctl -xb" to > view system logs, "systemctl reboot" to reboot, "systemctl default" to > try again to boot into default mode. Give root password for > maintenance (or type Control-D to continue).
salvador (291 rep)
Jun 16, 2015, 10:41 AM • Last activity: Jul 16, 2025, 11:02 PM
2 votes
1 answers
2208 views
md: kicking non-fresh sdg from array! md/raid:md0: and then not enough operational devices (3/7 failed)
today I run in a disaster... I have a RAID 6 with 7 HDDs and yesterday one disk failed. After replacing the disk and did a rebuild over night I found out that a 2nd HDD was out of the RAID... So today I 've started to backup my Files on external Drives but then the copying stopped and as I've checke...
today I run in a disaster... I have a RAID 6 with 7 HDDs and yesterday one disk failed. After replacing the disk and did a rebuild over night I found out that a 2nd HDD was out of the RAID... So today I 've started to backup my Files on external Drives but then the copying stopped and as I've checked why and saw in Webmins RAID that sdg was "down". I shut down the server and checked the hardware and found out, that the backplate, where the HDDs are connected got lose... After repairing it all drives are now back but my RAID 6 don't start anymore :-/ dmesg shows me: md: kicking non-fresh sdg from array! md: kicking non-fresh sdf from array! md: kicking non-fresh sde from array! md/raid:md0: not enough operational devices (3/7 failed) ... and after many md0: ADD_NEW_DISK not supported I can read this: EXT4-fs (md0): unable to read superblock With sudo mdadm --examine I checked the sdg, sdf and sde and e and f shows "State clean" where the sdg, which was "down" before repairing shows "Active". So 6 of 7 Devices shows "Clean" except the sdg. Here is the list of the output of all devices:
Disk sdb
/dev/sdb:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x1
     Array UUID : e866cf54:90d5c74e:fe00b6e7:d25c82f4
           Name : N5550:0  (local to host N5550)
  Creation Time : Fri Oct 29 14:43:58 2021
     Raid Level : raid6
   Raid Devices : 7

 Avail Dev Size : 3906770096 (1862.89 GiB 2000.27 GB)
     Array Size : 9766906880 (9314.45 GiB 10001.31 GB)
  Used Dev Size : 3906762752 (1862.89 GiB 2000.26 GB)
    Data Offset : 259072 sectors
   Super Offset : 8 sectors
   Unused Space : before=258992 sectors, after=7344 sectors
          State : clean
    Device UUID : 9180f101:1dacdd9e:4adae9c4:fbeb2552

Internal Bitmap : 8 sectors from superblock
    Update Time : Sat Mar 26 18:13:45 2022
  Bad Block Log : 512 entries available at offset 16 sectors
       Checksum : 38019182 - correct
         Events : 256508

         Layout : left-symmetric
     Chunk Size : 512K

   Device Role : Active device 0
   Array State : AAA.A.. ('A' == active, '.' == missing, 'R' == replacing)
Disk sdc
/dev/sdc:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x1
     Array UUID : e866cf54:90d5c74e:fe00b6e7:d25c82f4
           Name : N5550:0  (local to host N5550)
  Creation Time : Fri Oct 29 14:43:58 2021
     Raid Level : raid6
   Raid Devices : 7

 Avail Dev Size : 3906770096 (1862.89 GiB 2000.27 GB)
     Array Size : 9766906880 (9314.45 GiB 10001.31 GB)
  Used Dev Size : 3906762752 (1862.89 GiB 2000.26 GB)
    Data Offset : 259072 sectors
   Super Offset : 8 sectors
   Unused Space : before=258992 sectors, after=7344 sectors
          State : clean
    Device UUID : 889c6877:5ee5c647:eebd209c:d9c6abcb

Internal Bitmap : 8 sectors from superblock
    Update Time : Sat Mar 26 18:13:45 2022
  Bad Block Log : 512 entries available at offset 16 sectors
       Checksum : a71ea53d - correct
         Events : 256508

         Layout : left-symmetric
     Chunk Size : 512K

   Device Role : Active device 1
   Array State : AAA.A.. ('A' == active, '.' == missing, 'R' == replacing)
Disk sdd
/dev/sdd:
   MBR Magic : aa55
Partition :   3907026944 sectors at         2048 (type fd)
Disk sde
/dev/sde:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x1
     Array UUID : e866cf54:90d5c74e:fe00b6e7:d25c82f4
           Name : N5550:0  (local to host N5550)
  Creation Time : Fri Oct 29 14:43:58 2021
     Raid Level : raid6
   Raid Devices : 7

 Avail Dev Size : 3906770096 (1862.89 GiB 2000.27 GB)
     Array Size : 9766906880 (9314.45 GiB 10001.31 GB)
  Used Dev Size : 3906762752 (1862.89 GiB 2000.26 GB)
    Data Offset : 259072 sectors
   Super Offset : 8 sectors
   Unused Space : before=258992 sectors, after=7344 sectors
          State : clean
    Device UUID : 34198042:3d4c802b:36727b02:fdf65808

Internal Bitmap : 8 sectors from superblock
    Update Time : Sat Mar 26 18:05:00 2022
  Bad Block Log : 512 entries available at offset 16 sectors
       Checksum : f8fb6b18 - correct
         Events : 256494

         Layout : left-symmetric
     Chunk Size : 512K

   Device Role : Active device 3
   Array State : AAAAA.. ('A' == active, '.' == missing, 'R' == replacing)
Disk sdf
/dev/sdf:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x1
     Array UUID : e866cf54:90d5c74e:fe00b6e7:d25c82f4
           Name : N5550:0  (local to host N5550)
  Creation Time : Fri Oct 29 14:43:58 2021
     Raid Level : raid6
   Raid Devices : 7

 Avail Dev Size : 3906770096 (1862.89 GiB 2000.27 GB)
     Array Size : 9766906880 (9314.45 GiB 10001.31 GB)
  Used Dev Size : 3906762752 (1862.89 GiB 2000.26 GB)
    Data Offset : 259072 sectors
   Super Offset : 8 sectors
   Unused Space : before=258992 sectors, after=7344 sectors
          State : clean
    Device UUID : b2e8d640:1f21336f:88d823fe:66ef7be7

Internal Bitmap : 8 sectors from superblock
    Update Time : Wed Mar 23 14:46:56 2022
  Bad Block Log : 512 entries available at offset 16 sectors
       Checksum : 15cd05bb - correct
         Events : 238681

         Layout : left-symmetric
     Chunk Size : 512K

   Device Role : Active device 4
   Array State : AAAAAA. ('A' == active, '.' == missing, 'R' == replacing)
Disk sdg
/dev/sdg:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x1
     Array UUID : e866cf54:90d5c74e:fe00b6e7:d25c82f4
           Name : N5550:0  (local to host N5550)
  Creation Time : Fri Oct 29 14:43:58 2021
     Raid Level : raid6
   Raid Devices : 7

 Avail Dev Size : 3906770096 (1862.89 GiB 2000.27 GB)
     Array Size : 9766906880 (9314.45 GiB 10001.31 GB)
  Used Dev Size : 3906762752 (1862.89 GiB 2000.26 GB)
    Data Offset : 259072 sectors
   Super Offset : 8 sectors
   Unused Space : before=258992 sectors, after=7344 sectors
          State : active
    Device UUID : 2bc06e22:49aa73e2:3cf7eb79:55df1180

Internal Bitmap : 8 sectors from superblock
    Update Time : Sat Mar 26 17:57:06 2022
  Bad Block Log : 512 entries available at offset 16 sectors
       Checksum : 7f0ddb2a - correct
         Events : 256372

         Layout : left-symmetric
     Chunk Size : 512K

   Device Role : Active device 5
   Array State : AAAAAA. ('A' == active, '.' == missing, 'R' == replacing)
Disk sdh
/dev/sdh:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x1
     Array UUID : e866cf54:90d5c74e:fe00b6e7:d25c82f4
           Name : N5550:0  (local to host N5550)
  Creation Time : Fri Oct 29 14:43:58 2021
     Raid Level : raid6
   Raid Devices : 7

 Avail Dev Size : 3906770096 (1862.89 GiB 2000.27 GB)
     Array Size : 9766906880 (9314.45 GiB 10001.31 GB)
  Used Dev Size : 3906762752 (1862.89 GiB 2000.26 GB)
    Data Offset : 259072 sectors
   Super Offset : 8 sectors
   Unused Space : before=258992 sectors, after=7344 sectors
          State : clean
    Device UUID : 7af89a18:52ef08ae:dec5ad7b:75626355

Internal Bitmap : 8 sectors from superblock
    Update Time : Sat Mar 26 18:13:45 2022
  Bad Block Log : 512 entries available at offset 16 sectors
       Checksum : 17d7b107 - correct
         Events : 256508

         Layout : left-symmetric
     Chunk Size : 512K

   Device Role : Active device 4
   Array State : AAA.A.. ('A' == active, '.' == missing, 'R' == replacing)
I've tried to start the RAID with mdadm --run /dev/md0 and get: mdadm: failed to start array /dev/md0: Input/output error But after I started it with this Webmin shows me then: /dev/md0 active, FAILED, Not Started RAID6 (Dual Distributed Parity) 7.27 TiB Its 7.27 from 9TB. Any ideas how to get my RAID back to work again without data loss? I've read about that I could add devices back again to the RAID but I'm unsure and wanted to ask before. Any help would be appreciated! **UPDATE**: I forgot that one of the device is /dev/sdd1 and not /sdd! Here the examine of it: ~~~ /dev/sdd1: Magic : a92b4efc Version : 1.2 Feature Map : 0x1 Array UUID : e866cf54:90d5c74e:fe00b6e7:d25c82f4 Name : N5550:0 (local to host N5550) Creation Time : Fri Oct 29 14:43:58 2021 Raid Level : raid6 Raid Devices : 7 Avail Dev Size : 3906767872 (1862.89 GiB 2000.27 GB) Array Size : 9766906880 (9314.45 GiB 10001.31 GB) Used Dev Size : 3906762752 (1862.89 GiB 2000.26 GB) Data Offset : 259072 sectors Super Offset : 8 sectors Unused Space : before=258992 sectors, after=5120 sectors State : clean Device UUID : d8df004e:44ee4060:ba4d2c22:e7e6bdcb Internal Bitmap : 8 sectors from superblock Update Time : Sat Mar 26 18:13:45 2022 Bad Block Log : 512 entries available at offset 16 sectors Checksum : 1c4e98a4 - correct Events : 256508 Layout : left-symmetric Chunk Size : 512K Device Role : Active device 2 Array State : AAA.A.. ('A' == active, '.' == missing, 'R' == replacing) ~~~ And here an mdadm -D /dev/md0: ~~~ /dev/md0: Version : 1.2 Raid Level : raid0 Total Devices : 7 Persistence : Superblock is persistent State : inactive Working Devices : 7 Name : N5550:0 (local to host N5550) UUID : e866cf54:90d5c74e:fe00b6e7:d25c82f4 Events : 256494 Number Major Minor RaidDevice - 8 64 - /dev/sde - 8 32 - /dev/sdc - 8 112 - /dev/sdh - 8 80 - /dev/sdf - 8 16 - /dev/sdb - 8 49 - /dev/sdd1 - 8 96 - /dev/sdg ~~~
LeChatNoir (21 rep)
Mar 26, 2022, 07:29 PM • Last activity: Jun 2, 2025, 04:08 PM
0 votes
1 answers
5147 views
Grub rescue error (insmod normal)
[![enter image description here][1]][1] I was trying to make it normal from grub rescue error. But, msdos7 is returning that filesystem is ext2. When I write insmod normal I get "invalid file name 'hd0,msdos7/i386-pc/normal.mod" How can I fix it? I have bootable USB . that's arch Linux. Even, I trie...
enter image description here I was trying to make it normal from grub rescue error. But, msdos7 is returning that filesystem is ext2. When I write insmod normal I get "invalid file name 'hd0,msdos7/i386-pc/normal.mod" How can I fix it? I have bootable USB . that's arch Linux. Even, I tried by bootable USB also. When I reboot my laptop that(grub Loader) don't show anymore(like it had erased automatically when rebooting). I was following the answer https://askubuntu.com/a/462995 When I tried to search search.file ... I got an error unknown command 'search.file'. enter image description here root@mint:~# fdisk -l Disk /dev/loop0: 1.8 GiB, 1912557568 bytes, 3735464 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/sda: 298.9 GiB, 320072933376 bytes, 625142448 sectors Disk model: Hitachi HTS72323 Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0xcdead0a2 Device Boot Start End Sectors Size Id Type /dev/sda1 * 1026048 272532369 271506322 129.5G 7 HPFS/NTFS/exFAT /dev/sda2 272533504 273694719 1161216 567M 27 Hidden NTFS WinRE /dev/sda3 273696768 274747391 1050624 513M b W95 FAT32 /dev/sda4 274747392 625142447 350395056 167.1G 5 Extended /dev/sda5 274749440 275726335 976896 477M ef EFI (FAT-12/16/32) /dev/sda6 275728384 277682175 1953792 954M 82 Linux swap / Solaris /dev/sda7 277684224 625142447 347458224 165.7G 83 Linux This is how I installed grubloader but, I am getting the grub error although. /dev/sda7 is arch Linux. And, /dev/sda1 is windows. I had Kali earlier. I had deleted partition/volume of kali,swap and grub from windows manager. enter image description here I noticed that type /dev/sda7 is ext2. But, I remember that I formatted it to ext4. Now, I have Linux Mint bootable USB. root@mint:~# mount /dev/sda5 /mnt mount: /mnt: /dev/sda5 already mounted on /mnt. root@mint:~# grub-install /dev/sda5 Installing for i386-pc platform. grub-install: error: failed to get canonical path of `/cow'. [![enter image description here]] I was following [the video](https://youtu.be/biGNIMIRgNU?t=303) . I notice that he set flags to bios_grub. But, I don't have bios_grub. What to do now?
user467213
Apr 19, 2021, 01:29 PM • Last activity: Apr 6, 2025, 10:04 AM
0 votes
1 answers
95 views
Booting from Grub bash command line
The Fedora 41 system crashed during kernel upgrade and I am left with a Grub rescue prompt [![enter image description here][1]][1] Then I try to boot from the Grub bash [![enter image description here][2]][2] Then it goes and asks for the password for the encrypted root partition [![enter image desc...
The Fedora 41 system crashed during kernel upgrade and I am left with a Grub rescue prompt enter image description here Then I try to boot from the Grub bash enter image description here Then it goes and asks for the password for the encrypted root partition enter image description here And fails to mount /sysroot enter image description here enter image description here What am I missing? Edit ----- As pointed in the @telcoM answer the encrypted partition was at /dev/mapper. But I still can't mount it because it is part of a lvm volume group and I can't find the correct logical volume since there is no vgscan and lvdisplay in this environment. enter image description here How to do it?
Clodoaldo (358 rep)
Feb 10, 2025, 11:46 AM • Last activity: Feb 10, 2025, 03:39 PM
0 votes
1 answers
78 views
How to regenerate the rescue kernel from the running/installed kernel in Oracle Linux 8
Once I've deleted all rescue kernel images from my system, I need to regenerate/recreate these images. The only information I've found was about Fedora ([here][1]), so it didn't help me. [1]: https://unix.stackexchange.com/q/718388/668115
Once I've deleted all rescue kernel images from my system, I need to regenerate/recreate these images. The only information I've found was about Fedora (here ), so it didn't help me.
Nick (11 rep)
Jan 25, 2025, 09:09 AM
0 votes
2 answers
132 views
Why doesn't my live USB boot partition show up as a 'Linux filesystem'?
I am trying to follow the steps on https://wiki.debian.org/RescueLive to recover my system which is currently not booting. I've created and booted a live version of Debian on a USB stick. However when I run `fdisk -l` from the terminal inside the live system I get the following output: ``` Disk /dev...
I am trying to follow the steps on https://wiki.debian.org/RescueLive to recover my system which is currently not booting. I've created and booted a live version of Debian on a USB stick. However when I run fdisk -l from the terminal inside the live system I get the following output:
Disk /dev/sda: 57.62 GiB, 61872793600 bytes, 120845300 sectors
Disk model: DataTraveler 3.0
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xccc4b779

Device     Boot Start     End Sectors  Size Id Type
/dev/sda1  *       64 6756479 6756416  3.2G  0 Empty
/dev/sda2        6804   16339    9536  4.7M ef EFI (FAT-12/16/32)
I expect the Type of /dev/sda1 to be Linux filesystem since that is the root partition but instead it is Empty. Following the steps in the RescueLive guide further I also run into the following issue when trying to bind mounts of /dev /proc and /sys:
root@debian:~# mount --bind /proc /mnt/proc
mount: /mnt/proc: mount point does not exist.
       dmesg(1) may have more information after failed mount system call.
root@debian:~# mkdir /mnt/proc
mkdir: cannot create directory ‘/mnt/proc’: Read-only file system
When trying to mount, the mount point doesn't exist inside /mnt but I am unable to create it!
occupational_hazard (1 rep)
Nov 24, 2024, 12:22 AM • Last activity: Dec 11, 2024, 03:00 PM
0 votes
1 answers
317 views
Restore a BTRFS drive's root tree that was erroneously overwritten with 100MB FAT storage
I have a 4TB drive with a BTRFS filesystem on it (no partition) that was erroneously overwritten by Windows' installer which determined that the space was unused and that it would use it for some other purpose (Recovery?) and put a 100MB FAT partition on top of it. Short of it is that all of the con...
I have a 4TB drive with a BTRFS filesystem on it (no partition) that was erroneously overwritten by Windows' installer which determined that the space was unused and that it would use it for some other purpose (Recovery?) and put a 100MB FAT partition on top of it. Short of it is that all of the content of the drive is currently inaccessible. For the most part, a lot of my really critical files have backups on my home server so the damage isn't extraordinarily overwhelming, but there are always a few rogue files that are missed in the backup that you only figure out when you look to back up. As a result, I've been looking for some way to either restore the file system or perhaps browse whatever contents are still sitting around on the disk. So far, I've done the following: I've run btrfs rescue super-recover which outputs the following: $ sudo btrfs rescue super-recover -v /dev/sda All Devices: Device: id = 1, name = /dev/sda Before Recovering: superblock bytenr = 65536 device name = /dev/sda superblock bytenr = 274877906944 superblock bytenr = 67108864 Make sure this is a btrfs disk otherwise the tool will destroy other fs, Are you sure? [y/N]: y checksum verify failed on 25001984 wanted 0x00000000 found 0xb6bde3e4 checksum verify failed on 25001984 wanted 0x00000000 found 0xb6bde3e4 ERROR: cannot read chunk root Failed to recover bad superblocks I also attempted to run sudo btrfs rescue chunk-recover but the result was also similar: It couldn't find a valid tree root. Next, using the IDs above, I tried to restore the disk to a file location: $ sudo btrfs restore -t 78515 -u 1 /dev/sda /tmp/a No valid Btrfs found on /dev/sda Could not open root, trying backup super checksum verify failed on 25001984 wanted 0x00000000 found 0xb6bde3e4 checksum verify failed on 25001984 wanted 0x00000000 found 0xb6bde3e4 checksum verify failed on 25001984 wanted 0x00000000 found 0xb6bde3e4 bad tree block 25001984, bytenr mismatch, want=25001984, have=0 ERROR: cannot read chunk root Could not open root, trying backup super Similar problem: There's no longer a valid root due to that 100MB FAT! Lastly, I know of the option of browsing files with testdisk but it doesn't seem like I can browse all remaining files from a BTRFS filesystem: The only option is to clone an image of the disk. Does anyone have any potential solution for browsing individual files on a invalid BTRFS filesystem or perhaps partially recreate the root? I don't need to restore the whole file system really, ideally I'd be able to get as many files from a subvolume (for example @pictures) that are still "valid" enough to be a real file. Is there a way to recreate the root tree of the BTRFS filesystem to try to recover as many files on the disk? I can see a table of file names when I do sudo strings /dev/sda | less which seems to imply that I might be able to find some data associated with those files further down the disk, but I have no clue how to check that.
TheYokai (143 rep)
Nov 10, 2024, 12:09 AM • Last activity: Nov 10, 2024, 12:47 AM
5 votes
4 answers
8304 views
How do I disable the creation of the rescue boot image on CentOS?
To make a long story short, my (CentOS 7) server's /boot is too small (100MiB) to hold 2 kernels plus the automatically generated rescue image. I want to avoid the hassle of repartitioning and reinstalling my server by preventing the rescue image from being generated. This would leave enough space f...
To make a long story short, my (CentOS 7) server's /boot is too small (100MiB) to hold 2 kernels plus the automatically generated rescue image. I want to avoid the hassle of repartitioning and reinstalling my server by preventing the rescue image from being generated. This would leave enough space for at least 2 kernels, and I can still use my hoster's netboot rescue solution should it be needed. (I know the only 'right' way to deal with this is to fix my partition scheme, but considering the downtime involved with that I wanted to try a more pragmatic solution first)
hnsr (153 rep)
Jan 19, 2015, 02:58 PM • Last activity: Nov 2, 2024, 06:21 PM
7 votes
2 answers
4524 views
How to manually regenerate the rescue kernel from the running/installed kernel in Fedora in 2022?
On the Internet I've only found this: ```bash /etc/kernel/postinst.d/51-dracut-rescue-postinst.sh $(uname -r) /boot/vmlinuz-$(uname -r) ``` but it doesn't work in Fedora 36 and soon to be released version 37, because this file is missing, in fact the entire `/etc/kernel/postinst.d/` directory is emp...
On the Internet I've only found this:
/etc/kernel/postinst.d/51-dracut-rescue-postinst.sh $(uname -r) /boot/vmlinuz-$(uname -r)
but it doesn't work in Fedora 36 and soon to be released version 37, because this file is missing, in fact the entire /etc/kernel/postinst.d/ directory is empty. I've also found
dnf reinstall kernel-core
but it only works for an up-to-date kernel. I'm running the kernel which is no longer available in repositories. Also, this is not a good option per se since it will result in reinstalling literally many hundreds of files for no reason. grep -r rescue /etc finds nothing.
# grep -r rescue /usr/bin
grep: /usr/bin/tdbdump: binary file matches
grep: /usr/bin/ctags: binary file matches
grep: /usr/bin/systemctl: binary file matches
grep: /usr/bin/systemd-analyze: binary file matches
grep: /usr/bin/efisecdb: binary file matches
grep: /usr/bin/dpkg: binary file matches
grep: /usr/bin/grub2-mkrescue: binary file matches
/usr/share contains a ton of matches but I've no idea how to work with that. kernel-core and kernel-modules packages have RPM scripts that do something but there's nothing specific to "rescue". It looks like it's all done as a single operation but I don't want to regenerate the initrd.
Artem S. Tashkinov (32730 rep)
Sep 23, 2022, 08:57 AM • Last activity: Nov 1, 2024, 01:21 PM
1 votes
1 answers
4257 views
Rescueing Microsoft reserved partition
A few year ago I built myself a NAS. It has a 320GB HDD for ubuntu OS and a 2TB HDD for files. I mounted de 2TB disk and shared it with samba over my network. Now I have build a HTPC like system and want to put the 2TB disk in that system. This system runs windows 10. I doubted if I could simply con...
A few year ago I built myself a NAS. It has a 320GB HDD for ubuntu OS and a 2TB HDD for files. I mounted de 2TB disk and shared it with samba over my network. Now I have build a HTPC like system and want to put the 2TB disk in that system. This system runs windows 10. I doubted if I could simply connect it to my new system but tried just to see if it would work. It shows as unallocated space in the Windows disk manager so I figured I should just copy all the files to another disk, then format the 2TB disk in windows and copy all the files back. Unfortunately I can't mount my 2TB disk anymore on my NAS. When I do fdisk -l is shows as a Microsoft Reserved Partition: Disk /dev/sda: 1.8Tib, 2000398934016 bytes, 3907029168 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disklabel type: gpt Disk identifier: F7CB1168-49F7-4885-BFE2-EF9905099A86 Device Start End Sectors Size Type /dev/sda1 34 32767 32734 16M Microsoft reserved Partition 1 does not start on physical sector boundary. EDIT 1: I opened the disk in gparted. According to gparted it has 16Mb partition with the next warning: Unable to detect file system! Possible reasons are: - The file system is dammaged - The file system is unknown to GParted - There is no file system available (unformatted) - The device entry /dev/sda1 is missing The other 1.82Tb shows as unallocated EDIT2: my fstab shows: # data disk UUID=cfcf09cb-55-fc-40a7-b0b3-afd4d809bb09 /media/emiel/data ext4 auto,user,rw 0 0 I am trying to mount the disk from the terminal for now. EDIT 3: As per @Rusi's suggestion I tried parted rescue with no results: emiel@ubuntu:~$ sudo parted /dev/sda print Model: ATA WDC WD20EZRZ-00Z (scsi) Disk /dev/sda: 2000GB Sector size (logical/physical): 512B/4096B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 1 17.4kB 16.8MB 16.8MB Microsoft reserved partition msftres emiel@ubuntu:~$ sudo sfdisk -d /dev/sda label: gpt label-id: F7CB1168-49F7-4885-BFE2-EF9905099A86 device: /dev/sda unit: sectors first-lba: 34 last-lba: 3907029134 /dev/sda1 : start= 34, size= 32734, type=E3C9E316-0B5C-4DB8-817D-F92DF00215AE, uuid=58F98377-19F8-46D0-AF53-490D2987D76D, name="Microsoft reserved partition" emiel@ubuntu:~$ sudo parted /dev/sda rescue Start? 34 End? 3907029134 searching for file systems... 100% (time left 00:00)Information: You may need to update /etc/fstab. EDIT 4: I tried gdisk as per @Rusi's suggestion with the next result: emiel@ubuntu:~$ sudo gdisk /dev/sda GPT fdisk (gdisk) version 1.0.3 The protective MBR's 0xEE partition is oversized! Auto-repairing. Partition table scan: MBR: protective BSD: not present APM: not present GPT: present Found valid GPT with protective MBR; using GPT. EDIT 5: After the above I tried TestDisk to scan my drive. It is still scanning but it outputs a lot of the same thing. Can someone explain to me what this means? Linux 0 0 1 243201 80 63 3907029168 [data] Linux 0 0 1 243201 80 63 3907029168 [data] Linux 0 0 1 243201 80 63 3907029168 [data] Linux 0 0 1 243201 80 63 3907029168 [data] Linux 0 0 1 243201 80 63 3907029168 [data] Linux 0 0 1 243201 80 63 3907029168 [data] Linux 0 0 1 243201 80 63 3907029168 [data] Linux 0 0 1 243201 80 63 3907029168 [data] Linux 0 0 1 243201 80 63 3907029168 [data] Linux 0 0 1 243201 80 63 3907029168 [data] EDIT 6: Overnight the above (MBR) scan completed with the following result: TestDisk 7.0, Data Recovery Utility, April 2015 Christophe GRENIER http://www.cgsecurity.org Disk /dev/sda - 2000 GB / 1863 GiB - CHS 243201 255 63 The harddisk (2000 GB / 1863 GiB) seems too small! ( Linux 121428 157 10 364629 238 9 3907029168 [data] [ Continue ] ext4 blocksize=4096 Large_file Sparse_SB Recover, 2000 GB / 1863 GiB After I hit continue I wasn't able to browse files or do anything at all listed on the walkthrough. I could only 'quit'. EDIT 7: But then I thought, maybe I should scan as "None" partition table, as suggested when I start testdisk, so I did: Disk /dev/sdc - 2000 GB / 1863 GiB - CHS 243201 255 63 Current partition structure: Partition Start End Size in sectors P ext4 0 0 1 243201 80 63 3907029168 [data] This is exactly what is on my disk, an ext4 partition covering the whole disk named "data". My conclusion: When I formated the disk 2+ year ago I did it wrong but did not notice, which resulted in a disk without a partition table. When I connected it to my Windows machine it found no partition table and created a wrong one. So I think I need to delete the partition table. I did search online but there is no information mentioning ONLY removing the partition table, not the existing partitions. Another option would maybe be to create a correct partition table myself to point at the existing ext4 partition. My question: Is my conclusion right? And can you advise me on how to accomplish above tasks?
E. Brommer (21 rep)
Mar 2, 2019, 02:13 PM • Last activity: Sep 15, 2024, 06:03 PM
0 votes
1 answers
69 views
Created a partition in the front of HDD with parted while it was mounted. What do I do so that my system doesn't crash on reboot?
I ran this command on /dev/sda1 when I meant to do something similar to /dev/sda2. /dev/sda1 was mounted at this time. ``` sudo parted -a opt /dev/sda mkpart primary ext4 0% 100% Warning: You requested a partition from 0.00B to 1000GB (sectors 0..1953525167). The closest location we can manage is 17...
I ran this command on /dev/sda1 when I meant to do something similar to /dev/sda2. /dev/sda1 was mounted at this time.
sudo parted -a opt /dev/sda mkpart primary ext4 0% 100%
Warning: You requested a partition from 0.00B to 1000GB (sectors 0..1953525167).
The closest location we can manage is 17.4kB to 1048kB (sectors 34..2047).
Is this still acceptable to you?
Yes/No? yes                                                               
Warning: The resulting partition is not properly aligned for best performance: 34s % 2048s != 0s
Ignore/Cancel? Ignore
Information: You may need to update /etc/fstab.
The output of print is:
(parted) print                                                            
Model: ATA ST1000LM035-1RK1 (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system     Name     Flags
 6      17.4kB  1049kB  1031kB                  primary
 1      1049kB  300MB   299MB   fat32                    boot, esp
 2      300MB   4347MB  4048MB  linux-swap(v1)           swap
 4      4347MB  124GB   120GB   ext4
 3      124GB   724GB   600GB   ext4
 5      724GB   1000GB  276GB   ext4
The output of fdisk -l /dev/sda is:
/dev/sda: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: ST1000LM035-1RK1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 86AB55F1-52A1-4F8C-ACE9-1A7B4C4E9082

Device          Start        End    Sectors   Size Type
/dev/sda1        2048     585727     583680   285M EFI System
/dev/sda2      585728    8491007    7905280   3.8G Linux swap
/dev/sda3   242864128 1414739967 1171875840 558.8G Linux filesystem
/dev/sda4     8491008  242864127  234373120 111.8G Linux filesystem
/dev/sda5  1414739968 1953523711  538783744 256.9G Linux filesystem
/dev/sda6          34       2047       2014  1007K Linux filesystem

Partition 6 does not start on physical sector boundary.
Partition table entries are not in disk order.
This is the drive that contains my OS and everything. What do I do so that my reboot doesn't fail. Too afraid to turn off the machine right now.
Arcadio (81 rep)
Aug 7, 2024, 01:51 PM • Last activity: Aug 7, 2024, 10:07 PM
0 votes
0 answers
45 views
Linux emergency mode is not exitable
I have a problem with installing linux on another SSD drive. The reason is i bought new ssd and i want to bring my current system with all settings and programs, and move it to the new drive. Steps i followed to reach this aim: 1. On my current drive created linux snapshot using Timeshift. 2. Saved...
I have a problem with installing linux on another SSD drive. The reason is i bought new ssd and i want to bring my current system with all settings and programs, and move it to the new drive. Steps i followed to reach this aim: 1. On my current drive created linux snapshot using Timeshift. 2. Saved this snapshot on USB Drive 3. Plugged in my new SSD drive 4. Installed clear linux on it 5. Using the USB found system snapshot, and started unpacking it on that SSD (or I don't now how to replace "unpacking" here. It means i was trying to apply all settings and programs on new system) 6. After this step, i rebooted my PC, and after long loading, i saw system emergency screen. Since this, i have been trying to run all commands: systemctl reboot, default or exit, and any of this commands brings me to the same screen. I opened a journal, and scrolling down found some orange code lines, which are possible errors, and way cause emergency mode. But at thus stage i really don't know what should I do. My main goal is to restore my previous linux settings on new SSD (as i was said before) I would really appreciate your suggestions and possible solutions for this situation!
Serafym (11 rep)
Jun 29, 2024, 11:08 AM • Last activity: Jun 29, 2024, 12:09 PM
4 votes
1 answers
7261 views
How to fix/reinstall grub from debian media, e.g. rescue mode?
How can one invoke `grub-install` from the debian netinst image? Or, does one need the live cd. (Situation: two disks: one degraded btrfs raid 1, another a blank disk I can install a new OS on, but which I can't boot from due to mobo. Currently upon booting, a black screen says "[Reboot and Select p...
How can one invoke grub-install from the debian netinst image? Or, does one need the live cd. (Situation: two disks: one degraded btrfs raid 1, another a blank disk I can install a new OS on, but which I can't boot from due to mobo. Currently upon booting, a black screen says "[Reboot and Select proper Boot device or Insert Boot Media in selected Boot device](https://askubuntu.com/questions/304144/clean-install-of-ubuntu-wont-boot-reboot-and-select-proper-boot-device) "; which program is saying this? Is this a GRUB message I can't find in the sourcecode? What is it trying to say; is it "failing successfully" or failing at a certain point?) I started the 'rescue' mode, selected "launch shell" (no root partition) when prompted, it set up a shell, but the only command is called grub-installer (not grub-install) which doesn't seem to do anything. Thank you.
ninjagecko (199 rep)
Jan 29, 2020, 07:24 PM • Last activity: Apr 28, 2024, 01:02 AM
0 votes
0 answers
46 views
How do you type special characters in the logging prompt?
So I messed up my fstab, and now my computer will boot into the "rescue" mode However, me being a bit clumsy, I have some special characters in my password (namely à and À). Is there a way I can type those in or am I just screwed ?
So I messed up my fstab, and now my computer will boot into the "rescue" mode However, me being a bit clumsy, I have some special characters in my password (namely à and À). Is there a way I can type those in or am I just screwed ?
Maliafo (101 rep)
Dec 22, 2023, 04:44 PM • Last activity: Dec 22, 2023, 05:01 PM
0 votes
1 answers
1023 views
rescue image with ext4magic or extundelete
Some rescue operations and similar need to be done with the the drive or volume unmounted. Previously I have downloaded an .iso of GParted which I put on a USB stick and booted up from it into a basic gui from which it was possible to rearrange the partitions on the disk. Now I just deleted a single...
Some rescue operations and similar need to be done with the the drive or volume unmounted. Previously I have downloaded an .iso of GParted which I put on a USB stick and booted up from it into a basic gui from which it was possible to rearrange the partitions on the disk. Now I just deleted a single file I've been working on for days with rm (I know..) and need to really try to get it back. ext4magic should be able to do it, I have the command ready to go. extundelete maybe but that one is unmaintained. I just put my debian-11.3.0-amd64-DVD-1.iso onto the USB from a dd command and booted from it. There was a 'rescue mode' option. That provided a semi-useless terminal with almost no commands or otherwise it allowed the root partition of the PC to be brought to life in a terminal. So I did that but the partition with the file I wanted to recover being /home was also mounted but I needed it unmounted. There are a few rescue things out there such as - https://www.supergrubdisk.org/ https://www.system-rescue.org/ ...which don't look like they have it. I just tested https://www.finnix.org/ - dd'd it to the USB and booted it into its terminal. It had a lot of commands but none to recover ext4 Does anyone know where can I find a bootable CD .iso image to put on the USB-stick which will boot into some kind of live system, not insist on partitioning the drive or installing itself, and have available the command ext4magic or otherwise extundelete ?
cardamom (662 rep)
Aug 16, 2023, 05:06 PM • Last activity: Aug 16, 2023, 11:32 PM
0 votes
0 answers
69 views
Grub Rescue Desktop PC completely broken
This is not a Dual OS, I only have a Linux Feren OS installed. I was supposed to install Windows 7 onto it. It says I need to create a partition for Win 7 Installation. Next I hop into Command prompt and create 2 partitions. I accidentally set it to occupy the whole HDD and I deleted it. I think tha...
This is not a Dual OS, I only have a Linux Feren OS installed. I was supposed to install Windows 7 onto it. It says I need to create a partition for Win 7 Installation. Next I hop into Command prompt and create 2 partitions. I accidentally set it to occupy the whole HDD and I deleted it. I think that might be the problem. I've restarted the PC and now I'm here at Grub Rescue. Also there is no CD/DVD drive, only USB ports. I've tried the ls command, it only shows up one HDD with one partition and it's unknown filesystem. Also tried set prefix, boot, root no help. Also insmod normal doesn't work because it is an unknown filesystem. If I can somehow boot the PC up using an USB stick, I already formatted my stick to an **ext2 filesystem** and it recognizes it. Only problem I have is that there are no files on that stick. I wonder how to copy files into an **ext2 filesystem** USB stick. I can't get past Grub Rescue, and can't enter BIOS or anything other.
ImBroke (1 rep)
Jun 21, 2023, 10:50 AM • Last activity: Jun 21, 2023, 11:04 AM
0 votes
1 answers
117 views
Chroot is not working on suse 9 rescue system?
I need to recover a server with suse 9, but I'm facing a very common error of `chroot` not working. It is complaining that `/bin/bash` does not exist, but it exists. These are the commands I've used: ``` mount /dev/dvg/lv00 /mnt mount -t proc proc /mnt/proc mount -t sysfs sys /mnt/sys mount -o bind...
I need to recover a server with suse 9, but I'm facing a very common error of chroot not working. It is complaining that /bin/bash does not exist, but it exists. These are the commands I've used:
mount /dev/dvg/lv00 /mnt
mount -t proc proc /mnt/proc
mount -t sysfs sys /mnt/sys
mount -o bind /dev /mnt/dev

cd /

chroot /mnt
But it fails with no such file or directory. ldd on /mnt/bin/bash shows that every needed library is available. Strace does not help at all. /mnt/bin/bash -i works with no error. Any help on it?
Sergio Monteiro (1 rep)
Apr 22, 2023, 09:51 PM • Last activity: Apr 22, 2023, 10:41 PM
0 votes
1 answers
1732 views
system rescue cd failure reading sector from cd0
Im trying to run system rescue cd on my HP4250 laptop and im getting a read error on the disk. Its saying the kernel needs to be loaded first, oddly enough, even though this is the place where i choose the kernel (before it loads). The disk boots fine on another system, looks perfect condition, and...
Im trying to run system rescue cd on my HP4250 laptop and im getting a read error on the disk. Its saying the kernel needs to be loaded first, oddly enough, even though this is the place where i choose the kernel (before it loads). The disk boots fine on another system, looks perfect condition, and is fairly new. I saw another instance of a similar problem where a guy was running mint disk or somethign and this happened, and the one suggestion was to turn off secure boot. What is that?
Brian Thomas (734 rep)
Aug 18, 2015, 08:31 PM • Last activity: Apr 15, 2023, 05:03 PM
5 votes
2 answers
42580 views
Booting Fedora in rescue mode
I have created a new Fedora live USB with the intention of booting into rescue mode and fixing the bootloader, so that I can dualboot win7 and Fedora 20. However, I do not understand how I am to boot into rescue mode, seeing as the installation boot prompt is not shown as described by the [guide][1]...
I have created a new Fedora live USB with the intention of booting into rescue mode and fixing the bootloader, so that I can dualboot win7 and Fedora 20. However, I do not understand how I am to boot into rescue mode, seeing as the installation boot prompt is not shown as described by the guide , I am taken directly to the installation process. Pressing tab when given the option to run Fedora Live allows me write stuff in a terminalish thingy, but writing linux rescue simply starts the Fedora Live as usual. Some sources claim that I need the DVD, not the LiveUSB. I will try this shortly.
Andrew Thompson (249 rep)
Jan 2, 2014, 12:48 PM • Last activity: Mar 15, 2023, 03:50 AM
2 votes
0 answers
240 views
How to restore the main kernel from the rescue kernel in Fedora 37
I have a Fedora 37 installation which kernel was corrupted when trying to setup propietary nvidia graphics. I lost wifi and all control to the screen. Booting into the rescue option in Grub fixes it and things work as expected. How can I use that rescue to repair or replace the main kernel in order...
I have a Fedora 37 installation which kernel was corrupted when trying to setup propietary nvidia graphics. I lost wifi and all control to the screen. Booting into the rescue option in Grub fixes it and things work as expected. How can I use that rescue to repair or replace the main kernel in order to boot from the standard 1st grub option?
Xandor19 (21 rep)
Mar 7, 2023, 05:06 PM
Showing page 1 of 20 total questions