Announcement

Collapse
No announcement yet.

How do I allocate more HD space for Kubuntu?

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

    How do I allocate more HD space for Kubuntu?

    I have been running Kubuntu 11.10, KDE 4.7.4, GRUB - Version: 0.97-29ubuntu64, for some time now with little problems. Recently my Dropbox account has given me the warining that I needed more HD space in order to sync.
    my HD is 160 Gb. In Partition Manager I have a partition ext4 sda5 63.18 GiB, used 29.91 GiB, sda6 that reads 27.35 GiB, used 22.36 GiB. and /dev/sda3, size45.23 GiB., available 44.35 GiB.
    I'm a little hesitant to start telling it to resize without a little hand-holding. I'm using this as my primary machine and I can't afford to wipe my drive through my own stupidity.
    Got time for providing a little guidance?
    thanks,
    GPS
    Using Linux only for a few years, using mostly mouse on GUI (sorry gurus). Kubuntu 19.04 beta on home-built: GigaByte board - AMD Phenom II, 3000 6 core, RAM 4 Gb,

    #2
    Let us see your partition information. Open a console and type:
    Code:
    sudo fdisk -l
    Copy/paste in a reply.
    Windows no longer obstructs my view.
    Using Kubuntu Linux since March 23, 2007.
    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

    Comment


      #3
      Disk /dev/sda: 164.7 GB, 164696555520 bytes
      255 heads, 63 sectors/track, 20023 cylinders, total 321672960 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 identifier: 0x000ada32

      Device Boot Start End Blocks Id System
      /dev/sda1 * 16126 205582335 102783105 f W95 Ext'd (LBA)
      /dev/sda2 300688605 318601079 8956237+ 82 Linux swap / Solaris
      /dev/sda3 205583805 300447629 47431912+ 83 Linux
      /dev/sda5 16128 132510378 66247125+ 83 Linux
      /dev/sda6 132511744 189859839 28674048 83 Linux
      /dev/sda7 189861888 205582335 7860224 82 Linux swap / Solaris

      Partition table entries are not in disk order
      Using Linux only for a few years, using mostly mouse on GUI (sorry gurus). Kubuntu 19.04 beta on home-built: GigaByte board - AMD Phenom II, 3000 6 core, RAM 4 Gb,

      Comment


        #4
        You do have some division there that isn't really necessary. There are a couple ways to tackle this. A little more info would be helpful - like what is on each partition. And I see you partition table is out of order - not a problem per se, but could be confusing down the road and is fixable now. It looks like you've got /home as sda5, / as sda6 and sda3 is unused. If you want the easy way out - mount sda6 under your /home as some folder (Documents or whatever) and start using it that way. Otherwise, continue reading...

        When you get a chance, post your /etc/fstab file and list your partitions using the results from this command:

        sudo blkid -o list -c /dev/null

        First lets discuss some things about your needs and make a plan:

        The first thing I noticed is you've got two swap partitions which are huge and unnecessary unless you are putting two separate installs asleep at the same time - not a likely event. The normal usage for swap is to off-load RAM during very heavy usage and to store a copy of RAM during hibernation. The proper amount of swap is the larger of either your total RAM size or 2GB - there's just no use for more. I'll assume you have a laptop with 8GB of RAM? Sounds like a lot. More likely 4GB. So we can start by deleting sda7 entirely and then shrinking sda2 to an appropriate size. Actually - since it's swap, it's must faster and better to delete and recreate it.

        Next, we need a plan for your future. Using 11.10 means you're already using an unsupported release. At some point you'll want or have to upgrade. Why not plan for it now? I propose this: The target partition scheme will support a separate /home (always a good idea) and two side-by-side installs.

        You should probably remove a couple unused things before you start moving stuff around. With a small hard drive like yours, space will always be premium so tidiness is a must.

        If it were my system, I'd want 2x26GB install partitions, one swap 4GB, and whats left over for /home - about 100GB.

        Your current partition table is something like this:
        partition size in GB
        /dev/sda1 100.37
        /dev/sda5 63.18
        /dev/sda6 27.35
        /dev/sda7 7.50
        /dev/sda3 45.23
        /dev/sda2 8.54
        My suggestion would be:
        partition size in GB Usage
        /dev/sda1 100 extended
        /dev/sda2 4 swap
        /dev/sda3 26 Current install
        /dev/sda4 26 Future Install
        /dev/sda5 100 Home
        To minimize data movement and partition alignment moves, I settled with the current size of your extended partition. We just need to move the data out of it. The good news is you got plenty of space - it's just broken up a bit.

        Steps required:
        1. Turn off swap and delete both swap partitions.
        2. Delete sda3.
        3. Create new swap partition as sda2 in desired size.
        4. Divide remaining free space in half and create sda3 and sda4.
        5. Turn swap on.
        6. Create new ext4 filesystems on sda3 and sda4.

        Assuming I am correct about the current sda3 being unused, all the above can be done while running from your install with no loss of data or function.

        Depending on whether or not fstab is using UUID's or device names, you may need to edit it as well. These will have to be watched closely so we don't leave you in an un-bootable state.

        Next, we need to move your data off of sda5 onto sda3 and get you booting into sda3. There are lots of ways to do this, but I think rdiff-backup is the easiest. It will make a complete file-to-file copy of your install. The next set of steps:

        1. rdiff-backup copy / to sda3 (it needs to be mounted somewhere). This will kick errors for any files in use, so log out of the desktop and into a terminal and stop KDM for this command.
        2. edit the fstab in the new sda3 to match the new UUID or device name for that install.
        3. Run update-grub and verify sda3 is detected as a bootable install.
        4. Reboot and select the sda3 install.

        At this point, if you're running from sda3 (check the results of mount to be sure you're not using sda6), you're almost done! Play around a bit to make sure everything is working. If all is well, you will want to re-install grub to the MBR before you delete sda6.

        sudo grub-install /dev/sda

        should do it. Reboot again to make sure all is well.

        You are still using sda5 as your home so you can't expand it. You can either move your home to sda4 temporarily and move it back later, or boot to a live Gparted CD and just expand it there (easier IMO). Obviously, you will need to delete sda6 before expanding sda5. BE SURE the sda3 install is working!

        Once you have done all this, you can wipe (reformat) sda4 and install 14.04 on it to play with. It's an LTS release so it would be a good choice for your next distro!

        If you decide to undertake this, some of the steps might need further explaining. It'll take several hours to do all this, but I've had worse
        Last edited by oshunluvr; Jan 26, 2014, 10:51 AM.

        Please Read Me

        Comment


          #5
          Originally posted by oshunluvr View Post

          sudo blkid -o list -c /dev/null
          device fs_type label mount point UUID
          ----------------------------------------------------------------------------------------------------------------------
          /dev/sda2 swap SWAP (not mounted) 44b4b6ba-65eb-4295-b8fb-ba99f0b8b8f3
          /dev/sda3 ext4 space (not mounted) 91e4e68d-aada-4b4c-9e20-7078dbb07d3e
          /dev/sda5 ext4 (not mounted) 138c7e8a-ab14-461c-9bce-ed83424a14ba
          /dev/sda6 ext4 / 1db51d0b-ac03-4877-90e8-bc1539535790
          /dev/sda7 swap <swap> 260df0d2-f4df-4c7e-92f8-b3c20774d846
          Using Linux only for a few years, using mostly mouse on GUI (sorry gurus). Kubuntu 19.04 beta on home-built: GigaByte board - AMD Phenom II, 3000 6 core, RAM 4 Gb,

          Comment


            #6
            Hi Snowhog, good to type with you again
            Using Linux only for a few years, using mostly mouse on GUI (sorry gurus). Kubuntu 19.04 beta on home-built: GigaByte board - AMD Phenom II, 3000 6 core, RAM 4 Gb,

            Comment


              #7
              oshunluvr,
              thanks for your willingness to help.
              I note you are offline, I think I will wait until I see you online before I start this.
              I have no problem upgrading to 14.1, let's do it.
              My machine is a desktop, if it makes a difference.
              I think I have a G-Parted disk around here, it's several years old. I have other machines here in front of me; I can interact with the fourm while the Kubuntu is busy. Why would I want side by side installs? It sounds unnecessary to me.
              Thanks again.
              GPS
              Using Linux only for a few years, using mostly mouse on GUI (sorry gurus). Kubuntu 19.04 beta on home-built: GigaByte board - AMD Phenom II, 3000 6 core, RAM 4 Gb,

              Comment


                #8
                # /etc/fstab: static file system information.
                #
                # Use 'blkid' to print the universally unique identifier for a
                # device; this may be used with UUID= as a more robust way to name devices
                # that works even if disks are added and removed. See fstab(5).
                #
                # <file system> <mount point> <type> <options> <dump> <pass>
                proc /proc proc nodev,noexec,nosuid 0 0
                # / was on /dev/sda6 during installation
                UUID=1db51d0b-ac03-4877-90e8-bc1539535790 / ext4 errors=remount-ro 0 1
                # swap was on /dev/sda7 during installation
                UUID=260df0d2-f4df-4c7e-92f8-b3c20774d846 none swap sw 0 0
                /dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0
                Using Linux only for a few years, using mostly mouse on GUI (sorry gurus). Kubuntu 19.04 beta on home-built: GigaByte board - AMD Phenom II, 3000 6 core, RAM 4 Gb,

                Comment


                  #9
                  GrandPaSmurf, I moved to Kubuntu 14.04 a few days ago and I'm loving it! During the install I jumped the shark and used btrfs. I'm loving it as well. Oceanluver and Snowhog Dibl are Zen masters of btrfs. You're in good hands!
                  Last edited by GreyGeek; Jan 29, 2014, 08:41 AM.
                  "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


                    #10
                    'got no idea what 'btrfs' is, but if they tell me to do it, I will stumble on through the fog...
                    Using Linux only for a few years, using mostly mouse on GUI (sorry gurus). Kubuntu 19.04 beta on home-built: GigaByte board - AMD Phenom II, 3000 6 core, RAM 4 Gb,

                    Comment


                      #11

                      UPDATE fdisk
                      disk /dev/sda: 164.7 GB, 164696555520 bytes


                      255 heads, 63 sectors/track, 20023 cylinders, total 321672960 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 identifier: 0x000ada32
                      Device Boot Start End Blocks Id System
                      /dev/sda1 * 16126 205582335 102783105 f W95 Ext'd (LBA)
                      /dev/sda3 205583805 300447629 47431912+ 83 Linux
                      /dev/sda5 16128 132510378 66247125+ 83 Linux
                      /dev/sda6 132511744 189859839 28674048 83 Linux
                      /dev/sda7 189872298 198290294 4208998+ 82 Linux swap / Solaris
                      Using Linux only for a few years, using mostly mouse on GUI (sorry gurus). Kubuntu 19.04 beta on home-built: GigaByte board - AMD Phenom II, 3000 6 core, RAM 4 Gb,

                      Comment


                        #12
                        Originally posted by GreyGeek View Post
                        Oceanluver and Snowhog are Zen masters of btrfs. You're in good hands!
                        Not moi! I'm ext4. btrfs is more than I can grok at this time, although, it is something I might consider in the future. It's just to much Greek for me!
                        Windows no longer obstructs my view.
                        Using Kubuntu Linux since March 23, 2007.
                        "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                        Comment


                          #13
                          Originally posted by oshunluvr View Post
                          Steps required:
                          1. Turn off swap and delete both swap partitions.
                          2. Delete sda3.
                          3. Create new swap partition as sda2 in desired size.
                          4. Divide remaining free space in half and create sda3 and sda4.
                          5. Turn swap on.
                          6. Create new ext4 filesystems on sda3 and sda4.
                          OK, I hit the first brick wall at 'turn swap off' and I assume 'turn swap on'
                          Last edited by Snowhog; Jan 26, 2014, 05:22 PM.
                          Using Linux only for a few years, using mostly mouse on GUI (sorry gurus). Kubuntu 19.04 beta on home-built: GigaByte board - AMD Phenom II, 3000 6 core, RAM 4 Gb,

                          Comment


                            #14
                            OK, lets go through on thing at a time.

                            First: Swap and new partitions
                            .

                            The commands are:

                            turn swap off > sudo swapoff
                            show swap status > sudo swapon -s
                            turn all swap on > sudo swapon -a

                            So you would do a status first, verify swap was on, then turn it off, status again to verify, then delete and recreate the swap, then turn it back on, and a final status to be sure it worked. You will need to either edit your fstab to show the new UUID (revealed by the blkid command) or change fstab to the device name or use the old UUID when you make the new one. Here's how I would do it (commands in bold):

                            Open a terminal.
                            sudo swapoff
                            sudo swapon -s
                            sudo fdisk /dev/sda

                            Fdisk has a pretty easy to use menu (type m for a list of commands). Using fdisk, delete sda2 (did you already do that?) and sda7 (now both swaps are gone). Since sda3 is empty (verify that if you are unsure by mounting it and looking at it before running fdisk!), lets delete that too.

                            Then create a new Primary Partition #2 the size of your desired swap. Fdisk will ask for size in sectors, but if you look at the helpline, it will show you can use +4G to mean a 4 GB partition. Now lets make primary partitions 3 and 4. When you create partition 3, grab a pencil and note the total number of sectors available for it (subtract the default First sector from the default Last sector) then divide that number by 2. Use that number as your Last sector for partition 3 and you will have divided the remaining space in half. For partition 4, you can use the default beginning and ending sectors.

                            Once you have made the all the new partitions, save the new table (w) and quit (q). If you get a comment when exiting that mentions rebooting or partition table loading - don't worry about it - just do this command:

                            sudo partprobe

                            Now make a new swap fs using the old UUID so fstab is all good:

                            sudo mkswap /dev/sda2 -U 260df0d2-f4df-4c7e-92f8-b3c20774d846

                            Then finally;

                            sudo swapon -a
                            sudo swapon -s


                            The status should show swap is on and the size of it. No rebooting required.

                            Swap done.

                            btrfs is a new filesystem that is much more sophisticated than ext4 but loads easier in many ways. However, it is still officially being tested, so I'm not sure I want to throw you into that just yet. Read up on my many btrfs posts here and others on the web. The other heavy btrfs user here is dibl. One of the biggest advantages of it is partitioning is not required at all. All your data lives on a single filesystem and it's divided by subvolumes.

                            Back to your drive. Based on your fstab you are using only sda6 for you system. However, the is a considerable amount of data on sda5. Before we continue, you should look at that and verify if there's anything on there you want to save.

                            Next step:

                            Migrating your data.

                            We will use rdiff-backup to move your data. I'm going to strongly suggest you separate / and /home. First, mount the new partitions:

                            sudo mkdir /mnt/sda3
                            sudo mkdir /mnt/sda4
                            sudo mount /dev/sda3 /mnt/sda3
                            sudo mount /dev/sda4 /mnt/sda4

                            Now move your install:

                            sudo rdiff-backup --exclude /home / /mnt/sda3

                            This will copy all your files from your install to sda3 except your /home files. In order to fully test this move, you will want to be able to boot to it before anything is deleted. This will take some explaining and the family is over for dinner. I'll pick up again later tonight or tomorrow.

                            Please Read Me

                            Comment


                              #15
                              next brick wail

                              Originally posted by oshunluvr View Post
                              OK, lets go through on thing at a time.

                              First: Swap and new partitions
                              .

                              The commands are:

                              turn swap off > sudo swapoff
                              show swap status > sudo swapon -s
                              turn all swap on > sudo swapon -a

                              So you would do a status first, verify swap was on, then turn it off, status again to verify, then delete and recreate the swap, then turn it back on, and a final status to be sure it worked. You will need to either edit your fstab to show the new UUID (revealed by the blkid command) or change fstab to the device name or use the old UUID when you make the new one. Here's how I would do it (commands in bold):

                              Open a terminal.
                              sudo swapoff
                              sudo swapon -s
                              sudo fdisk /dev/sda

                              Fdisk has a pretty easy to use menu (type m for a list of commands). Using fdisk, delete sda2 (did you already do that?) and sda7 (now both swaps are gone). Since sda3 is empty (verify that if you are unsure by mounting it and looking at it before running fdisk!), lets delete that too.

                              Then create a new Primary Partition #2 the size of your desired swap. Fdisk will ask for size in sectors, but if you look at the helpline, it will show you can use +4G to mean a 4 GB partition. Now lets make primary partitions 3 and 4. When you create partition 3, grab a pencil and note the total number of sectors available for it (subtract the default First sector from the default Last sector) then divide that number by 2. Use that number as your Last sector for partition 3 and you will have divided the remaining space in half. For partition 4, you can use the default beginning and ending sectors.
                              .
                              fdisk does not want to make a 4G size:

                              Command action
                              l logical (5 or over)
                              p primary partition (1-4)
                              p2
                              Partition number (1-4, default 2): 2
                              First sector (2048-321672959, default 2048):
                              Using default value 2048
                              Last sector, +sectors or +size{K,M,G} (2048-16125, default 16125): +4G
                              Value out of range.
                              Using Linux only for a few years, using mostly mouse on GUI (sorry gurus). Kubuntu 19.04 beta on home-built: GigaByte board - AMD Phenom II, 3000 6 core, RAM 4 Gb,

                              Comment

                              Working...
                              X