ubuntu raid0_如何在Ubuntu上为简单文件服务器设置软件RAID

本文提供了一种使用Ubuntu、软件RAID和SaMBa创建经济实惠且可靠的文件服务器的方法。虽然软件RAID不如硬件RAID性能强大,但它降低了成本。文章详细介绍了如何设置RAID10阵列、文件系统、安装、邮件警报、Samba配置以及故障排除,强调了使用服务器级硬盘的重要性。
摘要由CSDN通过智能技术生成
ubuntu raid0

ubuntu raid0

photo_8715_20091014

Do you need a file server on the cheap that is easy to setup, “rock solid” reliable with Email Alerting? will show you how to use Ubuntu, software RAID and SaMBa to accomplish just that.

您是否需要便宜,易于设置,可靠且可通过电子邮件警报可靠运行的文件服务器? 将向您展示如何使用Ubuntu,软件RAID和SaMBa来完成此任务。

总览 (Overview)

Despite the recent buzz to move everything to the “all mighty”cloud,  sometimes you may not want your information in someone else’s server or it just maybe unfeasible to download the volumes of data that you require from the internet every time (for example image deployment). So before you clear out a place in your budget for a storage solution, consider a configuration that is licensing free with Linux.

尽管最近热议将所有内容移至“全能”云,但有时您可能不希望将信息存储在其他人的服务器中,或者每次都无法从Internet下载所需的数据量(例如,映像部署) )。 因此,在清理预算中的存储解决方案之前,请考虑使用Linux免费许可的配置。

With that said, going cheap/free does not mean “throwing caution to the wind”, and to that end, we will note points to be aware of, configurations that should be set in place in addition to using software RAID, to achieve the maximum price to reliability ratio.

话虽如此,便宜/免费并不意味着“随风而行”,为此,我们将指出要注意的一点,除了使用软件RAID之外,还应设置一些配置以实现以下目标:最大价格可靠性比。

Image by Filomena Scalise

图片来自Filomena Scalise

关于软件RAID (About software RAID)

As the name implies, this is a RAID (Redundant Array of Inexpensive Disks) setup that is done completely in software instead of using a dedicated hardware card. The main advantage of such a thing is cost, as this dedicated card is an added premium to the base configuration of the system. The main disadvantages are basically performance and some reliability as such a card usually comes with it’s own RAM+CPU to perform the calculations required for the redundancy math, data caching for increased performance, and the optional backup battery that keeps unwritten operations in the cache until power has been restored in case of a power out.

顾名思义,这是RAID(廉价磁盘冗余阵列)设置,完全通过软件完成,而不使用专用的硬件卡。 这样的事情的主要优点是成本,因为该专用卡是系统基本配置的额外奖励。 主要缺点主要是性能和可靠性,因为这种卡通常带有自己的RAM + CPU来执行冗余数学所需的计算,数据缓存以提高性能,以及可选的备用电池,该备用电池会在缓存中保留未写入的操作,直到断电后电源已恢复。

With a software RAID setup your sacrificing some of the systems CPU performance in order to reduce total system cost, however with todays CPUs the overhead is relatively  negligible (especially if your going to mainly dedicate this server to be a “file server”). As far as disk performance go, there is a penalty… however I have never encountered a bottleneck from the disk subsystem from the server to note how profound it is. The Tom’s Hardware guide “Tom’s goes RAID5” is an oldie but a goody exhaustive article about the subject, which I personally use as reference, however take the benchmarks with a grain of salt as it is talking about windows implementation of software RAID (as with everything else, i’m sure Linux is much better :P).

使用软件RAID设置可以牺牲某些系统的CPU性能,以降低总系统成本,但是,对于当今的CPU,开销相对可以忽略不计(尤其是如果您打算主要将该服务器用作“文件服务器”)。 就磁盘性能而言,这是有代价的……但是,我从来没有遇到服务器的磁盘子系统出现瓶颈的情况,因此请注意它有多么深远。 Tom's硬件指南“ Tom's RAID5 ”是一本老书,但内容详尽,我个人用作参考,但是在谈论Windows的软件RAID实现时(例如与其他一切,我敢肯定Linux会更好:P)。

