1

My PC dual boots Ubuntu and Windows 7. Ubuntu was installed into a small partition of only 88 GB and i want at least 500 GB for Ubuntu. The boot drive has a

Windows partition of 200 GB
a program partition of 630 GB
and an Ubuntu partition of 88 GB.

Can I reinstall Ubuntu and resize it?

If not, can I install Ubuntu on my other 2 TB drive and still dual boot easily? Is it just to partition to not let Ubuntu to take up all the space on the 2 TB drive on installation? If so, how?

Disk /dev/sda: 1,8 TiB, 2000398934016 byte, 3907029168 sektorer
Disketikettstyp: dos
Diskidentifierare: 0x7893b811

Enhet      Start     Början     Slutet   Sektorer Storlek Id Typ
/dev/sda1              2048 2708940799 2708938752    1,3T  7 HPFS/NTFS/exFAT
/dev/sda2        2708940800 3907028991 1198088192  571,3G 83 Linux


Disk /dev/sdb: 931,5 GiB, 1000204886016 byte, 1953525168 sektorer
Disketikettstyp: dos
Diskidentifierare: 0x96aeb6b8

Enhet      Start     Början     Slutet   Sektorer Storlek Id Typ   
/dev/sdb1  *           2048     206847     204800    100M  7 HPFS/NTFS/exFAT   
/dev/sdb2            206848  409602047  409395200  195,2G  7 HPFS/NTFS/exFAT   
/dev/sdb3         409602048 1743804415 1334202368  636,2G  7 HPFS/NTFS/exFAT    
/dev/sdb4        1743806462 1953523711  209717250    100G  5 Utökad    
/dev/sdb5        1743806464 1928364031  184557568     88G 83 Linux   
/dev/sdb6        1928366080 1953523711   25157632     12G 82 Linux växling / Solaris   


Disk /dev/sdc: 57,7 GiB, 61907927040 byte, 120913920 sektorer
Disketikettstyp: dos
Diskidentifierare: 0x5a2b4c5e

Disk /dev/mapper/cryptswap1: 1,8 GiB, 1872232448 byte, 3656704 sektorer

Disk /dev/mapper/cryptswap2: 12 GiB, 12880183296 byte, 25156608 sektorer

I have already made a new ext4 partition, mounted it in /mnt, and started copying the /home directory with sudo rsync -avx /home/ /mnt (didn't think you were going to help me this much) but the drive doesn't show up?

output of lsblk  (loop and ROM devices removed)

NAME           MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda              8:0    0   1,8T  0 disk  
├─sda1           8:1    0   1,3T  0 part  
├─sda2           8:2    0 569,6G  0 part  /mnt
└─sda3           8:3    0   1,8G  0 part  
  └─cryptswap1 253:0    0   1,8G  0 crypt [SWAP]
sdb              8:16   0 931,5G  0 disk  
├─sdb1           8:17   0   100M  0 part  
├─sdb2           8:18   0 195,2G  0 part  
├─sdb3           8:19   0 636,2G  0 part  
├─sdb5           8:21   0    88G  0 part  /
└─sdb6           8:22   0    12G  0 part  
  └─cryptswap2 253:1    0    12G  0 crypt [SWAP]
sdc              8:32   1  57,7G  0 disk  
K7AAY
  • 17,705
sluxx
  • 13
  • 5

1 Answers1

1

Can I reinstall Ubuntu and resize it? Yes, you can.

HOWEVER, there's a simpler and safer solution. You can move just part of your Ubuntu filesystem to the 2 TB drive, without reinstalling either Ubuntu or Windows. This eliminates the chance of making a mistake in the process.

There's an ideal standard for Linux directories, the Filesystem Hierarchy Standard (more). You can see that if you go to the root directory of your Ubuntu drive with the Files app.

/ (AKA root)
/bin
/boot
/dev
/etc
/home
/lib, /lib64, /lib32
/media
/mnt
/opt
/sbin
/srv
/tmp
/usr
/var

Unlike Windows which likes to put everything on C:, Linux makes it easy to put those different parts of the filesystem on different partitions, even different drives.

The simplest (and default) Linux installation is to put everything under / (the 'root', the top level directory). That's what you normally get when you install.

Now, you can easily copy everything from /home to a new Linux (ext4) partition you make on your 2TB drive, which you can size as you wish with gparted, and resize later if you need to.

Why /home? It's the directory which is most likely to grow.

After copying /home from the smaller drive to the 2 TB drive, you verify everything arrived OK, then tell Ubuntu to look for /home on the 2TB drive now, then erase the old home files on the smaller drive.

Voila! You've now expanded Ubuntu's drive space without a reinstall! Once you move /home off your boot drive, you will have a lot of room for expansion of the other bits of Ubuntu, but if you need to move more directories off the smaller drive, that's also easy to do.

STEP BY STEP

0) Make a list of your drives and their partitions the way they are now from a Ubuntu Terminal window with sudo fdisk -l. Then, click on the edit link under your original question, and paste the results you copy from that terminal into your original question, so we can double check what's going on.

1) With the gparted program which comes with Ubuntu, choose the 2 TB drive (maybe it's /dev/sdb? Sometimes it's different; make sure you've got the right drive!).

The block in the orange box shows which drive you're looking at; the blue tab button shows you all available drives and lets you change the drive. When you start gparted, it will start with your system drive, probably /dev/sda, so you will need to change drives.

gparted screen

2) Resize the partition(s) on the 2TB drive and make a new ext4 type partition for Ubuntu's home. How big? Well, how big is your /home right now? In step 0 above, we found out, or you can open the Files app which comes with Ubuntu. Multiply that size by five or ten.

It's important to make one change at a time with gparted. You have to make room for your new ext4 partition for your new /home, before you can create it. Choose where you will put it, shrink the partition which is there now, then click on the check mark at upper center (in the purple circle in the picture) to actually go ahead and make the change.

Once you have made space, then you can create the new ext4 partition for your new /home; right-click on unassigned space, and create a new partition with type Primary, name /home, filesystem ext4, label /home, and click on the checkmark.

3) When through repartitioning, close gparted and get back to a Terminal, to run sudo lsblk which will show us more info we will need soon. Again, click on the edit link under your original question, and paste the results you copy from that terminal into your original question, so we can double check what's going on.

SPEED BUMP

We stop here before outlining the next steps ( copying everything from your original /home to the 2 TB drive, checking to make sure it's AOK, then making that your new /home, and deleting the old files in the old /home) because a review of your drives and partitions is a VERY good idea before moving on!

K7AAY
  • 17,705