1

When I firstly installed Ubuntu I gave it 20GB of space for the filesystem. ...time passed and I get a message "the system has only 300MB available" so I need to enlarge the filesystem.

Here's my partition table:

enter image description here

enter image description here

I'm a total noob to partitioning and I have a horrible experience with it; once i had this problem: https://askubuntu.com/questions/383551/fix-partition-or-rescue-data-from-it-i-used-ddrescue on my notebook. Thanks to the great support I got, I gained the tumbleweed badge and I couldn't fix it and I had to re-install windows. The notebook didn't have much important data but this computer's much more important to me. I have backed up the data on the "Database" partition.

anyways

I need step-by-step instructions how to take space from the "Database" partition to enlarge my "filesystem" partition. and what about that red exclamation mark at /dev/sda6? how do I deal with it? ... what is it?? The red exclamation is not gone!

Tell me any extra information you need to know. Thanks in advance! :D

842Mono
  • 9,790
  • 28
  • 90
  • 153
  • What error do you get when you right click on Database and "Mount"? If it's the same error you're getting in that other question of yours, then you need to run a chkdsk on that partition. Log into Windows XP and follow the steps in the "Graphical Mode" section in this article on the Database partition. Then shutdown Windows (not hibernate). Then log back into Linux to check the exclamation mark is gone. – Alaa Ali Jan 05 '14 at 18:09
  • And by the way, you won't be doing the partitioning inside your Ubuntu. You'll have to boot into a live environment (i.e. boot from a USB containing Ubuntu, and click "Try Ubuntu"). – Alaa Ali Jan 05 '14 at 18:10
  • ummm I can mount my database normally (through nautilus), I get no errors. (forget about the other question) – 842Mono Jan 05 '14 at 18:12
  • With Windows 7 installed after Ubuntu, this makes it much more complicated, it would involve moving your Windows 7 install or the Ubuntu install to a new partition. The easiest solution would likely be to resize the data partition(it is recommended to use Windows "Disk Management" software to resize Ntfs partions, can be done with Ubuntu) then you could move your /home to the new partition after the data part. There are good answers here on how to move your home but I will refer you to those as I have never done it myself. home is usually your biggest space hog so moving it should suffice – TrailRider Jan 05 '14 at 18:19
  • oh, do you mean that it's more complicated because windows 7 is between database and ubuntu? @TrailRider – 842Mono Jan 05 '14 at 18:23
  • Yes, if it was not, it would be easier you could just "shrink and move the data part. to the right" which is a long process but safe enough if you have backed it up, moving a OS install can be done with Ubuntu but will involve editing your fstab file so that the part. can be found and fixing Grub which error while looking for Ubuntu at the old part. I think that moving Windows may break the Windows install, but I could be wrong..Windows is fussy about you messing with it's files.... – TrailRider Jan 05 '14 at 18:27
  • hmmm sounds fine to me. ... what about the red exclamation mark? it says that I have to install "ntfsprogs / ntfs-3g" is that right? – 842Mono Jan 05 '14 at 18:32
  • Which is why I suggested moving your /home that will give you all the space that home was taking up and give it to root. You would then have all the space that you allocated in your new part. for your home folder....I have moved my home in a virtual system just to see if it worked by following the asnwers here(sry don't remember which one) and it worked but I have never done it in a real world install so I would not try to guide you thru that. However if you need a step by step guide you could edit your question to ask that instead of how it is currently. – TrailRider Jan 05 '14 at 18:33
  • You if you wanted to but if you can read the partition in Nautilus, I would suspect that this is just an issue with gparted. To change the partition size with gparted you would have to to ensure that it was done correctly, if you use the program installed in Windows it would not matter. Just make sure that however you resize the partition, you use one of your Windows installs to check & repair the filesystem before using it, it will need to be repaired as resizing it throws off the "index" of the partition. – TrailRider Jan 05 '14 at 18:40
  • did you want how much space for / partition and from where? – Avinash Raj Jan 05 '14 at 19:08
  • I want to take it from "database" ... not sure how much yet but that's not important right now, right? – 842Mono Jan 05 '14 at 19:11
  • ...let's say I want to move 50GB from the database to the filesystem (may increase or decrease 10GB) – 842Mono Jan 05 '14 at 19:12
  • @TrailRider I'm done with the exclamation mark. ...do you mean that you want me to merge my 2GB swap with the filesystem? – 842Mono Jan 05 '14 at 19:16
  • no you would leave your swap alone, you would just move your /home folder(the folder with all your user files in it to the end(to the right) of the data part. after you have reduced the size of it...look at the answer below as well, it is a good answer on how to clean up your root part. to make more space. If that gives you enough space, you could just let things as they are for a while, or at least make more free space in your root (/) if you still want to move your /home folder. – TrailRider Jan 06 '14 at 00:36

2 Answers2

3

Most the time I help users with that problem, they don't really miss some space for the system, 20 Gb is large for system files (/). The problem is often that they need to clean useless updates and packages.

Step 1: delete old kernels

If you are using a Ubuntu 12.04 LTS and it is installed for monthes, you have a lot of useless kernels installed with security updates. More, if you are using some restricted drivers for your graphic card, you have too many kernel headers installed. Every kernel and headers take a huge amount of space, and it is usually the cause of lack of your problem.

To do the cleanup more easily, I recommend to install the good old Synaptic package manager. In a terminal:

sudo apt-get install synaptic

Of course, you can do that with Software Center or Aptitude too.

Launch Synaptic, it will ask for your password. In the search tool, type and find linux-image. Select name of the package, not "description".

Then, go at the bottom of the list, keep the two or three latest kernels installed. And going up, right click on older kernels, and select "Mark for complete removal".

Once done, do the same with packages named `linux-headers". Take care to keep the headers coordinate to the images you keep.

Then, click on "Apply" in the top bar of Synaptic. And wait, for it can take some time to remove a lot of old kernels.

Step 2: remove useless packages

The aim is to remove the package your system don't need anymore. This is done with two simple terminal command, for I don't know how to do it with a GUI.

sudo apt-get autoclean

This one removes from local apt-get cache old packages that can not be downloaded anymore. If you want to completely purge that cache, you can instead use sudo apt-get clean.

sudo apt-get autoremove

This one check all dependencies of all packages, and then, automatically remove packages that are not anymore needed by the system or an application. Very useful if you install and removes applications sometimes.

Et voilà !

You should have recover most or your free space.

Please notice that their might be some important amount of data in your system partition:

  • If you have some databases or a webserver running in the background, you might some data in /var/. It might be good to create a separate partition, or to configure the servers to use files in your /home.
  • If you have a lot of Fonts files, it will be in the system partition too.
  • Etc...
ttoine
  • 1,160
1

From the comments op said that he wants 50 GB space from the /dev/sda6 partition and add that space to the /dev/sda7 root partition.

  • In the gparted screenshot,it was clearly shown that there was an exclamatory mark for dev/sda6 ntfs partition which means windows was not fully shutdown.You have to remove the exclamatory mark to resize that ntfs partition.

  • To remove the exclamatory mark,boot into Windows,insert the ubuntu live disk then restart your pc(not shutdown).

  • On the startup press function+Fx key to enter into the bios.

  • Now change the boot-order to ubuntu live disk as first option and save the changes.

  • It will boot from the live-disk,now open gparted.

  • Now the remark for the ntfs partition will be gone.Make sure that no partitions from the /dev/sda disk would be mounted.

  • Right-click on the dev/sda6 and click on Resize/Move option to shrink the space and get out of 50 GB space from that partition.

  • An unallocated space of 50 GB was created just below to the /dev/sda6 partition.Now you have to move the unallocated space to just below to the /dev/sda7 partition so that the size of /dev/sda7 partition will be increased.

  • Right-click on the /dev/sda6 partition and then select Resize/Move option.Now drag the slider to the extreme right so that the unallocated space move above to the sda6 Database partition.

  • Next right-click on the /dev/sda5,and follow above step to move the unallocated space just above to the /dev/sda5 partition.Same operation would be done on the linux-swap partition.

  • Now the unallocated space was just above to the linux-swap and just below to the dev/sda7 root partition.

  • Now right-click on the dev/sda7 partition to increase it's space.That's all.I hope it would be helpful.

Avinash Raj
  • 78,556
  • till now this looks like the most useful answer :D I didn't do it yet because TILL NOW I still can't get rid of this red exc. mark. I don't know what to do about it – 842Mono Jan 08 '14 at 13:00
  • in the gparted partion editor,click on the gparted and then select refresh devices. – Avinash Raj Jan 08 '14 at 13:02
  • the partition has a bad sector. it still detects it after refreshing – 842Mono Jan 08 '14 at 13:04
  • check for the badsectors in that ntfs partition.Did you shutdown windows fully? – Avinash Raj Jan 08 '14 at 13:05
  • see http://askubuntu.com/questions/47700/fix-corrupt-ntfs-partition-without-windows – Avinash Raj Jan 08 '14 at 13:07
  • yes I ran chkdsk on windows and I shut it down and rebooted and shut it down and rebooted again. ... still shows the red mark – 842Mono Jan 08 '14 at 13:07
  • let us discuss here http://chat.stackexchange.com/rooms/11833/room-for-avinash-raj-and-whoever-wants-to-make-company – Avinash Raj Jan 08 '14 at 13:10
  • 1
    ...so I did the partitioning after all! here's how I got rid of my bad sector http://askubuntu.com/questions/403434/removing-a-bad-sector-from-an-ntfs-partition-badblocks-gave-me-an-output-now-w . one thing that's missing from the question is that I should have prepared my windows 7 installation or repair disk because windows wouldn't boot since I moved it. Thank you so much for helping!! I wouldn't have done it without your answer. ... and I want to thank the moderators so much for "helping this question get answers" :P :P of course it's a duplicate!! I wanted a step by step guide!!!! – 842Mono Jan 28 '14 at 02:48