Re: hard drive size on a RAID1 array
- From: Diego <ivans.address@xxxxxxxxx>
- Date: Mon, 14 Apr 2008 20:03:33 -0700 (PDT)
On Apr 15, 11:11 am, Aragorn <arag...@xxxxxxxxxxxxxxxxxxx> wrote:
Diego wrote:
Hi all,
I have two 500 GB hard drives that are configured in a raid 1 array.
They are partitioned into two: a 20gb partition and a 480gb partition
(with 2gb of swap).
That would be three partitions then? A swap partition is a partition too,
and on /x86/ it cannot be larger than ~2 GB; you can however use multiple
swap partitions and as such increase the amount of swap space available to
the kernel.
My problem is as follows:
When I do df -h I get the following:
Filesystem Size Used Avail Use% Mounted on
/dev/md0 19G 9.8G 7.8G 56% /
varrun 1013M 128K 1013M 1% /var/run
varlock 1013M 0 1013M 0% /var/lock
udev 1013M 80K 1013M 1% /dev
devshm 1013M 0 1013M 0% /dev/shm
lrm 1013M 34M 979M 4% /lib/modules/2.6.22-14-
generic/volatile
Where is my other partition??
See above... And see further down...: a swap partition is not listed in
a /df/ output.
I tried using fdisk (but I don't really know how to use it that well)
And I print the following:
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 60557 486424071 fd Linux raid
autodetect
/dev/sdb2 60558 60801 1959930 fd Linux raid
autodetect
Device Boot Start End Blocks Id System
/dev/sda1 * 1 60557 486424071 fd Linux raid
autodetect
/dev/sda2 60558 60801 1959930 fd Linux raid
autodetect
So you've created two partitions on each disk, not three... But read on...
Further information:
$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/md0
UUID=3130e988-88a8-4e87-8b85-7a267904a370 / ext3
defaults,errors=remount-ro 0 1
The above is your first metadevice, i.e. your first RAID 1 volume, so to
speak. You've mounted it on the root directory.
# /dev/md1
UUID=8e35bf5c-6501-49fa-960e-ac3f589ffa1b none swap
sw 0 0
The above is your second metadevice, i.e. your second RAID 1 volume, which
you've set up as the swap partition.
Mirroring a swap partition is not really helpful, in my humble opinion.
You'd been better off making a single swap partition on each drive at about
1 GB in size, and using them with equal priority in */etc/fstab,* which
would effectively make them into a stripe.
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec 0 0
$ swapon -s
Filename Type Size
Used Priority
/dev/md1 partition 1959800
34756 -1
So far so good - at least, for your intended use.
$ free
total used free shared buffers
cached
Mem: 2074372 1124088 950284 0 80548
909980
-/+ buffers/cache: 133560 1940812
Swap: 1959800 34756 1925044
Your kernel is obviously paging out to the swap partition, so you know it's
being used.
[...]
<snipped memory contents for brevity - it's irrelevant here>
$ du -h --max-depth=1 /
156M /lib
4.0K /srv
4.0K /opt
236K /dev
4.7M /bin
12K /media
0 /sys
40K /root
4.0K /initrd
0 /proc
7.9M /home
9.5M /etc
322M /var
2.1G /usr
18M /boot
16K /lost+found
6.4M /sbin
20K /tmp
4.0K /mnt
2.6G /
The above only tells you how much space a directory takes up, not how much
is available.
$ cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5]
[raid4] [raid10]
md1 : active raid1 sda2[0] sdb2[1]
1959808 blocks [2/2] [UU]
md0 : active raid1 sda1[0] sdb1[1]
486424000 blocks [2/2] [UU]
unused devices: <none>
Very strange is the following:
# mount /dev/md0
mount: /dev/md0 already mounted or / busy
mount: according to mtab, /dev/md0 is already mounted on /
Nothing strange about this. According to */etc/fstab,* that's your root
filesystem.
# mount /dev/md1
mount: mount point none does not exist
(must be swap?)
You cannot mount a swap partition via the /mount/ command. It's error
message is as designed: you are telling it to mount a block device, so it
parses */etc/fstab* to see what mountpoint it must use, and all it finds is
the word "none". Therefore it looks for the directory "./none" - i.e. a
directory named "none" in the current working directory - which obviously
does not exist.
I don't even know what would happen if that mountpoint *were* to actually
exist, so perhaps you're lucky that it halts its execution at the failure
of finding the mountpoint.
# fdisk /dev/md1
p
Warning: invalid flag 0x0000 of partition table 4 will be corrected by
w(rite)
Command (m for help): p
Disk /dev/md1: 2006 MB, 2006843392 bytes
2 heads, 4 sectors/track, 489952 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Disk identifier: 0xd436a49e
Device Boot Start End Blocks Id System
# fdisk /dev/md0
p
Warning: invalid flag 0x0000 of partition table 4 will be corrected by
w(rite)
Command (m for help): p
Disk /dev/md0: 498.0 GB, 498098176000 bytes
2 heads, 4 sectors/track, 121606000 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Disk identifier: 0xfe9d38d6
Device Boot Start End Blocks Id System
So, according to this, / should be 498 GB..
But it's only 20..
Any ideas?
I have very little experience with Linux software RAID, but there are two
things I can think of that could have gone wrong.
The first and simplest thing would be that you've created a filesystem of
only 20 GB in size when you should have created one that fills up your
entire partition. Just because your partition is 468 GB in size doesn't
mean that your filesystem is. The solution would be to resize the
filesystem using the appropriate tools and precautions - e.g. some
filesystems prefer being mounted when resized, others have to be unmounted
first, which in your case, the pertaining filesystem being the root
filesystem, you will need to do that from a Live CD.
The second thing - and this is where I am only offering a suggestion as I
don't have the expertise and I may be wrong - would be that you possibly
designated the incorrect filesystem type when creating your partitions,
which could explain why the /fdisk/ report above doesn't show you any
statistics on */dev/md0* and why there is a warning of an invalid flag.
If my reasoning is correct, then you should have simply created those
partitions on */dev/sda* and */dev/sdb* as "Linux native" and "Linux swap"
respectively, not as "Linux RAID". I believe the latter would be the type
designation you get from */dev/md0* and */dev/md1.*
Like I said, my experiences with software RAID are highly limited - I've
never actually set it up myself, but I've worked on a machine that has a
software RAID 1 - so if my comments about the partition types breaks your
system, you get to keep both pieces. ;-)
As a wise man once said to me, when all else fails, read the manual... :p
Good luck! ;-)
--
Aragorn
(registered GNU/Linux user #223157)
How would you go about attempting to resize the filesystem whilst the
partition is still mounted?
The problem is that the server is in a different state -- i don't have
physical access to it.. :S
.
- Follow-Ups:
- Re: hard drive size on a RAID1 array
- From: Aragorn
- Re: hard drive size on a RAID1 array
- References:
- hard drive size on a RAID1 array
- From: Diego
- Re: hard drive size on a RAID1 array
- From: Aragorn
- hard drive size on a RAID1 array
- Prev by Date: Re: hard drive size on a RAID1 array
- Next by Date: Re: hard drive size on a RAID1 array
- Previous by thread: Re: hard drive size on a RAID1 array
- Next by thread: Re: hard drive size on a RAID1 array
- Index(es):
Relevant Pages
|
|