3

I notice today that my /dev/md1/ is almost full:

Filesystem            Size  Used Avail Use% Mounted on
/dev/md1               10G  8.7G  798M  92% /
tmpfs                 7.8G     0  7.8G   0% /lib/init/rw
udev                   10M  172K  9.9M   2% /dev
tmpfs                 7.8G  4.0K  7.8G   1% /dev/shm
/dev/md2              921G   15G  861G   2% /home

And I've no idea how to extend the size of /dev/md1

Here is the result of the mdadm --detail /dev/md1 command

dev/md1:
    Version : 0.90
  Creation Time : Wed Jun 20 14:16:31 2012
     Raid Level : raid1
     Array Size : 10485696 (10.00 GiB 10.74 GB)
  Used Dev Size : 10485696 (10.00 GiB 10.74 GB)
   Raid Devices : 2
  Total Devices : 2
Preferred Minor : 1
    Persistence : Superblock is persistent

Update Time : Tue Jul 10 19:25:07 2012
      State : clean 
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

   UUID : 27f5d8a6:64c191ab:a4d2adc2:26fd5302
 Events : 0.6

Number   Major   Minor   RaidDevice State
   0       8        1        0      active sync   /dev/sda1
   1       8       17        1      active sync   /dev/sdb1

Also, /dev/md1 is full because of mysql. I don;t know if it's possible but moving mysql to another partition could be a solution ?

2
  • 6
    We have no idea either, given what you've told us. We need to know what /dev/md1 was made from and what kind of raid array it is. Give us the output of mdadm --detail /dev/md1 (nicely formatted using the {} button like Jay made your df output, please)
    – DerfK
    Jul 10, 2012 at 22:46
  • 2
    Given the current sizes of your volumes I am strongly tempted to suggest that you make a full backup, wipe the drives, use /dev/md1 for /boot, and setup LVM on /dev/md2. If md1 and md2 are on the same drives, then re-create them so that MD1 is 1-2GB, and then all the rest of the space is in LVM. Then leave your self lots of unallocated space in the volume group, that way you can extend volumes as needed.
    – Zoredache
    Jul 10, 2012 at 23:16

2 Answers 2

3

What DerfK said, but however your system is set up, this very likely will be a complicated procedure with multiple steps that all have the potential for total data loss. In most cases, I would likely choose to just reinstall the system (and get LVM into the mix at some point) or, alternatively, free up some space on /. For this, you could move some directories from / to /home and then symlink them back into place. /var and /tmp are good candidates for this since those have the tendency to grow over time. This should be done from inside a live/rescue system.

1
  • just post the informations you needed
    – bl0b
    Jul 11, 2012 at 2:44
1

If mysql is the problem, it should be relatively easy to move the data directory to somewhere else, say, /home/mysql (or however you want to do this).

Take a look at /etc/my.cnf. There should be a datadir directive, perhaps pointing to /var/lib/mysql (e.g., datadir=/var/lib/mysql in the mysqld block).

In that case, shut down mysql, move the contents of /var/lib/mysql to /home/mysql, make sure the permissions are correct, then edit /etc/my.cnf to reflect the new location. You should be able to start up mysql at this point.

There should be no need to change the socket, pid-file, etc., as these take up next to no space. The error log might, but you should probably be running logrotate against that anyway.

You must log in to answer this question.

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