先决条件 (Prerequisites)

  • Patience young one, this is a long read.

    耐心的年轻人,这是一本长篇小说。
  • It is assumed you know what RAID is and what it is used for.

    假定您知道RAID是什么以及它的用途。
  • This guide was written using Ubuntu server9.10 x64, therefore it is assumed that you have a Debian based system to work with as well.

    本指南是使用Ubuntu server9.10 x64编写的,因此假定您也可以使用基于Debian的系统。
  • You will see me use VIM as the editor program, this is just because I’m used to it… you may use any other editor that you’d like.

    您会看到我将VIM用作编辑器程序,这仅仅是因为我已经习惯了……您可以使用任何其他想要的编辑器。
  • The Ubuntu system I used for writing this guide, was installed on a disk-on-key. Doing so allowed me to use sda1 as part of the RAID array, so adjust accordingly to your setup.

    我用于编写本指南的Ubuntu系统已安装在密钥磁盘上。 这样做使我可以将sda1用作RAID阵列的一部分,因此请根据您的设置进行相应的调整。
  • Depending on the type of RAID you want to create you will need at least two disks on your system and in this guide we are using 6 drives.

    根据要创建的RAID的类型,您的系统上至少需要两个磁盘,在本指南中,我们使用6个驱动器。

选择构成阵列的磁盘 (Choosing the disks that make the array)

The first step in avoiding a trap is knowing of it’s existence (Thufir Hawat from Dune).

避免陷阱的第一步是知道陷阱的存在(Dune的Thufir Hawat)。

Choosing the disks is a vital step that should not be taken lightly, and you would be wise to capitalize on yours truly’s experience and heed this warning:

选择磁盘是至关重要的一步,不应掉以轻心,明智的做法是充分利用自己的实际经验并注意以下警告:

Do NOT use “consumer grade” drives to create your array, use “server grade” drives!!!!!!

不要使用“消费级”的驱动器来创建阵列,使用“服务器级”硬盘!!!!!!

Now i know what your thinking, didn’t we say we are going to go on the cheap? and yes we did, but, this is exactly one of the places where doing so is reckless and should be avoided. Despite of their attractive price, consumer grade hard drives are not designed to be used in a 24/7 “on” type of a use. Trust me, yours truly has tried this for you. At least four consumer grade drives in the 3 servers I have setup like this (due to budget constraints) failed after about 1.5 ~ 1.8 years from the server’s initial launch day. While there was no data loss, because the RAID did it’s job well and survived… moments like this shorten the life expectancy of the sysadmin, not to mention down time for the company for the server maintenance (something which may end up costing more then the higher grade drives).

现在我知道您的想法了,我们不是说我们要便宜吗? 是的,我们做到了,但是,这恰恰是这样做的鲁re之处,应该避免。 尽管价格诱人,但消费级硬盘并非设计用于24/7“开启”使用类型。 相信我,您的确为您尝试过。 由于服务器的预算限制,在这样设置的3台服务器中,至少有4个消费级驱动器在服务器初始启动日起约1.5到1.8年后出现故障。 尽管没有数据丢失,但是由于RAID可以很好地工作并可以幸免于难……类似的时刻缩短了sysadmin的预期寿命,更不用说公司在服务器维护方面的停机时间了(这可能最终会花费更多的费用,而不是服务器的维护费用)。更高等级的驱动器)。

Some may say that there is no difference in fail rate between the two types. That may be true, however despite these claims, server grade drives still have a higher level of S.M.A.R.T restrictions and QAing behind them (as can be observed by the fact that they are not released to the market as soon as the consumer drives are), so i still highly recommend that you fork out the extra $$$ for the upgrade.

