I currently have two OS: Windows and Ubuntu. The fact is that now it took to increase the size of the space of my Ubuntu OS. And actually the question is how painlessly this can be done in order not to damage the files.

There is an idea: in Windows, again, take the required amount of space from the D drive, say, I have it not system) and try to increase the disk on which Ubuntu costs. Will this kind of adventure?

lsblk NAME MAJ: MIN RM SIZE RO TYPE MOUNTPOINT sda 8: 0 0 931.5G 0 disk
S─sda1 8: 1 0 500M 0 part / boot / efi ├─sda2 8: 2 0 40M 0 part
S─sda3 8: 3 0 128M 0 part
S─sda4 8: 4 0 750M 0 part
S─sda5 8: 5 0 469.9G 0 part
S─sda6 8: 6 0 403.7G 0 part
S─sda7 8: 7 0 41.2G 0 part / ├─sda8 8: 8 0 450M 0 part
S─sda9 8: 9 0 7.2G 0 part
S─sda10 8:10 0 7.6G 0 part
C─cryptswap1 252: 0 0 7.6G 0 crypt [SWAP]

mount sysfs on / sys type sysfs (rw, nosuid, nodev, noexec, relatime) proc on / proc type proc (rw, nosuid, nodev, noexec, relatime) udev on / dev type devtmpfs (rw, nosuid, relatime, size = 4024576k, nr_inodes = 1006144, mode = 755) devpts on / dev / pts type devpts (rw, nosuid, noexec, relatime, gid = 5, mode = 620, ptmxmode = 000) tmpfs on / run type tmpfs (rw, nosuid, noexec, relatime, size = 808836k, mode = 755) / dev / sda7 on / type ext4 (rw, relatime, errors = remount-ro, data = ordered) securityfs on / sys / kernel / security type nodev, noexec, relatime) tmpfs on / dev / shm type tmpfs (rw, nosuid, nodev) tmpfs on / run / lock type tmpfs (rw, nosuid, nodev, noexec, relatime, size = 5120k) tmpfs on / sys / fs / cgroup type tmpfs (ro, nosuid, nodev, noexec, mode = 755) cgroup on / sys / fs / cgroup / systemd type cgroup (rw, nosuid, nodev, noexec, relatime, xattr, release_agent = / lib / systemd / systemd -cgroups-agent, name = systemd) pstore on / sys / fs / pstore type pstore (rw, nosuid, nodev, noexec, relatime) efivarfs on / sys / firmware / efi / efivars type efivarfs (rw, nosuid , nodev, noexec, relatime) cgroup on / sys / fs / cgroup / hugetlb type cgroup (rw, nosuid, nodev, noexec, relatime, hugetlb) cgroup on / sys / fs / cgroup / blkio type cgroup (rw, nosuid, nodev , noexec, relatime, blkio) cgroup on / sys / fs / cgroup / net_cls, net_prio type cgroup (rw, nosuid, nodev, noexec, relatime, net_cls, net_prio) cgroup on / sys / fs / cgroup / cpuset type cgroup (rw , nosuid, nodev, noexec, relatime, cpuset) cgroup on / sys / fs / cgroup / cpu, cpuacct type cgroup (rw, nosuid, nodev, noexec, relatime, cpu, cpuacct) cgroup on / sys / fs / cgroup / perf_e, cpuacct type cgroup (rw, nosuid, nodev, noexec, relatime, perf_event) cgroup on / sys / fs / cgroup / devices type cgroup (rw, nosuid, nodev, noexec, relatime, devices) cgroup on / sys / fs / cgroup / pids type cgroup (rw, nosuid, nodev, noexec, relatime, pids) cgroup on / sys / fs / cgroup / memory type cgroup (rw, nosuid, nodev, noexec, relatime, memory) cgroup on / sys / fs / cgroup / freezer type cgroup (rw, nosuid, nodev, noexec, relatime, freezer) systemd-1 on / proc / sys / fs / binfmt_misc type autofs (rw, relatime, fd = 24, pgrp = 1, timeout = 0, mi nproto = 5, maxproto = 5, direct) mqueue on / dev / mqueue type mqueue (rw, relatime) debugfs on / sys / kernel / debug type debugfs (rw, relatime) hugetlbfs on / dev / hugepages type hugetlbfs (rw, relatime ) fusectl on / sys / fs / fuse / connections type fusectl (rw, relatime) / dev / sda1 on / boot / efi type vfat (rw, relatime, fmask = 0077, dmask = 0077, codepage = 437, iocharset = iso8859- 1, shortname = mixed, errors = remount-ro) binfmt_misc on / proc / sys / fs / binfmt_misc type binfmt_misc (rw, relatime) tmpfs on / run / user / 1000 type tmpfs (rw, nosuid, nodev, relatime, size = 808836k, mode = 700, uid = 1000, gid = 1000) /home/.ecryptfs/morozov/.Private on / home / morozov type ecryptfs (rw, nsuid, nodev, relatime, ecryptfs_fnek_sig = d8c962395ff64430, an asp, usrypfs_fnek_sig = d8c962395ff64430, an asp, efs, idr, nvuidp aes, ecryptfs_key_bytes = 16, ecryptfs_unlink_sigs) gvfsd-fuse on / run / user / 1000 / gvfs type fuse.gvfsd-fuse (rw, nosuid, nodev, relatime, user_id = 1000, group_id = 1000)

  • Will go. but first, start the fragmentation on disk D It is not necessary for /home to be on the same volume as / . so for the future, you can separate /home from the main volume - Senior Pomidor
  • What file system was chosen when installing Ubuntu? Did you put LVM? It is necessary to supplement the issue with the output of the "lsblk" and "mount" commands. - Tihon
  • You need to boot from the LiveCD, run gParted and expand the volume. perhaps new OSs can change volume size on the fly - Senior Pomidor
  • @Tihon / dev / sda1 vfat 507904 29752 478152 6% / boot / efi not sure what this is that you specified. - Morozov
  • @SeniorAutomator, that is, in other words, when I move / home to another partition, I still have everything, the only thing that my OS will be on another disk? or I do not quite understand. - Morozov

