Announcement

Collapse
No announcement yet.

Crash goes the system

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Crash goes the system

    Help! My system has crashed! (Kubuntu 18.04 btrfs) I was trying to reformat a USB using KDE partition manager in order to copy the Appimage of Libre Office onto a USB drive when something happened. I was trying to put the mount point of the USB onto root/media/steve where all my USB drives seem to locate themselves when the problem began, and now I can't boot into Kubuntu. What I get is a message saying I'm in emergency mode and that my swapfile has holes. I didn't make a swapfile when I installed Kubuntu. I get several options, mostly to reboot and one to view system logs and one for maintenance, which just gets me back to the list of options. The problem seems to lie in the swapfile, judging from the systems logs. I get messages in red which say 'failed to activate swap /swapfile' throughout the systems logs, which I'm looking at now. I have a rather recent snapshot of my system on my HD, but as a rank amateur I have no idea what to do with it in order to restore my setup before this problem began.

    I've given as much information as I think might help, but if there's anything else I can do please let me know. And by the way, is there an easier way to erase and format a USB drive other than using a partition manager? That seems to be the source of my crash as far as I can see. Thanks for any help. I am not without resources--I have copied my @ and @home files onto an external HD, and still have Kubuntu 18.04 on a USB drive, so the system is mostly recoverable. But I would like to avoid all that and fix what I have if it's possible.

    #2
    I can't help with the restore bits, btrfs is still too unknown for me, though there are plenty who can help.\

    As for partitioning, you do not have to set a mount point in there, especially for USB drives. The system will take care of mounting and unmounting from the Desktop side of things.
    I have not seen anything much in the way of simple disk formatters, though I think Mint has one (Mintstick) , and gnome-disk-utility is probably somewhere between that and KDE's tool/Gparted.

    There are a couple of ways to format the disk in Partition Manager (Gparted will be very similar)
    One way is to right click the partition, select properties, and there will be a box at the top to select the file system, change that to whatever you want. After you close the window, click "apply" at the top of the formatter.

    You can also wipe then format it by right-clicking on the partition, and selecting delete, then again right clicking and select "New", and only edit the filesystem option to (ext4, fat32 etc),selecting OK, then Apply.

    Click image for larger version

