Hard Drive Space Question

General support questions including new installations
xman888
Posts: 29
Joined: 2008/12/16 03:28:49

Hard Drive Space Question

Post by xman888 » 2010/08/17 11:50:39

Hello,

I have 2 centos servers, both with two 1TB hard drives.

On the first one, the hard drive space free is showing correctly at the bottom of the File Browser window:

[b]Free Space 1320 GB[/b]

However, on the 2nd one, it is showing as if only 1 of the 1TB Drives are being used:

[b]Free Space 474GB (should be 1TB more).[/b]

I have done a couple of terminal commands (see below). If someone could point me in the right direction so that I could get my 2nd server using both 1TB drives, that would be great.

Kind regards,
Anthony

[b]Working Centos Server:[/b]
[root@ ~]# df
[code] Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/VolGroup00-LogVol00
1888226360 405715052 1385047808 23% /
/dev/sda1 101086 11118 84749 12% /boot
tmpfs 1036980 0 1036980 0% /dev/shm
/dev/scd0 629128 629128 0 100% /media/WD SmartWare [/code]

[root@ ~]# df -H
[code]Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol00
2.0T 416G 1.5T 23% /
/dev/sda1 104M 12M 87M 12% /boot
tmpfs 1.1G 0 1.1G 0% /dev/shm
/dev/scd0 645M 645M 0 100% /media/WD SmartWare [/code]

[root@ ~]# fdisk -l | grep Disk
[code]Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes [/code]


[b]2ND SERVER:[/b]
[root@localhost ~]# df
[code] Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/VolGroup01-LogVol00
942032540 395939580 497468528 45% /
/dev/mapper/isw_dafjiibhii_Volume0p1
101086 12134 83733 13% /boot
tmpfs 1033440 0 1033440 0% /dev/shm
/dev/sdc2 302253408 165371200 136882208 55% /home/user/usb [/code]

[root@localhost ~]# df -H
[code]Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup01-LogVol00
965G 406G 510G 45% /
/dev/mapper/isw_dafjiibhii_Volume0p1
104M 13M 86M 13% /boot
tmpfs 1.1G 0 1.1G 0% /dev/shm
/dev/sdc2 310G 170G 141G 55% /home/user/usb [/code]

[root@localhost ~]# fdisk -l | grep Disk
[code] Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
Disk /dev/sdc: 320.0 GB, 320072933376 bytes [/code]

User avatar
TrevorH
Site Admin
Posts: 33216
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Hard Drive Space Question

Post by TrevorH » 2010/08/17 12:44:41

The 2nd server is using both drives but you have a FakeRAID controller there that has set them up in a RAID 1 configuration.

xman888
Posts: 29
Joined: 2008/12/16 03:28:49

Re: Hard Drive Space Question

Post by xman888 » 2010/08/18 04:53:38

Hello TrevorH,

Thanks for the reply.

I don't have any knowledge of RAID.

Do you know of a way that I can change the setup, so that the server has 2TB instead of 1TB - ie. some terminal commands or something?

Kind regards,
Anthony

User avatar
jlehtone
Posts: 4530
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Hard Drive Space Question

Post by jlehtone » 2010/08/18 08:41:31

The '/dev/mapper/isw_dafjiibhii_Volume0p1' is a strong hint that the second server
has Intel ICH based fakeRAID set up, quite probably RAID1 (aka mirror).

The first server seems to have LVM-based JBOD (aka spanning) volume. I would be
scared about that. It may not be as bad as RAID0 (aka striping) in its lack of redundancy,
but lacking it is.


Interlude: Why the huge root partitions? It is recommended to keep the root compact and
use larger separate volumes for data (and applications, if necessary).


It is technically possible to disable the RAID1, erase its metadata, and migrate the volume
structure, but one has to use a Rescue CD or other Live-distro, ie you cannot do that
in running server. It's an operation, where you better know what you are doing and
still have fresh backups.

xman888
Posts: 29
Joined: 2008/12/16 03:28:49

Re: Hard Drive Space Question

Post by xman888 » 2010/08/18 11:25:25

Hello jlehtone ,

Thanks for the reply.

The server is only a backup server anyway, therefore isn't mission critical - it is more important to have more storage space.