3 answers 3

First, save the data you need.

  1. Defragment section
  2. boot from LiveCD
  3. Run gparted
  4. Select a disk and change the size (right -> resize)
  5. Click apply and wait for the process to complete.
  6. reboot without LiveCD
  • one
    For LVM - does not work: P For ext4 / XFS - you can increase the size directly in ubuntu and without rebooting. - Tihon

With such actions there is always the possibility of data loss - make a backup copy.

In Windows.

  1. Doing disk defragmentation.
  2. Open from admin "diskmgmt.msc"
  3. Choose the desired volume. Right-click on it - shrink the volume. Squeeze to the right size.

In Ubuntu.

  1. In the root / sudo terminal: "apt-get update && apt-get install -y gparted".
  2. From root / sudo: gparted.
  3. Move the sections sda5, sda6, sda7 so that there is no unallocated space after the section sda7 (we will expand it). Apply.
  4. Expanding section sda7. Apply.
  5. PROFIT.

    After reading the answers, I tried to start solving the problem.

    So, in order:

    1. Went to Windows - disk management.
    2. I chose a disk that could be compressed. Squeezed it to the size I needed.

    Next steps:

    1. I went to the Ubuntu OS terminal, registered sudo su to get root.

    2. then I used the apt-get update && apt-get install -y gparted command.

    After that, gparted itself was launched, which clearly showed the layout of my disks. Alas, if your free space is located to the left of the repository that you want to increase, then nothing will come of it. And the maximum resize will be equal to the initial volume of the repository.

    Therefore, writing to a LiveCD flash drive (no matter which version *) and going to the installer, again installed gparted. After that, it was possible to transfer my repository from the OS to a free space (which was previously allocated).

    Everything seems to be how it happened and nothing flew away.

    Completed this answer , there may be special cases, like mine.

    • If free space to the left of the section, then you need to move the section. Everything is possible :) - Tihon
    • @Tihon Hmm, did not find a similar option. - Morozov