Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've got a ubuntu 11.10 which has lost its support in May 2013, now I'd like to reintall up to the most up-to-date LTS, which is 12.04. My question is regarding my current partitions and doing backups. Is there a safe way to backup my data on some local partitions instead of copying files into DVDs/external drives (this is very uncormortable in my situation). Following are system commands shoing my disk:

$ lsblk
NAME   MAJ:MIN RM   SIZE RO MOUNTPOINT
sda      8:0    0 232,9G  0 
├─sda1   8:1    0  48,8G  0 
├─sda2   8:2    0    63G  0 
├─sda3   8:3    0     1K  0 
├─sda4   8:4    0  53,7G  0 /
├─sda5   8:5    0  18,6G  0 
├─sda6   8:6    0  25,5G  0 
└─sda7   8:7    0  23,3G  0 [SWAP]
sr0     11:0    1  1024M  0

and

$ sudo fdisk -l
[sudo] password for xyz: 

Disk /dev/sda: 250.1 GB, 250059350016 bytes
głowic: 255, sektorów/ścieżkę: 63, cylindrów: 30401, w sumie sektorów: 488397168
Jednostka = sektorów, czyli 1 * 512 = 512 bajtów
Rozmiar sektora (logiczny/fizyczny) w bajtach: 512 / 512
Rozmiar we/wy (minimalny/optymalny) w bajtach: 512 / 512
Identyfikator dysku: 0xc3ffc3ff

Device    Boot  Beginning   End          Blocks     ID  System
/dev/sda1   *        2048   102402047    51200000    7  HPFS/NTFS/exFAT
/dev/sda2       215044096   347080703    66018304    7  HPFS/NTFS/exFAT
/dev/sda3       347082750   488392064    70654657+   5  Extended
/dev/sda4       102402048   215042047    56320000   83  Linux
/dev/sda5       395905923   434975939    19535008+  83  Linux
/dev/sda6       434976003   488392064    26708031   83  Linux
/dev/sda7       347082752   395905023    24411136   82  Linux swap / Solaris

In the beginning I had Windows Vista pre-installed with the machine when it was bought (damn!) and I installed linux (the one I have now). The windows-program in master boot record has been overriden by grub and now I can boot with both Windows and Linux.

This is list of mounted devices:

$ mount
/dev/sda4 on / type ext4 (rw,errors=remount-ro,commit=0)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /home/tomasz/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=tomasz)

It's strange (I don't remember such thing) that my current linux uses only one partition (/dev/sda4). But, anyway, it seems like that.

My final question is: am I able to use one of the existing linux partitions for a backup and install ubuntu 12.04 without removing neither windows nor ubuntu 11.04? I mean - will grub automatically accept both old windows vista and 2 linuxes (old 11.10 and "new" 12.04)? Is there any hidden operation done while installation that could harm my custom-backup-partition while installing?

my fstab file:

proc            /proc           proc    nodev,noexec,nosuid 0       0
# / was on /dev/sda4 during installation
UUID=d44e89f5-9da2-48eb-83b3-887652ec95d2 /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda7 during installation
UUID=bbe50535-ba57-434a-9272-211d859f0e00 none            swap    sw              0       0

sda5 and sda6 are trash partitions created during unsuccessful linux installation (this was linux installation before my current installation), I didn't delete these partitions, but I have access to them (and I can use them as backup partitions).


edit: second question is: why does lsblk show /dev/sda having 232,9G while fdisk shows that it has 250.1GB? Where does the difference come from?

share|improve this question
    
What's on sda5 and sda6? You mention custom backup partition, do you already keep backups on one of those partitions? What do you have in your /etc/fstab file? That file may shed light on those two partitions if you're not sure about them. –  Matrix Mole Nov 11 '13 at 9:01
    
@MatrixMole thanks fr your interest, I have updated my question –  tkoomzaaskz Nov 11 '13 at 9:59
    
Why not simply upgrade to 12.04? It would keep all your data and programs intact. –  gronostaj Nov 11 '13 at 10:57
    
I have updated my answer to reply to your second question. –  MariusMatutiae Nov 11 '13 at 11:08
    
@gronostaj I have very bad experience with updating ubuntu versions. Tried it few times so far and I had to reinstall everything from scratch... –  tkoomzaaskz Nov 11 '13 at 15:30

3 Answers 3

up vote 4 down vote accepted

You may have a much easier solution at hand.

Your swap partition is 23.3 GiB (output of lsblk)! I believe this is really too much. An old rule of thumb used to be that you needed as much swap space as your RAM. Given the ability of modern systems to manage RAM, even that is considered too much nowadays, so that you should stick to at most as much swap space as you have RAM.

This would free quite a large chunk of disk (I may venture to surmise 19GiB, but this is only a guess). If I am right, then the easiest thing is to install your new Ubuntu in the new partition obtained from the re-sizing of the swap partition, putting there only your / directory. The partition where your Ubuntu 11.10 is currently hosted, sda4, can then (i.e., after successful installation of Ubuntu 12.04) be emptied of all system-related stuff, and your home directory would remain completely unaffected.

Answer to the question:

edit: second question is: why does lsblk show /dev/sda having 232,9G while fdisk shows that it has 250.1GB? Where does the difference come from?

The difference comes from the fact that lsblk uses the new units, GiB, (read GibiBytes) while fdisk, an older utility, uses GB. You must remember that:

 1 GiB = (1024)^3 bytes = 1.073741824 GB

Thus

 250 GB = 250 * 10^9 /(1024)^3 GiB = 232.830... GiB

See the section "understanding disk measurements" in this Web page.

share|improve this answer
    
yes I did, sorry. –  MariusMatutiae Nov 11 '13 at 10:41
    
Just one more question - if I try to install ubuntu 12.04 on the freed partition (which used to be large swap) - can something go wrong and break my current 11.10 installation or break grub so that it doesn't load my current system? –  tkoomzaaskz Nov 11 '13 at 15:33
    
It is possible, but not to worry. From the live cd/USB (whichever you use) download Boot-repair, following the instructions from this web page help.ubuntu.com/community/Boot-Repair You may then follow the same instructions in there to fix your grub, normally this is quite enough. Keep in mind that something can go wrong no matter where you install Ubuntu, Murphy's law.... –  MariusMatutiae Nov 11 '13 at 15:41

You can back up to any partition that has sufficient free space; however, that will protect you from only a small subset of potential risks. For instance, if you accidentally create an entirely new partition table when upgrading Ubuntu, backups to the same disk will be useless. I strongly urge you to back up to an external medium. If this is inconvenient for some reason, invest in the hardware and/or knowledge to make it convenient. This will be beneficial not just now, but in the future; disks can and do fail, both physically and because of software problems (bugs, human error, etc.).

share|improve this answer

Yes, One way is :

you can use the backup application that comes with Ubuntu and set the back up location to sda5 or sda6. Otherwise you can directly copy and paste your required files onto those locations. During 12.04 installation format only root partition(/dev/sda4) and no need to allocate 23.3G to swap partition. it is recommended to allocate swap size as twice of RAM size.

Another way is :

Simply you can officially upgrade from 11.10 to 12.04 through Update manager. Thus your data and installed software will be preserved and your OS will upgraded to 12.04.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.