有人可能会说这两种类型的故障率没有差异。 确实可以,但是尽管有这些主张,服务器级驱动器仍然具有更高级别的SMART限制和QA限制(可以从消费者驱动器不立即将它们发布到市场这一事实可以看出),因此,我仍然强烈建议您为升级支付额外的$$。

选择RAID级别。 (Choosing the RAID level.)

While I’m not going to go into all of the options available (this is very well documented in the RAID wikipedia entry), I do feel that it is noteworthy to say that you should always opt for at least RAID 6 or even higher (we will be using Linux RAID10). This is because when a disk fails, there is a higher chance of a neighboring disk failure and then you have a “two disk” failure on your hands. Moreover, if your going to use large drives, as larger disks have a higher data density on the platter’s surface, the chance for failure is higher. IMHO disks from 2T and beyond will always fall into this category, so be aware.

尽管我不打算讨论所有可用选项(在RAID Wikipedia条目中对此有很好的记录),但我确实应该指出,应该始终选择至少RAID 6或更高版本(我们将使用Linux RAID10 )。 这是因为,当磁盘发生故障时,相邻磁盘发生故障的可能性更高,然后您手中就会出现“两块磁盘”故障。 此外,如果您要使用大型驱动器,则由于较大的磁盘在磁盘表面上具有较高的数据密度,因此发生故障的机会也更高。 2T及更高版本的IMHO磁盘将始终属于此类,因此请注意。

让我们开始吧 (Let’s get cracking)

Partitioning disks

分区磁盘

While in Linux/GNU, we could use the entire block device for storage needs, we will use partitions because it makes it easier to use disk rescue tools in case the system has gone bonkers. We are using the “fdisk” program here, but if your going to use disks larger then 2T you are going to need to use a partitioning program that supports GPT partitioning like parted.

在Linux / GNU中,我们可以使用整个块设备来满足存储需求,而我们将使用分区,因为这样可以更轻松地使用磁盘救援工具,以防系统崩溃。 我们在这里使用“ fdisk”程序,但是如果您要使用大于2T的磁盘,则需要使用支持parted的GPT分区的分区程序。

sudo fdisk /dev/sdb

sudo fdisk /dev/sdb

Note: I have observed that it is possible to make the array without changing the partition type, but because this is the way described all over the net I’m going to follow suit (again when using the entire block device this is unnecessary).

注意:我已经观察到可以在不更改分区类型的情况下制作阵列,但是由于这是我在网上所描述的方式(同样,在使用整个块设备时,这是不必要的)。

Once in fdisk the keystrokes are:

进入fdisk后,击键为:

n          ; for a new partition enter p          ; for a primary partition enter 1          ; number of partition enter    ; accept the default enter    ; accept the default t          ; to change the type fd        ; sets the type to be “Linux raid auto detect” (83h) w         ; write changes to disk and exit

n; 对于新分区,请输入p; 对于主分区输入1; 分区号输入; 接受默认输入; 接受默认的t; 改变类型fd; 将类型设置为“ Linux raid auto detect”(83小时)w; 将更改写入磁盘并退出

Rinse and repeat for all the disks that will be part of the array.

冲洗并重复执行将作为阵列一部分的所有磁盘。

创建Linux RAID10阵列 (Creating a Linux RAID10 array)

The advantage of using “Linux raid10” is that it knows how to take advantage of a non-even number of disks to boost performance and resiliency even further then the vanilla RAID10, in addition to the fact that when using it the “10” array can be created in one single step.

使用“ Linux raid10 ”的优势在于,除了使用“ 10”阵列之外,它还知道如何利用偶数磁盘来提高性能和弹性,甚至比原始RAID10还要高。只需一步即可创建。

Create the array from the disks we have prepared in the last step by issuing:

通过发出以下命令,从上一步中准备的磁盘创建阵列:

sudo mdadm --create /dev/md0 --chunk=256 --level=10 -p f2 --raid-devices=5 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1 --verbose

sudo mdadm --create /dev/md0 --chunk=256 --level=10 -p f2 --raid-devices=5 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1 --verbose

