-1

I have a Linux dedicated server, I need a way more space, like 500G. I see that there is only 4G in my filesystem. I found an article to increase size Logical Volume from this article https://help.1and1.com/servers-c37684/dedicated-server-linux-c37687/administration-c37694/increase-the-size-of-the-logical-volume-a756168.html (I'm on 1and1)

So here is what I did:

first of all I have two file systems mounted on one directory, for some reason and umount command doesn't work

[root@u17669867 ~]# df -h
Filesystem           Size  Used Avail Use% Mounted on
/dev/md1             4.0G  2.7G  1.4G  67% /
/dev/mapper/ssd-var  4.0G  2.7G  1.4G  67% /

[root@u17669867 ~]# fdisk -l
Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
81 heads, 63 sectors/track, 382818 cylinders
Units = cylinders of 5103 * 512 = 2612736 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x4dfb2370

Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1      382819   976761560   fd  Linux raid autodetect

Disk /dev/sdb: 240.1 GB, 240057409536 bytes
255 heads, 63 sectors/track, 29185 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xb322c93e

Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         523     4194304   fd  Linux raid autodetect
Partition 1 does not end on cylinder boundary.
/dev/sdb2             523         784     2097152   82  Linux swap / Solaris
Partition 2 does not end on cylinder boundary.
/dev/sdb3             784       29186   228138584   fd  Linux raid autodetect
Partition 3 does not end on cylinder boundary.

Disk /dev/sdd: 1000.2 GB, 1000204886016 bytes
81 heads, 63 sectors/track, 382818 cylinders
Units = cylinders of 5103 * 512 = 2612736 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x8c756b43

Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1      382819   976761560   fd  Linux raid autodetect

Disk /dev/sda: 240.1 GB, 240057409536 bytes
255 heads, 63 sectors/track, 29185 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x26616fe2

Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1         523     4194304   fd  Linux raid autodetect
Partition 1 does not end on cylinder boundary.
/dev/sda2             523         784     2097152   82  Linux swap / Solaris
Partition 2 does not end on cylinder boundary.
/dev/sda3             784       29186   228138584   fd  Linux raid autodetect
Partition 3 does not end on cylinder boundary.

Disk /dev/md3: 233.6 GB, 233613819904 bytes
2 heads, 4 sectors/track, 57034624 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/md1: 4294 MB, 4294901760 bytes
2 heads, 4 sectors/track, 1048560 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/md11: 1000.2 GB, 1000203747328 bytes
2 heads, 4 sectors/track, 244190368 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/hdd-data: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders 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


Disk /dev/mapper/ssd-usr: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders 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


Disk /dev/mapper/ssd-var: 15.0 GB, 15032385536 bytes
255 heads, 63 sectors/track, 1827 cylinders
Units = cylinders 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


Disk /dev/mapper/ssd-home: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders 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

Here I see how many Phisical Volumes I have

[root@u17669867 ~]# pvs
PV         VG   Fmt  Attr PSize   PFree
/dev/md11  hdd  lvm2 a--  931.51g 927.51g
/dev/md3   ssd  lvm2 a--  217.57g 195.57g

Here I try to add some space, for example 10G to the disk, which I'm using

[root@u17669867 ~]# lvextend -L +10 /dev/md1
Path required for Logical Volume "md1"
Please provide a volume group name
Run `lvextend --help' for more information.
[root@u17669867 ~]#

But I'm not a professional, and I'm not sure where to add space... As long as my web content will be stored in /var/www/ directory. So probably I have to mount a disk to that directory, because as I see from here:

[root@u17669867 /]# df -h
Filesystem           Size  Used Avail Use% Mounted on
/dev/md1             4.0G  2.7G  1.4G  67% /
/dev/mapper/ssd-var  4.0G  2.7G  1.4G  67% /

Nothing is mounted to /var

Please, assist me if possible.

1
  • Ask your sysadmin, or if you don't have one, get a consultant in. Resizing file systems on top of LVM on top of MD RAID can go quite badly wrong if you don't know what you're doing.
    – MadHatter
    Jul 26, 2014 at 8:07

1 Answer 1

1

You have an "md11" disk which probably means you got software raid on the box. Good news is that you got a lot of space 1T on the main disk 256GB on the SSD drive.

You should paste your fstab, the output of lvs and the output of mount.

Easiest way to solve your space problem would be

lvcreate -L 10G -n var_www hdd
mkfs.ext4 /dev/mapper/hdd-var_www

Add the the following line to the fstab : /dev/mapper/hdd-var_www /var/www ext4 defaults 0 1

And type mount /var/www to check you edited the fstab is edited correctly.

Alternatively if the output of lvs and mount confirm that your slash is on an lv, you can type

 lvextend -L +10G /dev/mapper/<vg-lvname>

and use the filesystem tools command corresponding to the fs in order to increase the fs size to the paritition size, for ext2,3,4 it would be

 resize2fs /dev/mapper/<vg-lvname>

You must log in to answer this question.

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