Name:	Screenshot_20180810_223348.png
Views:	1
Size:	88.5 KB
ID:	643962

    Comment


      #3
      Originally posted by oldgeek View Post
      Help! My system has crashed! (Kubuntu 18.04 btrfs) I was trying to reformat a USB using KDE partition manager in order to copy the Appimage of Libre Office onto a USB drive when something happened. I was trying to put the mount point of the USB onto root/media/steve where all my USB drives seem to locate themselves when the problem began, and now I can't boot into Kubuntu. What I get is a message saying I'm in emergency mode and that my swapfile has holes. I didn't make a swapfile when I installed Kubuntu. I get several options, mostly to reboot and one to view system logs and one for maintenance, which just gets me back to the list of options. The problem seems to lie in the swapfile, judging from the systems logs. I get messages in red which say 'failed to activate swap /swapfile' throughout the systems logs, which I'm looking at now. I have a rather recent snapshot of my system on my HD, but as a rank amateur I have no idea what to do with it in order to restore my setup before this problem began.

      I've given as much information as I think might help, but if there's anything else I can do please let me know. And by the way, is there an easier way to erase and format a USB drive other than using a partition manager? That seems to be the source of my crash as far as I can see. Thanks for any help. I am not without resources--I have copied my @ and @home files onto an external HD, and still have Kubuntu 18.04 on a USB drive, so the system is mostly recoverable. But I would like to avoid all that and fix what I have if it's possible.
      I suspect that you may have mounted the wrong device (sda1 ?) to /root/media/steve and copying the AppImage file to it destroyed your system. If you have more than one storage system on your PC the sdX designations can change spontaneously, which is why mounting them with
      /dev/disk/by-uuid/actualuuid
      is the correct way to mount them. Using "blkid" in a Konsole shows all the storage devices your machine has access to.
      :~$ blkid
      /dev/sda1: UUID="00fa8116-00d7-4611-9603-434769265d10" UUID_SUB="b7f30ed6-bdeb-4100-9c68-75d9e0fdbe32" TYPE="btrfs" PARTUUID="e00dfb49-01"
      /dev/sdb1: LABEL="sdb1" UUID="17f4fe91-5cbc-46f6-9577-10aa173ac5f6" UUID_SUB="4d5f96d5-c6c6-4183-814b-88118160b615" TYPE="btrfs" PARTUUID="5fa5762c-9d66-4fdf-ba8f-5c699763e636"
      /dev/sdc1: LABEL="sdc1" UUID="b3131abd-c58d-4f32-9270-41815b72b203" UUID_SUB="498bde29-97bd-4282-b246-c1d20368b1da" TYPE="btrfs" PARTUUID="6fe79cf9-2de8-4fab-8f68-51d6e092b2a2"
      IF you didn't install and activate a swapfile, or one of the programs you installed did not do that, then I have no clue as to why it would suddenly appear, unless your copying the AppImage file overwrote and/or created some form of swapfile.

      Did you use Btrfs send & receive to send copies of @ and @home to your external HD? . IF you didn't use btrfs send & receive then they are worthless and you might as well just jump immediately to re-installing your Kubuntu 18.04.

      If you did use btrfs send & receive your backups may be good. Just re-install Kubuntu 18.04 onto your internal HD and reformat / when you do it. That will put a fresh @ and @home in the <ROOT_FS>. Then we can replace the fresh @ and @home with your backup copies.

      Reboot using that LiveUSB that you used to install BIONIC, and mount your internal HD, but use /dev/disk/by-uuid
      mount -t btrfs /dev/disk/by-uuid/yourintenalHDuuid /mnt
      You can copy & paste your uuid from your blkid listing.

      Using "vdir /mnt" you should be able to see
      /mnt/@
      /mnt/@home
      Those are the @ and @home you just made by re-installing Kubuntu 18.04

      Now, you need to mount your external HD. Plug it in and identify it with blkid and mount it to another mount point. I created a mount point labeled "/backup" to do that but /media is handy.
      mount -t btrfs /dev/disk/by-uuid/externaluuid /media

      Listing /media should show you the backup @whatever and @homewhatever. Those are read-only snapshots or you would not have been able to move them to the external HD using Btrfs send & receive
      Otherwise:
      Move @ to @old and @home to @homeold
      mv /mnt/@ /mnt/@old
      mv /mnt/@home /mnt/@homeold
      Then retrieve the backup @whatever and @homewhatever
      btrfs send /media/@whatever | btrfs receive /mnt
      sync
      btrfs send /media/@homewhatever | btrfs receive /mnt
      sync
      Now, make them read-write
      btrfs property -ts @whatever ro false
      btrfs property -ts @homewhatever ro false
      and move them
      mv /mnt/@homewhatever /mnt/@home
      mv /mnt/@whatever /mnt/@

      umount /media
      umount /mnt
      Shutdown your LliveUSB stick, remove it when asked, and continue the power down. Then power up.
      "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
      – John F. Kennedy, February 26, 1962.

      Comment


        #4
        Can't get the retrieval process to work. I get an error message. short read from stream: expected 17 read 1 as soon as I try to retrieve the @ backup on the external HD.

        Comment


          #5
          OK, I tried it all again and managed to copy the backup. But I got stuck on the commands to make the backup files read and write--it just doesn't happen. What do I do now?

          Comment


            #6
            Boot to a live USB, mount the hard drive partition you're trying to boot to, edit /etc/fstab and put a # in front of the line where SWAP is mounted, and reboot. If it still doesn't boot you've got a larger problem.

            If you install Kubuntu 18.04 without specifying a swap partition the new default behavior is to create a swap file. This has been reported as a bug with regards to BTRFS because BTRFS can't store a swapfile without it eventually getting corrupted - which you just discovered.

            As far as your backup read-write issue, you're going to have to explain what you did, the actual commands you entered, and the actual errors.

            Please Read Me

            Comment


              #7
              I can't seem to get this to work, so I'm going back to Aptik to restore my folders and settings. I've spent the whole day on this without success. Later I will try to show what went wrong, but for now I just want to get my system back up. Thanks for all the help--I haven't given up on btrfs, but it will take less time to use Aptik than to go through all the steps GreyGeek kindly listed. Now I'm trying upgrade the system, but to add to my woes the download process is extremely slow--less than 30 kb/sec!--and this on a 60 mb bandwith!

              Comment


                #8
                I'm not sure what we wrote is what you did.
                It would be nice to use TeamViewer and log into your system to see how you've set it up and see where the problems are.
                "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                – John F. Kennedy, February 26, 1962.

                Comment


                  #9
                  I had to make a few changes. It's late here and I can't go into detail, but I will tomorrow. One of the problems I had was using the USB boot of Kubuntu--it wouldn't recognize /mnt in /etc/fstab. Another problem I had was using @old and @homeold. More details later. I still want to use btrfs and my latest install uses it. Aptik was successful in restoring my previous files, by the way, and now I have to see what I need to re-install. I'm sure whatever problems I had were my fault and caused by my re-interpretations of your instructions. At any rate, my system is back and I've learned a lot, so no harm done. By the way, what is TeamViewer?

                  Comment


                    #10
                    Crash goes the system

                    TeamViewer is a remote access app that would allow someone to access your home account as if they were setting at your keyboard and using your mouse. It is a commercial app that is free for personal use.


                    You say that you were booting KDE from a USB stick. Usually, booting from a LiveUSB stick doesn’t touch the local HD. What were you trying to do?
                    "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                    – John F. Kennedy, February 26, 1962.

                    Comment


                      #11
                      I thought I was following your instructions.

                      If you did use btrfs send & receive your backups may be good. Just re-install Kubuntu 18.04 onto your internal HD and reformat / when you do it. That will put a fresh @ and @home in the <ROOT_FS>. Then we can replace the fresh @ and @home with your backup copies.

                      Reboot using that LiveUSB that you used to install BIONIC, and mount your internal HD, but use /dev/disk/by-uuid
                      mount -t btrfs /dev/disk/by-uuid/yourintenalHDuuid /mnt
                      You can copy & paste your uuid from your blkid listing.

                      And the last instruction said:

                      Shutdown your LliveUSB stick, remove it when asked, and continue the power down. Then power up.

                      My confusion, I guess. I was also confused by the use of @old and @homeold and might have done something wrong there. I did manage to send the backups to the internal HD but when I rebooted I got a grub error which mentioned the @old and @homeold folders (or just the first, I don't remember). I think the longer I worked at it, the worse it got, so at that point I just re-installed Bionic and used Aptik to retrieve most of my files. I suppose it wouldn't be worth trying to retrieve the backups now, but I've saved them just in case. I really appreciate the help and I'll keep backing up snapshots every so often just in case. I'm not finished with btrfs yet!

                      Comment


                        #12
                        Generally, just doing a standard install up to the HD partition, then selecting the Manual partitioning method, and on that panel select the sda and erase all exiting partitions and create a new sda1. Select btrfs as the filesystem and "/" as the label. Then continue to complete the installation and reboot. Remove the LiveUSB when told to do so and continue the reboot.

                        Nothing fancy or tricky, like chroot, is necessary. No need to do anything else. Now, want to recover your old @ and @home from an external storage?
                        Mount your backup HD that contains your @ and @home backup snapshots.

                        Mount your <ROOT_FS>
                        sudo -i
                        mount /dev/disk/by-uuid/itsuuid /mnt

                        Mount backup HD
                        mount /dev/disk/by-uuid/itsuuid /backup

                        mv /mnt/@ /mnt/@pre
                        mv /mnt/@home /mnt/@homepre
                        btrfs su snapshot /backup/path/@whatever /mnt/@
                        btrfs su snapshot /backup/path/@homewhatever /mnt/@home
                        umount /backup
                        umount /mnt

                        Make sure the sda1 uuid matches that which is in /etc/fstab
                        exit
                        exit

                        Now reboot.
                        Last edited by GreyGeek; Aug 13, 2018, 06:44 PM.
                        "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                        – John F. Kennedy, February 26, 1962.

                        Comment


                          #13
                          Thanks. I have my @ and @home in /subvol--should I just exchange all /mnt in your instructions to /subvol? Would I mount the backup HD to /subvol? Would the path to the backup HD /dev/disk/by-uuid/uuid number from blkid/@snapshot or @home snapshot? Do I use the mkdir command to create @pre and @homepre? What happens to them after the backup process is finished and I shut down?
                          Last edited by oldgeek; Aug 13, 2018, 06:27 PM.

                          Comment


                            #14
                            Originally posted by oldgeek View Post
                            Thanks. I have my @ and @home in /subvol--should I just exchange all /mnt in your instructions to /subvol? Would I mount the backup HD to /subvol? Would the path to the backup HD /dev/disk/by-uuid/uuid number from blkid/@snapshot or @home snapshot? Do I use the mkdir command to create @pre and @homepre? What happens to them after the backup process is finished and I shut down?
                            No. Use what ever name you want. IF you mount your <ROOT_FS> as /subvol you cannot then mount the backup drive to it. DO NOT use mkdir to make @pre or @homepre because those would be directories, NOT Btrfs subvolumes.

                            NOTE that I used "mv" to move @ to @pre. In effect I just moved @ out of the way by renaming it to @pre. It is still a subvolume.

                            My convention is to always use @ as the first character of a subvolume (although one does not have to) and NEVER use it to begin the name of a directory. That makes subvolumes, which are like directories, easy to differentiate from directories.

                            \Whether you should use /mnt or /subvol depends on what you use as a name for a mount point. There is nothing important about the name itself, other than being easy to type. What ever you call it, when you mount it
                            mount /dev/disk/by-uuid/uuidwhatever /somename
                            Then "somename" becomes the <ROOT_FS> for your Btrfs pool if BTRFS is installed on that UUID.

                            I use /mnt because it was present on my system and it is easy to type. I created the directory /backup in order to attach an internal (or external) HD as the destination for the send & receive command.

                            Nothing sacred in any of those names other than being easy to type (and/or remember).
                            Last edited by GreyGeek; Aug 13, 2018, 07:15 PM.
                            "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                            – John F. Kennedy, February 26, 1962.

                            Comment


                              #15
                              Thanks yet again. I think my problem was in using mkdir to create @old and @homeold. I didn't know the uses of @ and thought I needed to create those new directories in order to make the think work. If I remember right, I think I deleted those two directories before I finished, and thus grub couldn't find my file system when I rebooted.

                              Comment

                              Working...
                              X