Little RAID (mirror) and file server help....

Soldato
Joined
18 Dec 2004
Posts
6,567
Location
London/Kent
Hi guys,

Currently enjoying (well, certainly more than my attempt a few years ago) my little linux adventure at the moment but have reached a stalemate.

I'm running CentOS 5.2 (updated) and using the Gnome desktop. I've managed to set up my samba share so that it is working - have a few questions to follow.

The setup
PIII-S 1.4ghz Tualatin
512MB PC133 SDRAM
VIA PLE133
VIA VT6421A SATA controller
2x 80GB SATA Hitachi drives connected to the above controller (would like ext3 or similar FS)
20GB laptop IDE (O/S - ext3)

The questions/issues

1. Right, I have disabled all the firewalls i.e. firewall and SELinux (it's a LAN only device for the moment). It has access to the internet but I generally avoid doing so. Is this OK?

2. I've had some serious problems with the SATA drives - the system sometimes freezes on the boot phase when the LVM is set up in a certain way in terms of the SATA disks. Really odd. Would only be fixed by unplugging one of the SATA drives. Anyone able to shed any light on this?

3. Want to setup a software RAID1, however for some reason, LVM is asking for 3 disks. I've looked at some howto's but they are totally useless to me as I don't understand what the hell is going on. I like the LVM GUI but I can't use LVM as it wants 3 disks. What do I do? I've currently setup two volume groups called NAS1 and NAS2, each mounted to /filestorage1 and /filestorage 2.

If I can't setup a RAID1 simply (given that I am a n00b), is there any way I can make them sync to each other, without implementing RAID at the filesystem sort of level?

I would like to say I like the way linux handles networks i.e. they just work. No faffing about with windows networked drives not always appearing etc.

4. In the Samba config, I set the guest user as 'root'. I did this because I want everyone to have full access to the shares i.e. full permissions. Are there any dangers to the server itself in doing so?
 
Last edited:
I am indeed behind a NAT :). I'm a linux n00b but I have some networking knowledge :D.

Indeed, I have 2 disks, both 80GB hitachi's for the moment. I can mash the disks together with LVM but cannot RAID mirror them because as soon as I select it, the damn thing says you need 3 physical volumes! Why?! I don't want a damn spare, I just want to mirror the two disks!

It is because I could not set up a RAID mirror in LVM that I chose to create two separate logical volumes, with the hope that some other process could sync them.

BigglesPiP - how do I do that? The only time I've remotely seens something like you suggest, it was in Disk Druid during the installation. I wanted to sort out the OS install first, so left the RAID array until after the install with the hope that something like Disk Druid would be available after - how wrong I was!

I would love to know how to setup a software RAID in CentOS. I don't need this for any other reason other than simply to insure against a disk failure.
 
