1

I have installed Ubuntu in dual boot with Windows 7. Windows 7 (C drive) disk size is 420 GB, Linux drive size is 50 GB. Now I'm facing space problem on Ubuntu. I cannot reinstall any on them and also cannot resize (shrink) the Windows partition.

I am thinking to move some big folders like /opt, /bin, /sbin, /etc, /usr, /lib, /tmp, /home/user/Desktop to some other folder of the Windows drive and create a link for the same in /. Will this affect the linux system in any way like booting, executing commands, starting terminal, running installed apps like Java, Ruby etc? If yes, then what are the other solutions for the same?

7
  • 1
    What is your partitioning scheme? Is /home a separate partition? Apart from /usr, and Desktop, the folders you list are very small, not much point in moving them.
    – terdon
    Jan 7, 2014 at 13:22
  • I guess symlinking folders like that will probably prevent Linux from booting. Why can't you resize Windows partition?
    – gronostaj
    Jan 7, 2014 at 13:25
  • 1
    @gronostaj The only one worth moving is /usr (and /home stuff) and that shouldn't be a problem for booting as long as you have a link to it. Thekosmix, please show us the output of df -h and sudo fdisk -l.
    – terdon
    Jan 7, 2014 at 13:27
  • I second terdon's argument. Additionally you should have a look at /tmp, if there are some huge files left from canceled processes. By FHS definition it is save to delete files in /tmp, because /tmp is often not preserved between system reboots.
    – mpy
    Jan 7, 2014 at 13:36
  • 2
    "...to some other folder of the Windows drive..." Moving root directories or even the home directory to a FAT32/NTFS partition will yield problems with the permissions, which will result in a partly or completely broken system.
    – Bobby
    Jan 7, 2014 at 13:37

2 Answers 2

3

If you have space on your windows partition I would mount it as suggested by AisIceEyes and then soft link your home folder to a folder on the windows mount. You could also do the same with the opt folder where I guess you installed some software.

  1. Start by mounting the windows partition.
  2. Then move your home/user folder to a folder on that partition.
  3. Finalize by soft link that folder as your home folder and you will be back as you where.

Step 1 - Mount windows partition

Use sudo fdisk -l to find out what your disk is named. Normal would be /dev/sda2 on a mixed system but do NOT take my word for it, use fdisk instead.

Use ntfs-3g to mount the partition to a mount point, a mount point is any arbitrary folder that you can create with mkdir.

$ sudo mkdir /mnt/windows               # Create a mount point
$ sudo ntfs-3g /dev/sda2 /mnt/windows   # Mount
$ ls -la /mnt/windows                   # Looks familiar?

Mount permanently

Now that we know that we mounted the correct partition we can make that permanent by entering that into the filesystem tablular file or fstab like this:

$ sudo vim /etc/fstab                   # You can select another editor

Go to the end and enter this row:

/dev/sda2   /mnt/windows    ntfs-3g uid=1000,gid=1000,dmask=027,fmask=137,locale=en_US.utf8 0   2

Restart your system and verify that the partition is mounted as expected. The dmask and fmask sets directory permissions to 750 and files to 640. uid and gid of 1000 would give you the ownership of the directory structure.

Step 2 - Move your files

Create a folder in the windows folder where you can place your user folder. Then move your current user folder there.

$ mkdir /mnt/windows/linux_home
$ mv /home/user /mnt/windows/linux_home/.

Step 3 - Restore your home directory with a soft link

Finalize by linking your home folder to the new path.

$ sudo ln -s /mnt/windows/linux_home/user /home/user`

DONE!

A feature with this approach is that not software-proprietary-formats will be readable in the windows environment also.

1

I would suggest just mounting the Windows NTFS partition to the Linux and work from there.

There was an app called pysdm a few years back but I heard it got deprecated. You can search fstab on mounting the Windows partition.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .