I am really uncertain if this is possible or how I would go about fixing this problem.

Filesystem      Size  Used Avail Use% Mounted on
udev             14G   12K   14G   1% /dev
tmpfs           2.8G  388K  2.8G   1% /run
/dev/sda1        30G   26G  2.6G  91% /
none            4.0K     0  4.0K   0% /sys/fs/cgroup
none            5.0M     0  5.0M   0% /run/lock
none             14G     0   14G   0% /run/shm
none            100M     0  100M   0% /run/user
/dev/sdb1       394G   54G  321G  15% /mnt

It appears I have sufficient space on /dev/sdb1 but i don't have enough space on /dev/sda1. Is it possible to move gigabytes from sdb1 to sda1?

  • can you provide info about what filesystems are mounted on those block devices? also for sake of couriosity, what are those ** in **/dev/sda – humanityANDpeace Mar 16 '17 at 20:44
  • I just mean to bold that line. They are gone now. How do i go about getting what filesystems are mounted on those block devices? – Supplement Mar 16 '17 at 21:12
  • /dev/sdX ( "X" is a character, e.g. a, b, c...) - this represents a block device (it could be HDD, SSD or other storage device)
  • /dev/sdXN (/dev/sda1 and /dev/sdb1 in your df-command output) - this represents specific partition on /dev/sdX device.

You cannot move "physical" storage space (sectors, GB...) between different storage devices.

Below information is based on assumptions. Please keep this in mind.

I believe your actual requirement is to have free space in your "/" mount point. You can achieve this in different ways. The most simple is to move part of your data from /dev/sda1 to /dev/sdb1...

In my opinion it is a good idea to move "user" data from /dev/sda1 to /dev/sdb. Most probably your /home directory is located on /dev/sda1.

  1. Backup your /dev/sda1 and /dev/sdb1 volumes!
  2. Use partitioning tool to shrink your /dev/sdb1. For example you can use gparted. You need to free enough space for your /home directory, including your future needs.
  3. Add new partition (/dev/sdb2). Format it using the same file system type as /dev/sda1 has. This will ensure that you'll be able store all your data from /home correctly (including access rights, etc.). (Actually "almost all" - if your /home contains hardlinks to other files, which are not located in /home you wont be able to keep them as hardlinks. All hardlinks must be placed in one file system.)
  4. Copy all your data from your current /home directory to /dev/sdb2. You may choose different tools, for example - rsync, or cp (both with appropriate options).
  5. Remove all contents from /home directory.
  6. Mount /dev/sdb2 on /home. You can make your system perform automount during boot. Please see your distribution's documentation for more details.

ATTENTION: Please remember to backup all your data from /dev/sda and /dev/sdb before any manipulations.

-- UPD: "How do i go about getting what filesystems are mounted on those block devices?" See blkid, mount or sudo parted -l output.

| improve this answer | |

I think the most data is in the home directory (?) Mount /dev/sdb1 as /home partition. Move old home to new home. (Or change each users home dir with usermod -d user to /mnt/home/user and move files ...)

| improve this answer | |

Taking the question as written, it's impossible to move gigabytes of space from one physical device to another. The devices being:

Filesystem      Size  Used Avail Use% Mounted on

/dev/sda1        30G   26G  2.6G  91% /
/dev/sdb1       394G   54G  321G  15% /mnt

...since /dev/sda and /dev/sdb end with different letters, they are probably distinct physical devices, and it can't be done.

However, one can move files from /dev/sda1 to /dev/sdb1. Suppose /dev/sda1 contains a 20G file /home/user/foo.bar. Executing mv /home/user/foo.bar /mnt/foo.bar would make the free space look like this:

Filesystem      Size  Used Avail Use% Mounted on

/dev/sda1        30G    6G 22.6G  20% /
/dev/sdb1       394G   74G  301G  19% /mnt
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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