A
A
Alexey So2015-05-01 16:38:55
linux
Alexey So, 2015-05-01 16:38:55

How to mount a hard drive on a partition of another hard drive?

There is a 128 GB SSD drive - it runs CENTOS and a web verser.
The /home folder is not enough for websites.
I inserted a 1TB disk - can I increase the home partition with a new disk? if so, how? Tell me please.
df -h command

Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
                       50G  8,6G   39G  19% /
tmpfs                 3,9G     0  3,9G   0% /dev/shm
/dev/sdb1             477M   63M  389M  14% /boot
/dev/mapper/VolGroup-lv_home
                       64G   42G   2G  97% /home

The output of the fdisk -l command
Диск /dev/sda: 1000.2 ГБ, 1000204886016 байт
255 heads, 63 sectors/track, 121601 cylinders
Units = цилиндры of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Диск /dev/sdb: 128.0 ГБ, 128035676160 байт
255 heads, 63 sectors/track, 15566 cylinders
Units = цилиндры of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00048110

Устр-во Загр     Начало       Конец       Блоки   Id  Система
/dev/sdb1   *           1          64      512000   83  Linux
Раздел 1 не заканчивается на границе цилиндра.
/dev/sdb2              64       15567   124521472   8e  Linux LVM

Диск /dev/mapper/VolGroup-lv_root: 53.7 ГБ, 53687091200 байт
255 heads, 63 sectors/track, 6527 cylinders
Units = цилиндры of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Диск /dev/mapper/VolGroup-lv_swap: 4110 МБ, 4110417920 байт
255 heads, 63 sectors/track, 499 cylinders
Units = цилиндры of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Диск /dev/mapper/VolGroup-lv_home: 69.7 ГБ, 69709332480 байт
255 heads, 63 sectors/track, 8475 cylinders
Units = цилиндры of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Answer the question

In order to leave comments, you need to log in

6 answer(s)
M
Melkij, 2015-05-01
@mayhembr

Lord, what are you talking about? The system after all obviously costs on LVM. The device is called /dev/mapper/ VolGroup - lv _home A
banal expansion of space due to a new disk is an elementary action. xgu.ru/wiki/LVM
But then the meaning of SSD becomes mysterious, in this I agree with Denis Verbin

D
Denis Verbin, 2015-05-01
@rez0n

Something much dofiga allocated to the root /
10-15GB is usually enough.
You can mount it instead of /home and move all sites there, but in this case, the whole point of ssd is lost.
I would put only "thick" folders of sites on the HDD with symlinks, for example, with uploads.

A
Andrey Myvrenik, 2015-05-01
@gim0

How to mount a hard drive on a partition of another hard drive?

You can mount anything anywhere. Create a directory, and mount a new disk there.
Let's say if you have /dev/sdX1 mounted to /home, you can create any directory in /home:
And then mount /dev/sdY1 there:
Now the contents of the /home/something directory will reflect the contents of the /dev/sdY1 partition
You cannot physically expand a partition using another disk.

N
Nazar Mokrinsky, 2015-05-01
@nazarpc

The /home folder is not enough for websites.

I guess mount a new drive to where the sites are and transfer the data to it.
You can’t do it right like this, unless you are using BTRFS, you can convert it to RAID there, and attach another disk on the fly. And so you need to configure software RAID between two partitions, if you don’t want to mess with BTRFS (although everything is generally trivially solved with it) - try mdadm, though I don’t know how the latter will react to different sizes.
In general, it seems that your main disk is small, just mount a new one in / home and that's it. These are:
0) stop the webserver or whatever your /home is using
1) format the new drive
2) mount the new drive somewhere
3) transfer /home data to the new drive
4) rename /home to something, create an empty one /home
5) unmount the new drive
6) set /etc/fstab to mount a new disk in /home
7) mount -a
8) everything, you can run it back

A
Alexey So, 2015-05-02
@mayhembr

Thanks for the tip, I'm solving the problem!

S
ShamblerR, 2015-05-13
@ShamblerR

everything is elementary simply
1. copy all /home to a new screw.
2. /etc/fstab/
/dev/sdd /home ext4 defaults 0 0

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question