Note: This is all just one line despite the fact that the representation breaks it into two.

注意:尽管表示将其分成两部分,但所有这些仅是一行。

Let’s break the parameters down:

让我们分解参数:

  • “–chunk=256” –  The size of bytes the raid stripes are broken to, and this size is recommended for new/large disks (the 2T drives used to make this guide were without a doubt in that category).

    “ –chunk = 256” –突袭条纹被打破的字节大小,建议为新磁盘/大磁盘使用此大小(用于制作本指南的2T驱动器毫无疑问属于该类别)。
  • “–level=10” – Uses the Linux raid10 (if a traditional raid is required, for what ever reason, you would have to create two arrays and join them).

    “ –level = 10” –使用Linux raid10(如果需要传统的raid,无论出于何种原因,您都必须创建两个数组并将其连接)。

  • “-p f2” – Uses the “far” rotation plan see note below for more info and “2” tells that the array will keep two copies of the data.

    “ -p f2” –使用“远”轮换计划,有关更多信息,请参见下面的注释,“ 2”表示数组将保留数据的两个副本。

Note: We use the “far” plan because this causes the physical data layout on the disks to NOT be the same. This helps to overcome the situation where the hardware of one of the drives fails due to a manufacturing fault (and don’t think “this won’t happen to me” like yours truly did). Due to the fact that the two disks are of the same make and model, have been used in the same fashion and traditionally have been keeping the data on the same physical location… The risk exists that the drive holding the copy of the data has failed too or is close to and will not provide the required resiliency until a replacement disk arrives. The “far” plan makes the data distribution to a completely different physical location on the copy drives in addition to using disks that are not close to each other within the computer case. More information can be found here and in the links below.

注意:我们使用“远”计划,因为这会导致磁盘上的物理数据布局不相同。 这有助于克服其中一个驱动器的硬件由于制造故障而发生故障的情况(不要像您真正想到的那样认为“这不会发生在我身上”)。 由于两个磁盘具有相同的品牌和型号,以相同的方式使用,并且传统上一直将数据保留在相同的物理位置上……存在保存数据副本的驱动器发生故障的风险太接近或接近并且将不会提供所需的弹性,直到替换磁盘到达。 除了使用在计算机机箱内彼此之间不靠近的磁盘之外,“远”计划还使数据分发到副本驱动器上完全不同的物理位置。 可以在这里和下面的链接中找到更多信息。

Once the array has been created it will start its synchronization process. While you may wish to wait for traditions’ sake (as this may take a while), you can start using the array immediately.

创建阵列后,它将开始其同步过程。 尽管您可能希望等待传统的缘故(这可能需要一段时间),但是您可以立即开始使用该阵列。

The progress can be observed using:

使用以下命令可以观察到进度:

watch -d cat /proc/mdstat

watch -d cat /proc/mdstat

Create the mdadm.conf Configuration File

创建mdadm.conf配置文件

While it has been proven that Ubuntu simply knows to scan and activate the array automatically on startup, for completeness sake and courtesy for the next sysadmin we will create the file. Your system doesn’t automatically create the file and trying to remember all the components/partitions of your RAID set, is a waist of the system admin’s sanity. This information can, and should be kept in the mdadm.conf file. The formatting can be tricky, but fortunately the output of the mdadm –detail –scan –verbose command provides you with it.

尽管已经证明Ubuntu只是知道在启动时会自动扫描并激活阵列,但是出于完整性考虑和出于对下一个sysadmin的礼貌,我们将创建该文件。 您的系统不会自动创建文件,而是试图记住RAID集的所有组件/分区,这是系统管理员的精打细算。 该信息可以并且应该保存在mdadm.conf文件中。 格式设置可能很棘手,但幸运的是mdadm –detail –scan –verbose命令的输出为您提供了格式设置。

Note: It has been said that: “Most distributions expect the mdadm.conf file in /etc/, not /etc/mdadm. I believe this is a “ubuntu-ism” to have it as /etc/mdadm/mdadm.conf”. Due to the fact that we are using Ubuntu here, we will just go with it.

注意:据说:“大多数发行版都期望/ etc /中的mdadm.conf文件,而不是/ etc / mdadm中的文件。 我认为将其命名为/etc/mdadm/mdadm.conf是一种“ ubuntu主义”。 由于我们这里使用Ubuntu,因此我们将继续使用它。

sudo mdadm --detail --scan --verbose > /etc/mdadm/mdadm.conf

sudo mdadm --detail --scan --verbose > /etc/mdadm/mdadm.conf

IMPORTANT! you need to remove one “0” from the newly created file because the syntax resulting from the command above isn’t completely correct (GNU/Linux isn’t an OS yet).

重要! 您需要从新创建的文件中删除一个“ 0”,因为上述命令产生的语法还不完全正确(GNU / Linux还不是OS)。

If you want to see the problem that this wrong configuration causes, you can issue the “scan” command at this point, before making the adjustment:

如果要查看此错误配置导致的问题,可以在进行调整之前在此时发出“ scan”命令:

mdadm --examine --scan

mdadm --examine --scan

To overcome this, edit the file /etc/mdadm/mdadm.conf and change:

为了解决这个问题,请编辑文件/etc/mdadm/mdadm.conf并更改:

metadata=00.90

metadata=00.90

To read:

读书:

metadata=0.90

metadata=0.90

Running the mdadm –examine –scan command now should return without an error.

现在,运行mdadm –examine –scan命令应该可以正确返回。

阵列上的文件系统设置 (Filesystem setup on the array)

I used ext4 for this example because for me it just built upon the familiarity of the ext3 filesystem that came before it while providing promised better performance and features. I suggest taking the time to investigate what filesystem better suits your needs and a good start for that is our “Which Linux File System Should You Choose?” article.

我在本示例中使用了ext4,因为对我而言,它只是建立在对ext3文件系统的熟悉之后,同时提供了更好的性能和功能。 我建议花些时间研究哪种文件系统更适合您的需求,为此一个好的开始是“我们应该选择哪种Linux文件系统? ”文章。

sudo mkfs.ext4 /dev/md0

sudo mkfs.ext4 /dev/md0

Note: In this case i didn’t partition the resulting array because, i simply didn’t need it at the time, as the requesting party specifically requested at least 3.5T of continuous space. With that said, had i wanted to create partitions, i would have had to use a GPT partitioning capable utility like “parted”.

注意:在这种情况下,我没有分区结果数组,因为当时我根本不需要它,因为请求方明确要求至少3.5T的连续空间。 话虽如此,如果我想创建分区,就不得不使用具有GPT分区功能的实用程序,例如“ parted”。

安装 (Mounting)

Create the mount point:

创建安装点:

sudo mkdir /media/raid10

sudo mkdir /media/raid10

Note: This can be any location, the above is only an example.

注意:这可以是任何位置,以上仅是示例。

Because we are dealing with an “assembled device” we will not use the filesystem’s UUID that is on the device for mounting (as recommended for other types of devices in our “what is the linux fstab and how does it work” guide) as the system may actually see part of the filesystem on an individual disk and try to incorrectly mount it directly. to overcome this we want to explicitly wait for the device to be “assembled” before we try mounting it, and we will use the assembled array’s name (“md”) within fstab to accomplish this. Edit the fstab file:

因为我们正在处理“组装设备”,所以我们将使用该设备上的文件系统的UUID进行挂载(如“ Linux fstab是什么以及它如何工作”指南中对其他类型的设备所建议)。系统实际上可能会在单个磁盘上看到文件系统的一部分,并尝试不正确地直接安装它。 为了克服这个问题,我们希望在尝试安装设备之前明确等待设备被“组装”,我们将在fstab中使用组装好的阵列名称(“ md”)来完成此操作。 编辑fstab文件:

sudo vim /etc/fstab

sudo vim /etc/fstab

And add to it this line:

并添加到这行:

