1

I got a "little" problem with my linux server.


Distributor ID: Ubuntu
Description:    Ubuntu 14.04.1 LTS
Release:        14.04
Codename:       trusty

I used the default configuration of my server hoster. At the beginning this configuration fitted perfectly our needs. But now we got a little issue with that and i think that i could not change it.


/dev/sda3       109G   57G   47G  56% /
none            4.0K     0  4.0K   0% /sys/fs/cgroup
udev             16G  4.0K   16G   1% /dev
tmpfs           3.2G  816K  3.2G   1% /run
none            5.0M     0  5.0M   0% /run/lock
none             16G     0   16G   0% /run/shm
none            100M     0  100M   0% /run/user
/dev/sda1       969M   30M  873M   4% /boot
/dev/md0        917G   72M  871G   1% /data

EDIT: Output of 'cat /proc/mdstat'


Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md0 : active raid1 sdc1[1] sdb1[0]
      976760640 blocks super 1.0 [2/2] [UU]
      bitmap: 0/8 pages [0KB], 65536KB chunk

unused devices: 

EDIT: Output of 'sfdisk -l'


Disk /dev/sda: 15566 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start     End   #cyls    #blocks   Id  System
/dev/sda1          0+    127-    128-   1024000   83  Linux
/dev/sda2        127+   1123-    997-   8000512   82  Linux swap / Solaris
/dev/sda3       1123+  15565-  14443- 116007936   83  Linux
/dev/sda4          0       -       0          0    0  Empty

Disk /dev/sdb: 121601 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start     End   #cyls    #blocks   Id  System
/dev/sdb1          0+ 121601- 121602- 976760832   fd  Linux RAID autodetect
/dev/sdb2          0       -       0          0    0  Empty
/dev/sdb3          0       -       0          0    0  Empty
/dev/sdb4          0       -       0          0    0  Empty

Disk /dev/sdc: 121601 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start     End   #cyls    #blocks   Id  System
/dev/sdc1          0+ 121601- 121602- 976760832   fd  Linux RAID autodetect
/dev/sdc2          0       -       0          0    0  Empty
/dev/sdc3          0       -       0          0    0  Empty
/dev/sdc4          0       -       0          0    0  Empty

Disk /dev/md0: 244190160 cylinders, 2 heads, 4 sectors/track

sfdisk: ERROR: sector 0 does not have an MSDOS signature
 /dev/md0: unrecognised partition table type
No partitions found

As you can see we have an /dev/md0 partition of 917 GB. 99% of it arent used. I want to add most of the space to /dev/sda3

Is there an easy way to do it or is this space lost?

Thanks

1
  • Looks to me that 99% is free, not used. But if is where 99% used, looks like your /data filesystem is to hold some important data since it is on a software raid partition, and your sda3 it is just a partition on a simple on a "looks like" no redundant disk so maybe it is not the best idea. You may also want to check if your using LVM, then adding space may be rather easy.
    – Matías
    Dec 1, 2014 at 10:55

3 Answers 3

1

/dev/md0 is a software RAID device which may consume part of the physical space on the SDA disk drive, but most likely consists of two or more other disks. (check /proc/mdstat to confirm the layout). That makes it unlike that the space from there can easily be added to the root file-system.

What probably is sufficient : rather than extending the root file-system, move data from the root file-system to what is now the /data file-system and mount that file-system in place of the largest disk consuming directory from your root file-system, i.e. (if most data is in /home):

# Go to maintenance mode && then:
mv /home/*  /data/
umount /data
mount /dev/md0 /home

And modify /etc/fstab accordingly.

0

A little more info about your raid and partitions would be useful for a complete answer, but if a partition on /dev/sda is part of the md0 raid, you can do the following:

  1. Backup full system.
  2. Move data from /data to a temporary folder on sda3.
  3. Unmount and destroy the md0 raid and its partitions.
  4. Depending on your partition layout, you might now be able to increase the sda3 partition size, and grow your filesystem.
  5. Recreate md0 with the desired size, mount and move the data back :)

If you need more help, you should provide the output of "sfdisk -l" and "cat /proc/mdstat"

-1

If you have LVM enabled, you can extend your LVM volume.

The steps are:

  1. Format /dev/md0 as a primary partition with the LVM (8e) partition type using fdisk
  2. Finding the name of your existing volume group with vgdisplay
  3. Adding the new partition to the existing volume group with vgextend <name of vg> /dev/md0
  4. Extending the logical volume with the newly available space with lvextend -L+917G /dev/sda3
  5. Extending the existing file system with resize2fs /dev/sda3

Source: link

2
  • /dev/sda3 is a native partition and not a logical volume and AFAIK you can't use LVM to extend native partitions...
    – HBruijn
    Dec 1, 2014 at 11:23
  • You're right, sorry. Dec 1, 2014 at 12:18

You must log in to answer this question.

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