After much fiddling, I got myself to this point (believe me, I've spent 30 minutes playing with command line options to get here!).

Code:
[root@nas ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/hdc2              18G  3.2G   14G  19% /
/dev/hdc1              99M   16M   78M  18% /boot
tmpfs                 248M     0  248M   0% /dev/shm
/dev/sda1              76G  180M   72G   1% /filestorage
/dev/sdb1              76G  180M   72G   1% /filestorage
[root@nas ~]# mdadm --create --verbose /dev/md1 --level=1 \ --raid-devices=2 /dev/sda1 /dev/sdb1
mdadm: no raid-disks specified.
[root@nas ~]# mdadm --create --verbose /dev/md1 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1
mdadm: Cannot open /dev/sda1: Device or resource busy
mdadm: Cannot open /dev/sdb1: Device or resource busy
mdadm: create aborted
Any ideas?

EDIT: Some progress.

Apparently there is now a RAID array setup (after reboots) and I seem to have halted the problems with the system crash with kernel option 'nodmraid'. I cannot, however, format the filesystem.

Code:
[root@nas ~]# mdadm --create --verbose /dev/md1 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1
mdadm: /dev/sda1 appears to contain an ext2fs file system
    size=80413324K  mtime=Mon Feb  2 07:26:38 2009
mdadm: /dev/sda1 appears to be part of a raid array:
    level=raid1 devices=2 ctime=Mon Feb  2 08:03:49 2009
mdadm: /dev/sdb1 appears to contain an ext2fs file system
    size=80413324K  mtime=Mon Feb  2 07:26:38 2009
mdadm: /dev/sdb1 appears to be part of a raid array:
    level=raid1 devices=2 ctime=Mon Feb  2 08:03:49 2009
mdadm: size set to 80413248K
Continue creating array? n
mdadm: create aborted.
[root@nas ~]# fdisk /dev/md1

Unable to read /dev/md1
[root@nas ~]# mount /dev/md1 /filestorage
mount: you must specify the filesystem type
[root@nas ~]# mkfs.ext3 /dev/md1
mke2fs 1.39 (29-May-2006)
mkfs.ext3: Device size reported to be zero.  Invalid partition specified, or
        partition table wasn't reread after running fdisk, due to
        a modified partition being busy and in use.  You may need to reboot
        to re-read your partition table.
 
Last edited:
Is there any reason why the system hangs on creation of the md0 array?

mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1

I just ran the above to see if rebuilding the array would allow me to fix things but, as before, this simply just crashed the system. Could this be the controller?
 
It's not onboard, it's a PCI card (but yes, it might as well be onboard as it is certainly not a hardware RAID card - it's a VIA SATA software RAID card).

Nothing is in fstab about the drives, it only lists my OS drive.

When it crashes, it hangs. No reboots or anything. Full lockup - mouse stops, everything. This sometimes happens on boot when the LVM has done something to the two drives. It is not the RAM, as this has been tested for 24hrs using memtest.
 
Would it just be easier to reinstall do you think?

It's things like this that turn people away. It should be simple if the kernel sees the hardware, however for some reason, the OS doesn't want to play ball... I'm going to persist as I liked it before I tried to set up a RAID. It works well when it does - it's just damn hard to get it there!
 
Nowhere to be exact. It said that no partitions were defined, even though they were. I cannot get the system to recognise partitions, despite formatting, trying to use LVM etc. Nothing can seem to make this array work!

I think I'll have to try a different distro to see if that kernel works better with my hardware.

I'm trying a new ubuntu install to see if that works. Pity, I really like CentOS.

If ubuntu doesn't work, I'll try a new CentOS install and this time do everything through Disk Druid! :D

Thanks for your help though Nefarious, you've been great. I've gained a better understanding from some of the commands you listed. Had to do some reading also which, given your pointers, have helped me delve a little deeper into understanding the system.

Got a fair amount of time today given that I can't get to work!
 
Last edited:
I don't use SSH (I'm a GUI man!). I will double check the NAT security though. I have loopback enabled so will test the firewall. Ideally I don't want the firewall running as last time it gave me problems, especially when it came round to the mailserver.
 
Thanks celliott. I didn't really get anywhere. I think there is an issue with the controller/drivers for that controller (VIA 6421A) - tried loads of distros - OpenSolaris, ubuntu, CentOS, fedora - all had problems . Rather than buying a SiI controller card (looking at £15), I'm saving up for an Atom 330 board, or similar. It will have gigabit too which is great as I've got a 16 port gigabit dell powerconnect 2716 under my desk and eveyone else in the house can serve wirelessly.

The moment I turn off the SATA drives, the system works flawlessly. I'm going to head back to CentOS and wait until I've re configured the system. It's quite simple as you say - now it's just about getting the hardware right. I'm hoping Intel chipsets are supported well (ICH7).

I really like OpenSolaris' gnome desktop but it's a very resource heavy distro. I can't use it with 512MB RAM (idles about 550MB) whereas all the others will only use 80-200MB - CentOS using only 80MB idling). Still, when/if I get an Atom board, I will probably use a 2GB stick.
 
Last edited:
Back
Top Bottom