Announcement

Collapse
No announcement yet.

Decreasing windows partition's size and increasing kubuntu partition's size

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

    #46

    I did like in the video but something went wrong. There was a window showing that the process was finished, and I clicked on ok. And then I see this:

    Click image for larger version

Name:	03.02.18.KDE-partition-manager_after_attempt.jpg
Views:	1
Size:	61.1 KB
ID:	643753

    It didn't work at all... and now I fear that I need to reinstall kubuntu... which I don't know how to do.

    Any idea, suggestion? Except crying?
    Last edited by Robert24; Feb 03, 2018, 12:24 PM.

    Comment


      #47
      Exit the partition manager and restart it. It should redetect the partitions.

      Sent from my ONEPLUS A5010 using Tapatalk

      Comment


        #48
        Oh maybe I didn't point out what happened correctly:

        The linux partition was moved to the left as desired but not expended and now the type is not recognized anymore (before it was ext4). I fear that my linux partition has been damaged. I didn't try to reboot and enter it by fear of making it worse. I am still on my usb live key partition.

        I restarted KDE partition manager but it didn t change anything.

        Comment


          #49
          Open a terminal and type

          sudo parted -l

          Sent from my ONEPLUS A5010 using Tapatalk

          Comment


            #50
            Here is the output

            Code:
            Model: ATA SAMSUNG MZ7LN512 (scsi)
            Disk /dev/sda: 512GB
            Sector size (logical/physical): 512B/512B
            Partition Table: gpt
            Disk Flags: 
            
            Number  Start   End    Size    File system  Name                          Flags
            1      1049kB  274MB  273MB   fat32        EFI system partition          boot, hidden, esp
            2      274MB   290MB  16.8MB               Microsoft reserved partition  msftres
            3      290MB   287GB  286GB   ntfs         Basic data partition          msftdata
            6      287GB   354GB  67.9GB
            4      511GB   512GB  1049MB  ntfs         Basic data partition          hidden, diag

            Comment


              #51
              Reboot the PC and restart from the live USB.

              Check your partitions again. If they don't look right, use the partition manager to run a check on sda6.

              It looks like it has issues with the boundaries.

              Sent from my ONEPLUS A5010 using Tapatalk

              Comment


                #52
                No need for tears just yet. First, hit F5 to rescan the drives. If that fails, try and mount the partition anyway.

                In a terminal:
                sudo mount /dev/sda6 /mnt

                If it mounts, just reboot again and reattempt partitionmamanger from the USB drive. If it reports an error - likely "partition type unknown" or "bad superblock" - try this:

                sudo mount -t ext4 /dev/sda6 /mnt

                If this fails, then next up is testdisk. Testdisk is very good at recovering partition tables and superblocks. Since you're using GPT there's a backup partition table, however, it may not be correct either because of the apparently failed move operation. There should also be a backup superblock that testdisk can find. Sector information is best found in a terminal with:

                sudo gdisk -l /dev/sda

                This will show the start and end sectors of all your partitions and may give a warning if something looks wrong.

                Before you go forward, let me say that unless you had needed data that you must recover, it will take less time and trouble to just re-install than all this mucking about will take. Of course, it will be a good exercise in disaster recovery and you'll learn a thing or two.

                Since I'm tossing out free advice, this would also be a good time to create separate partitions for your /home and maybe a backup partition for another Linux installation.

                Anyway, do the above things and post the results.

                Please Read Me

                Comment


                  #53
                  Thank you to both of you.

                  @oshunluvr can I ask when I should hit f5? In the partition manager? In the BIOS? Even before when there is the first screen when my computer turns on?

                  Comment


                    #54
                    Sorry, a lot of people posted before I hit "Post..."

                    F5 in KDE Partition Manager "refreshes" or re-scans the drives (it's in the Tools menu). However, if you already re-loaded or restarted partition manager, it would have re-scanned them then anyway.

                    Assuming your data was actually moved and is intact, the most likely scenario IMO is the superblock is bad. Try the other stuff (mounting, etc.) and report back.

                    Please Read Me

                    Comment


                      #55
                      Thanks for your reply Oshunluvr.

                      I refreshed again with f5 and nothing changed.

                      Then I tried the two commands which start with "sudo mount" but I got errors (bad superblock both times).

                      Then I entered testdisk in the terminal and I obtained this but I don't know what to do with it:

                      Code:
                      TestDisk 7.0, Data Recovery Utility, April 2015
                      Christophe GRENIER <grenier@cgsecurity.org>
                      http://www.cgsecurity.org
                      
                      Disk /dev/sda - 512 GB / 476 GiB - CHS 62260 255 63
                          Partition               Start        End    Size in sectors
                      P MS Data                     2048     534527     532480 [SYSTEM]
                      P MS Data                   567296  559597567  559030272
                      P Linux Swap             834265080  834265095         16
                      D MS Data                865515520  998166527  132651008
                      D MS Data                996118529  998166528    2048000
                      >D MS Data                998166528 1000214527    2048000
                      
                      Structure: Ok. Use Up/Down Arrow keys to select partition.
                      Use Left/Right Arrow keys to CHANGE partition characteristics:
                                     P=Primary  D=Deleted
                      Keys A: add partition, L: load backup, T: change type, P: list files,
                          Enter: to continue
                      NTFS, blocksize=4096, 1048 MB / 1000 MiB
                      Should I select something?

                      Comment


                        #56
                        Not yet, first try this:

                        sudo fsck.ext4 -v /dev/sda6

                        Likely, you'll get a message about "bad magic numbers..." or something. Post the output. Assuming you get the error messages, then do this and also post the output:

                        sudo dumpe2fs /dev/sda6 | grep superblock


                        Please Read Me

                        Comment


                          #57
                          Thanks for the support}

                          So I entered the first command and obtained the output that you predicted:

                          Code:
                          kubuntu@kubuntu:~$ sudo fsck.ext4 -v /dev/sda6
                          e2fsck 1.42.13 (17-May-2015)
                          ext2fs_open2: Bad magic number in super-block
                          fsck.ext4: Superblock invalid, trying backup blocks...
                          fsck.ext4: Bad magic number in super-block while trying to open /dev/sda6
                          
                          The superblock could not be read or does not describe a valid ext2/ext3/ext4
                          filesystem. If the device is valid and it really contains an ext2/ext3/ext4
                          filesystem (and not swap or ufs or something else), then the superblock
                          is corrupt, and you might try running e2fsck with an alternate superblock:
                            e2fsck -b 8193 <device>
                          or
                            e2fsck -b 32768 <device>
                          then I entered the second command and obtained

                          Code:
                          kubuntu@kubuntu:~$ sudo dumpe2fs /dev/sda6 | grep superblock
                          dumpe2fs 1.42.13 (17-May-2015)
                          dumpe2fs: Bad magic number in super-block while trying to open /dev/sda6
                          Couldn't find valid filesystem superblock.
                          but I must say that I don t understand what happened.

                          Comment


                            #58
                            Well, me neither, but your file system is toast. No superblocks found at all and you should have 15-20 or so superblock backups in a file system that size. It's possible your partition didn't actually get moved at all and instead just the partition table was changed. In that case, a backup partition table, if a good one exists, might put you back where you were. But it also could make things worse, like losing access to the Windows partitions too. At this level of messing about, your whole drive is at risk. This won't make you feel better, but I've never seen the KDE partitionmanager cause this level of problems. You either encountered an unknown bug or are the unluckiest Kubuntu user in all of Switzerland.

                            Your choices are:

                            1. Try and discover the location of the original ext4 partition and restore the partition table and try again - assuming it's still there.
                            2. Run photorec to recover data files in the former partition (it recovers just about everything, not just photos).
                            3. Give up on recovering the data (you do have a backup, right?) and just rebuild your partitions the way you want and re-install.

                            Honestly, the 3rd option will take less than 15 minutes. The others will take hours or more. If you are keen to tackle option 1, first make a backup of your existing partition table onto a USB drive so you can restore it if things go sideways again. I wrote a post on this forum years ago about how to do that, but I haven't updated it in a while.

                            Back to free advice: If it were me, I would divide that free space into 4 partitions; Swap, Install, Home, and Backup install, then re-install Kubuntu.

                            Here's why:
                            1. Having a separate home is safer from things like this and makes your personal files easier to backup.
                            2. Having both an Install partition and one for a backup install gives you the opportunity to keep a known working installation that you never mess with that you can boot to in a catastrophe like this one. Or you can use the extra partition as a playground of sorts - a place to safely install other distros or to install the newest version of Kubuntu while still leaving your old version bootable. I currently have 6 separate installs on my system.
                            3. Swap is obvious.

                            20GB is plenty for a Kubuntu install so with 200+GB of free space you can have several extra install partitions if you wanted (I don't use ext4 as my boot file system so my set up is different - something for another thread).

                            Please Read Me

                            Comment


                              #59
                              Thanks a lot for your help oshunluvr.

                              I guess I'm unlucky. I think I will go for the third option, i.e. reinstall everything, because it's been already 4 days that I cannot use my computer because of this issue and I would like to move on. It is a bit annoying because I had some anaconda environments for python which I m not sure are saved, but I definitely saved all the data. So let's get on with this.

                              Concerning your suggestion, I don't have any objection but I don't understand how this home directory on a separate partition is possible. What would be the division of my 228GB of free memory?
                              I don't mind having 20GB specially for this partition where I will have an independent kubuntu, but I still want to have that a big partition (at least 150GB) for the partition I use in my everyday life (I guess that would be the home directory right?) because I need to treat big data and I need space for it.

                              If you could guide me for this installation I would really appreciate it because I have no idea how it works.

                              But anyway, I really thank you all for your support even if it looks like Murphy's law applied today

                              EDIT: I realize that there is one thing that I didn't save: my bookmarks from mozilla, and I have really a lot. Is there a way to save them?

                              Also one more question: what will happen if I turn off my computer? Can I still boot Windows?
                              Last edited by Robert24; Feb 03, 2018, 04:29 PM.

                              Comment


                                #60
                                Ok guys, I made up my mind: I want to reinstall kubuntu from scratch, and do the partitioning suggested above. Concerning my bookmarks I remembered that some of them still exist on my windows partition. So before doing anything I would like to know if I can reboot my computer and go into windows safely, in order to save my (windows) bookmarks. After that I would be really grateful if you could help me with the re-installation because I don't know how to do it and give the state of my partition I would be surprised if I can find a tutorial online which has the same set up as me.

                                Comment

                                Working...
                                X