As far as big root partitions - I have no idea why .... I just did a standard centos install.

Is there a link that has step by step instructions to show how to remove the raid setup?

Kind regards,
Anthony

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Hard Drive Space Question

Post by pschaff » 2010/08/18 11:54:59

As far as I know there is no easy or safe way to remove the Fake RAID setup and get to a more "sane" configuration. Might try a google on [url=http://www.google.com/search?q=remove+fake+raid&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a]remove fake raid[/url] but I'd back up valuable data, zero the partitions, turn off RAID in the BIOS, and do a fresh install with custom partitioning to mount the storage where you want it. The following will totally kill your current install and should be performed from a LiveCD or rescue mode:[code]
dd if=/dev/zero of=/dev/sda bs=512 count=64
dd if=/dev/zero of=/dev/sdb bs=512 count=64[/code]

xman888
Posts: 29
Joined: 2008/12/16 03:28:49

Re: Hard Drive Space Question

Post by xman888 » 2010/08/18 12:47:19

Hello pschaff,

Thanks for the reply.

Does anyone know if this would be a 'safeish' way (is from a Ubuntu forum, so I don't know whether the code is the same for Centos): http://ubuntuforums.org/showthread.php?t=394281

1. Find out your arrays (md0, md1, etc..) using
sudo fdisk -l

2. Query your arrays to find out what disks are contained using
sudo mdadm --detail /dev/md0 (or md1 or whatever)

3. unmount the array
sudo umount /dev/md0

4. Shut down the array using
sudo mdadm --stop /dev/md0

5. And here's the magic key ...... zero the superblock FOR EACH drive
sudo mdadm --zero-superblock /dev/sda (or hda)
sudo mdadm --zero-superblock /dev/sdX...

Kind regards,
Anthony

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: Hard Drive Space Question

Post by pschaff » 2010/08/18 13:10:17

That procedure is for [url=http://wiki.centos.org/HowTos/SoftwareRAIDonCentOS5]software RAID[/url] not FakeRAID. A google on [url=http://www.google.com/search?q=mdraid+dmraid&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a&safe=active]mdraid dmraid[/url] may help you understand the difference.

Edit: On further investigation, it does appear that [url=http://en.wikipedia.org/wiki/Mdadm]mdadm[/url] may be used to zero the superblock on FakeRAID if you can convince dmraid to let go of the devices. I have no direct experience with this. Whatever you do, back up anything you care about first.

User avatar
jlehtone
Posts: 4530
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Hard Drive Space Question

Post by jlehtone » 2010/08/18 19:21:12

man dmraid
there is --erase_metadata
(The benefit is that this is not a blind erase like 'dd'.)

mdadm and fakeRAID ... in Fedora 13 the mdadm knows
and can manage Intel (and some other) fakeRAID, deprecating
dmraid. That will cause some pain (but we don't love fakeRAID,
do we?).


Procedure? I don't have one. However,
- boot to Live Distro
- disable LVM
- disable fakeRAID
- wipe one disk. Make it a physical volume
- [Handle the /boot about here]
- activate LVM one the other disk
- add PV of wiped disk to the VG
- migrate LV's to that new PV
- remove the PV of the unerased disk. Wipe disk
- recreate PV. Add to VG
- expand LV's.
- fix grub.conf, fstab & co.

The above is certainly naive, contains unnecessary disk operations,
and has no garantee of working as expected.

Therefore, here is plan B:
- boot to Live Distro
- rsync everything to the other server (rsync -aH --numeric-ids)
- wipe and recreate filesystems as desired
- rsync everything back from the other server
- re-setup grub
- fix fstab & co
- [if using selinux: reboot to single mode. restorecon]

Does that work better? Perhaps. Simpler? I think so.

xman888
Posts: 29
Joined: 2008/12/16 03:28:49

Re: Hard Drive Space Question

Post by xman888 » 2010/08/20 12:15:57

Hello,

Thanks for the replies guys.

I was hoping that there was a simple way of just disabling the raid, and formatting the 2nd drive - I guess there isn't.

If I was to add another 1TG hard drive, would my system therefore show 2TB, or would the raid setup still stuff things up?

Kind regards,
Anthony

Post Reply