Ubuntu needs more disk space; I don't think I partitioned correctly.

Asked by Dezmo

I installed Ubuntu 9.04 onto my laptop along with Windows Vista. It boots up and functions perfectly, but I cannot save anything or run updates on Ubuntu for lack of disk space. Before Ubuntu, I did not even hear of partitioning, and all I know now is that Ubuntu needs its own partition with at least 20-30 gigs to run. Unfortunately, I don't even have 200 mb free now on the Ubuntu partition. I managed to isolate some unallocated space in GParted from the Windows partition (over 70 gigs) and made it into a primary linux-swap partition. How can I fix this or transfer some unallocated space into Ubuntu so that I can save things and run updates normally? Please let me know if there is any information you need about my computer beforehand in order to help me. (And please keep it dumbed down for a newbie like me! (:)

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Tom
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

try:

sudo apt-get clean

if you mount ntfs using ntfs-3g then you can create a folder on the partition and create a symlink to the ntfs partition so you can run updates.

Dont worry this is very common for people who use disk resizing and this work around is all i can recommend short of reinstalling and partitioning properly.

Revision history for this message
Dezmo (ukamii-of-ice) said :
#2

Let me make sure I get what you mean before I attempt this, because who knows what I could mess up. I ran a terminal and typed in "sudo apt-get clean". Now I should create an NTSF partition with the program NTFS-3G, right? But how do I go about installing the program into Ubuntu? Their website isn't awfully clear about it. (It says that I need to have the "basic development tools" installed first.) How do I do this?

Revision history for this message
Dezmo (ukamii-of-ice) said :
#3

Let me make sure I get what you mean before I attempt this, because who knows what I could mess up. I ran a terminal and typed in "sudo apt-get clean". Now I should create an NTSF partition with the program NTFS-3G, right? But how do I go about installing the program into Ubuntu? Their website isn't awfully clear about it. (It says that I need to have the "basic development tools" installed first.) How do I do this?

Revision history for this message
Dezmo (ukamii-of-ice) said :
#4

Sorry about the double post.

Revision history for this message
Tom (tom6) said :
#5

Well Ubuntu needs about 15Gb to feel comfortable and then is quite happy reading data that's on the Windows side. However Xubuntu needs a lot less space so that might be worth a go?
http://www.xubuntu.org/get

and then install as normal
https://help.ubuntu.com/community/BootFromCD
https://help.ubuntu.com/community/WindowsDualBoot

Good luck and regards from
Tom :)

Revision history for this message
Tom (tom6) said :
#6
Revision history for this message
Dezmo (ukamii-of-ice) said :
#7

I think I will just go with uninstalling Ubuntu, correctly making the partition, and reinstalling it, because even with Xubuntu, I would not have enough space to save anything. How can I uninstall Ubuntu? Thanks in advance!!

Revision history for this message
Tom (tom6) said :
#8

First step is to boot into Windows, get to a command-line and type in "fixmbr" then check that rebooting takes you straight into Windows

Revision history for this message
Tom (tom6) said :
#9

Oh wait did you install inside Windws? Only one option for booting into Ubuntu and no option for memtest?

Revision history for this message
Tom (tom6) said :
#10

In that case try part 4 of this guide

https://wiki.ubuntu.com/WubiGuide

Also it might be worth considering a very tiny version of linux, a fairly recent new release of antiX
http://www.mepis.org/node/14221

Perhaps a little smaller, perhaps faster sliTaz (30Mb)
http://distrowatch.com/table.php?distribution=slitaz
http://distrowatch.com/table.php?distribution=puppy
Puppy is compressed and doesn't have a great package manager so it's a bit less like normal linux's than slitaz but it is very popular and deservedly so

Good luck and regards from
Tom :)

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#11

If your system is a true dual boot system, then you need to mount the NTFS partition using ntfs-3g

a guide is here:
https://wiki.ubuntu.com/ntfs-3g

You can then make a folder on the ntfs partition and run:

sudo mv /var/cache/apt/archives/lock ~/; sudo mv /var/cache/apt/archives/partial ~/; ln -s /mount/point/folder /var/cache/apt/archives; sudo mv ~/lock /var/cache/apt/archives; sudo mv ~/partial /var/cache/apt/archives

obviosly change /mount/point/folder for where you mount the ntfs partition

Revision history for this message
Dezmo (ukamii-of-ice) said :
#12

I managed to make the NTFS partition and create a successful symlink to it by running the "ln -s" command by itself. But when I run "sudo mv /var/cache/apt/archives/lock ~/; sudo mv /var/cache/apt/archives/partial ~/; ln -s /mount/point/folder /var/cache/apt/archives; sudo mv ~/lock /var/cache/apt/archives; sudo mv ~/partial /var/cache/apt/archives" I keep on getting "mv: cannot stat `/var/cache/apt/archives/lock': No such file or directory". I manually went through the directory making sure, and it's all there.

Revision history for this message
Dezmo (ukamii-of-ice) said :
#13

And Tom, thank you very much. I will use your help in case I need it. On a side note, I used the CD to install it.

Revision history for this message
Tom (tom6) said :
#14

Ok, i am really unclear about what you are trying to do and what you want to end up with. AP seems to be building up something quite complicated for Ubuntu and it's unclear what he's trying to create.

70Gb is hugely excessive for linux-swap. Normally a swap needs to be about 2 to 4 Gb but it depends on Ram
https://help.ubuntu.com/community/SwapFaq
To find out your ram open a linux terminal and type

free -m

and this will show the ram memory and the swap space available. Also it would be good if you could run

sudo fdisk -l

note the "-l" is a lower-case "-L" and putting the output from that into here might help us see what's going on with all your partitions except that it doesn't really help tell us how large your partitions are. For that it would be helpful to open gparted and just copy down the sizes beside the results of fdisk. To open Gparted go up to the top taskbar and click on

System - Administration - Partition Editor

I really think that ActionParsnip is making this far too complicated although he is doubtlessly doing something quite amazing, whatever it is. Now that i have re-read your question I think we can fairly easily just re-arrange your partitions a bit to give a lot more room to Ubuntu :)

Good luck and regards from
Tom :)

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#15

No need, just link the folder that stores the deb files for installs/updat

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#16

es to, on a different partition with space

Revision history for this message
Dezmo (ukamii-of-ice) said :
#17

Actionparsnip: I would still need space to do things other than run updates, but I get what you're saying.

Tom: I ran these in the "Try Ubuntu without changes to your computer" (or whatever) with the boot disk, so I could access GParted, just in case it makes a difference. Anyway, I ran free -m and got

                    total used free shared buffers cached
Mem: 937 729 208 0 83 356
-/+ buffers/cache: 289 648
Swap: 73288 0 73288

And then, with running sudo fdisk -l, I got

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x2581e854

   Device Boot Start End Blocks Id System
/dev/sda1 1 1274 10233373+ 7 HPFS/NTFS (Size: 9.76 GiB)
/dev/sda2 * 1275 9810 68565420 7 HPFS/NTFS (Size: 65.39 GiB)
/dev/sda3 19132 19457 2618595 5 Extended (Size: 2.50 GiB)
/dev/sda4 9811 19131 74870932+ 82 Linux swap / Solaris (Size: 71.40 GiB)
/dev/sda5 19132 19435 2441848+ 83 Linux (Size: 2.33 GiB)
/dev/sda6 19436 19457 176683+ 82 Linux swap / Solaris (Size: 172. 54 MiB)

Partition table entries are not in disk order

I made the sad assumption that by making the unallocated space into linux-swap, it would automatically add more disk space to the Linux partition. Never attempting this by myself again!

Revision history for this message
Best Tom (tom6) said :
#18

Hey, don't worry.

The first time is always tough. There's a lot of new stuff to learn about and all the complexity happens before you've had a chance to just use and settle in to linux. In Windows this is all sorted out by teams of experts with years of experience. In linux you install yourself with no prior experience (first time). Next time you'll find it easy, especially because this time has been unusually tough :)

Note that this message "Partition table entries are not in disk order" always appears there even if the partition numbers do happen to be in the order they appear on the disk, which is very rare & unlikely by the way.