/dev/md0 /media/raid10/ ext4 defaults 1 2

/dev/md0 /media/raid10/ ext4 defaults 1 2

Note: If you change the mount location or filesystem from the example, you will have to adjust the above accordingly.

注意:如果您从示例中更改安装位置或文件系统,则必须相应地调整以上内容。

Use mount with the automatic parameter (-a) to simulate a system boot, so you know that the configuration is working correctly and that the RAID device will be automatically mounted when the system restarts:

使用带有自动参数(-a)的mount来模拟系统引导,因此您知道配置工作正常,并且在系统重新启动时RAID设备将自动挂载:

sudo mount -a

sudo mount -a

You should now be able to see the array mounted with the “mount” command with no parameters.

现在,您应该可以看到没有参数的“ mount”命令安装的阵列。

RAID阵列的电子邮件警报 (Email Alerts for the RAID Array)

Unlike with hardware RAID arrays, with a software array there is no controller that would start beeping to let you know when something went wrong. Therefore the Email alerts are going to be our only way to know if something happened to one or more disks in the array, and thus making it the most important step.

与硬件RAID阵列不同,软件阵列没有控制器会发出哔哔声来通知您何时出现问题。 因此,电子邮件警报将成为了解阵列中一个或多个磁盘是否发生故障的唯一方法,从而使之成为最重要的步骤

Follow the “How To Setup Email Alerts on Linux Using Gmail or SMTP” guide and when done come back here to perform the RAID specific steps.

遵循“如何在Linux上使用Gmail或SMTP设置电子邮件警报”指南,完成后返回此处以执行RAID特定步骤。

Confirm that mdadm can Email The command below, will tell mdadm to fire off just one email and close.

确认mdadm可以通过电子邮件发送以下命令,告诉mdadm仅触发一封电子邮件并关闭。

sudo mdadm --monitor --scan --test --oneshot

sudo mdadm --monitor --scan --test --oneshot

If successful you should be getting an Email, detailing the array’s condition.

如果成功,您应该会收到一封电子邮件,详细说明阵列的状况。

Set the mdadm configuration to send an Email on startup While not an absolute must, it is nice to get an update from time to time from the machine to let us know that the email ability is still working and of the array’s condition. your probably not going to be overwhelmed by Emails as this setting only affects startups (which on servers there shouldn’t be many). Edit the mdadm configuration file:

设置mdadm配置以在启动时发送电子邮件尽管不是绝对必须的,但最好还是不时从计算机获取更新,以使我们知道电子邮件功能仍在起作用,并了解阵列的状况。 您可能不会被电子邮件淹没,因为此设置仅影响启动(在服务器上应该不会太多)。 编辑mdadm配置文件:

sudo vim /etc/default/mdadm

sudo vim /etc/default/mdadm

Add the –test parameter to the DAEMON_OPTIONS section so that it would look like:

-test参数添加到DAEMON_OPTIONS部分,使其看起来像:

DAEMON_OPTIONS="--syslog --test"

DAEMON_OPTIONS="--syslog --test"

You may restart the machine just to make sure your “in the loop” but it isn’t a must.

您可以重启机器只是为了确保您处于“循环中”,但这不是必须的。

Samba配置 (Samba Configuration)

Installing SaMBa on a Linux server enables it to act like a windows file server. So in order to get the data we are hosting on the Linux server available to windows clients, we will install and configure SaMBa. It’s funny to note that the package name of SaMBa is a pun on the Microsoft’s protocol used for file sharing called SMB (Service Message Block).

在Linux服务器上安装SaMBa,使其可以像Windows文件服务器一样工作。 因此,为了获得Windows客户端可用的托管在Linux服务器上的数据,我们将安装和配置SaMBa。 有趣的是,SaMBa的软件包名称是Microsoft用于文件共享的协议SMB(服务消息块)的双关语。

In this guide the server is used for testing purposes, so we will enable access to its share without requiring a password, you may want to dig a bit more into how to setup permissions once setup is complete.

在本指南中,服务器用于测试目的,因此我们将无需密码即可启用对服务器共享的访问,您可能想在设置完成后进一步了解如何设置权限。

Also it is recommended that you create a non-privileged user to be the owner of the files. In this example we use the “geek” user we have created for this task. Explanations on how to create a user and manage ownership and permissions can be found in our “Create a New User on Ubuntu Server 9.10” and “The Beginner’s Guide to Managing Users and Groups in Linux” guides.

另外,建议您创建一个非特权用户作为文件的所有者。 在此示例中,我们使用为此任务创建的“怪胎”用户。 有关如何创建用户以及管理所有权和权限的说明,请参见“在Ubuntu Server 9.10上创建新用户”和“在Linux中管理用户和组的初学者指南”指南。

Install Samba:

安装Samba:

aptitude install samba

aptitude install samba

Edit the samba configuration file:

编辑samba配置文件:

sudo vim /etc/samba/smb.conf

sudo vim /etc/samba/smb.conf

Add a share called “general” that will grant access to the mount point “/media/raid10/general” by appending the below to the file.

添加一个名为“ general”的共享,该共享通过将以下内容附加到文件来授予对挂载点“ / media / raid10 / general”的访问权限。

[general]
path = /media/raid10/general
force user = geek
force group = geek
read only = No
create mask = 0777
directory mask = 0777
guest only = Yes
guest ok = Yes

[general]
path = /media/raid10/general
force user = geek
force group = geek
read only = No
create mask = 0777
directory mask = 0777
guest only = Yes
guest ok = Yes

The settings above make the share addressable without a password to anyone and makes the default owner of the files the user “geek”.

上面的设置使共享无需密码即可寻址到任何人,并使文件的默认所有者成为用户“极客”。

For your reference, this smb.conf file was taken from a working server.

供您参考,该smb.conf文件是从正常工作的服务器上获取的。

Restart the samba service for the settings to take affect:

重新启动samba服务以使设置生效:

sudo /etc/init.d/samba restart

sudo /etc/init.d/samba restart

Once done you can use the testparm command to see the settings applied to the samba server. that’s it, the server should now be, accessible from any windows box using:

完成后,您可以使用testparm命令查看应用于samba服务器的设置。 就是这样,服务器现在应该可以通过以下任何窗口窗口访问:

\server-namegeneral

\server-namegeneral

故障排除 (Troubleshooting)

When you need to troubleshoot a problem or a disk has failed in an array, I suggest referring to the mdadm cheat sheet (that’s what I do…).

当您需要解决问题或阵列中的磁盘出现故障时,建议您参考mdadm备忘单(这就是我的工作……)。

In general you should remember that when a disk fails you need to “remove” it from the array, shutdown the machine, replace the failing drive with a replacement and then “add” the new drive to the array after you have created the appropriate disk layout (partitions) on it if necessary.

通常,您应该记住,当磁盘出现故障时,您需要从阵列中“删除”它,关闭计算机,用替换磁盘替换发生故障的驱动器,然后在创建适当的磁盘后将新驱动器“添加”到阵列中。必要时在其上进行布局(分区)。

Once that’s done you may want to make sure that the array is rebuilding and watch the progress with:

完成后,您可能需要确保阵列正在重建,并通过以下方式观察进度:

watch -d cat /proc/mdstat

watch -d cat /proc/mdstat

Good luck! :)

祝好运! :)

References: mdadm cheat sheet RAID levels break down Linux RAID10 explained mdadm command man page mdadm configuration file man page Partition limitations explained

参考: mdadm备忘单RAID级别崩溃Linux RAID10解释了mdadm命令手册页mdadm配置文件手册页分区限制说明



Using software RAID won’t cost much… Just your VOICE ;-)

使用软件RAID不会花费太多……只是您的VOICE ;-)

翻译自: https://www.howtogeek.com/51873/how-to-setup-software-raid-for-a-simple-file-server-on-ubuntu/

ubuntu raid0

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值