To get the most out of this system i would "bite the bullet" and just delete partitions sda6, sda5, sda3 and sda4 to start again. You could do this by resizing but that takes ages and given the current size of sda5 probably wont give you a fully normal Ubuntu at the end of the process. To delete the partitions first right-click on each one and choose "Swap Off" or "umount", then it will allow you to delete. Note this is best done in the reverse order to the order they are placed on the drive although it doesn't usually make much difference - it only gets cranky about that sometimes.

Assuming your Windows isn't Vista then i would probably resize sda2 (your Windows partition (which Windows calls the "C: 'drive'")) to be much larger. If it's Vista then don't touch it in case it freaks out! Then i would set out the partitions like this

sda1 unchanged
sda2 mostly unchanged, see above
sda3 Primary Partition 2.5Gb, 'file-system' = linux-swap
sda4 Extended Partition to fill the remaining drive space. Note it is hollow
 . sda5 Logical Partition 08Gb, file-system = ext3, this will be /
 . sda6 Logical Partition 25Gb, file-system = ext3, this will be /home
 . sda7 Logical Partition 15Gb, file-system = ext3 or fat32, this will be for fun

Note that sda7 is for perhaps for trying out Windows7 but mostly for installing other linux distros and trying them out when you're not busy in Ubuntu ;) I have a couple of partitions at the end of my drive for this sort of thing. Also it can be quite handy for installing something like Ubuntu 9.10-alpha for alpha testing or as a sandbox type area for other things. 15Gb is perhaps too generous. I would normally make sda6 about 15Gb or perhaps even less and just make sda7 a different size so that it's easy to tell them apart from each other. It's important for me to have sda5 quite stable and always usable so sda7 is good for experimenting :) Extended partitions are a bit like a bucket, quite handy for containing a few extra partitions than your hard-drive would otherwise allow (thanks to microsquish). I suggested making the swap slightly larger than the maximum size you'll need because then you wont have that to worry about if you get some more ram for this machine and with Windows on this machine that's often something worth planning for because Windows is really greedy for ram and isn't able to use it as efficiently as linux does. The swap needs to be larger than ram size in case you use hibernate/sleep/suspend mode but usually over 2xRam is unnecessary as it doesn't bring any benefit above that amount.

Ok, this time when you install Ubuntu and get to the "Partitioning Section" (about halfway through the install) choose the bottom of the 3 options, "Manual Partitioning". This is where you edit sda5 to set it's "Mount Point" to "/" and edit sda6 to set it's "Mount Point" to "/home". Note that in the column "Format?" only sda3, sda5, sda6 and maybe sda7 are ticked. Make sure sda1 and sda2 are UNticked! Formatting a partition wipes all the data so it's crucial not to wipe Windows nor the recovery partition.

Ok, that should do it but please feel free to ask for more (or less detail) or suggest a different layout. Linux gives freedom of choice and there are a huge number of different good ways of laying this out. Ultimately there's only 1 'perfect' way and that's your own ;)
Good luck and regards from
Tom :)

Revision history for this message
Tom (tom6) said :
#19

Really don't worry about asking about this. I have learned a lot by trying a lot of ways out myself and making mistakes, seeing what works and what doesn't, reading up loads and also helping other people a lot. i really enjoy dealing with this type of question. It's great to see people completely new to linux getting to grips with it and getting linux onto their system :))
Thanks and regards from
Tom :)

Revision history for this message
Dezmo (ukamii-of-ice) said :
#20

It worked! Thank you so, so much!

Revision history for this message
Dezmo (ukamii-of-ice) said :
#21

Thanks Tom, that solved my question.

Revision history for this message
Tom (tom6) said :
#22

Brilliant :))) Nicely done :))
Now you've done it the hard way this time you'll find it fairly easy to install any linux on any system but here's a cautionary tail
http://forums.wolvix.org/index.php/topic,1040.msg4956.html#msg4956
(getting it to work properly is a different issue)

Welcome to linux-land, especially the Ubuntu corner
Congrats and regards from
Tom :))