Wishlist 0 ¥0.00

How to set up your own Mail Server

How to set up your own Mail Server


 

Google, Yahoo, Hotmail …, chances are almost every single one of us have an email account and have used it for work/ communication/ study and much more. Also chances are that we have sent an email to someone across the world, or have received the odd mail from Nigerian princes and the like! But for whatever purpose, and regardless of the distance that the email had to travel, the process works so fast and is so common that very few of us ever stop to think for a second of how it all actually works. In this article we will try to find out and answer the questions of what is a mail server and more interestingly, how to set up your own mail server!

  • What is a Mail Server?

A mail server is a computer system that sends and receives email. In many cases, web servers and mail servers are combined in a single machine. However, large ISPs and public email services (such as Gmail and Hotmail) may use dedicated hardware for sending and receiving email. Every email that is sent passes through a series of mail servers along its way to its intended recipient. Although it may seem like a message is sent instantly, the reality however is that a complex series of transfers takes place. Without this series of mail servers, you would only be able to send emails to people whose email address domains matched your own – i.e., you could only send messages from one example.com account to another example.com account.

But how could you set up your own E-mail server? There are a number of ways, and in this article we will explain the simplest ways to do it on Windows.

  • How to set up your own E-mail Server:
Option A) hMailServer

hMailServer is one of the best free, open-source email servers for Windows which is commonly used by ISPs, governments, educational institutions and more. The advantage is that it also comes with built-in spam control by SpamAssassin and supports a fast and easy download/Installation.

Step 1) Go to hMailServer and go to “download” on top of the page

 

Step 2) Download the latest version

 

Step 3) When you’ve downloaded it, run the Installer. In the below screen, select “Server” only if you want your local computer to work as a server. If you set up a server elsewhere, only select “Administrative tools” to remotely manage that server.

 

Step 4) you will have to set up a password during installation.

Note: Since you will need it every time you launch the application we would highly recommend writing it down somewhere safe.

 

Step 5) once the dashboard is open, enter a new website domain (with SMTP enabled from a hosting provider). After creating the domain, head towards “Protocols” followed by “SMTP.” Here, you must set up the Local host name as “localhost.”

 

Step 6) finally, click the “Accounts” item. Here, you can create an email address for which you need prior access to a top-level domain name and its DNS settings. Basically, every time you send an email, the message first gets stored in hMailServer and is later relayed to the IP address of the DNS.

You can also enable options for auto-reply, forwarding, greylisting, DNS blacklists and more in hMailServer. But, we will reserve these options for the below step. Once your email server has been successfully set up, you will need a client like Thunderbird or Outlook Express to read/write those emails.

Option B) Set up hosted e-mail using Thunderbolt client:

Step 1) Download and install Mozilla Thunderbird. Here, you have to set up an email account. Use the same email ID and password that you would normally use with the web-hosting provider.

 

Step 2) In the next screen, you are going to fine-tune your Thunderbird client settings by clicking “Manual Config”.

At this stage, you must set up your existing email account. The server hostname should be “localhost,” as you previously enabled those settings with hMailServer. As per hMailServer guidelines, use “143” for IMAP port, “993” for IMAP via SSL/TSL and either “465” or “587” for SMTP port.

 

Step 3) you can also change server settings from the Thunderbird account. Once the email address has been configured with the client, you can readily start using your new web host’s email service.

 

Step 4) Use Thunderbird mail client to run as many private email instances on hMailServer as you want. The email server is up and running and configured with the original email.

 

 

Google, Yahoo, Hotmail …, chances are almost every single one of us have an email account and have used it for work/ communication/ study and much more. Also chances are that we have sent an email to someone across the world, or have received the odd mail from Nigerian princes and the like! But for whatever purpose, and regardless of the distance that the email had to travel, the process works so fast and is so common that very few of us ever stop to think for a second of how it all actually works. In this article we will try to find out and answer the questions of what is a mail server and more interestingly, how to set up your own mail server!

  • What is a Mail Server?

A mail server is a computer system that sends and receives email. In many cases, web servers and mail servers are combined in a single machine. However, large ISPs and public email services (such as Gmail and Hotmail) may use dedicated hardware for sending and receiving email. Every email that is sent passes through a series of mail servers along its way to its intended recipient. Although it may seem like a message is sent instantly, the reality however is that a complex series of transfers takes place. Without this series of mail servers, you would only be able to send emails to people whose email address domains matched your own – i.e., you could only send messages from one example.com account to another example.com account.

But how could you set up your own E-mail server? There are a number of ways, and in this article we will explain the simplest ways to do it on Windows.

  • How to set up your own E-mail Server:
Option A) hMailServer

hMailServer is one of the best free, open-source email servers for Windows which is commonly used by ISPs, governments, educational institutions and more. The advantage is that it also comes with built-in spam control by SpamAssassin and supports a fast and easy download/Installation.

Step 1) Go to hMailServer and go to “download” on top of the page

 

Step 2) Download the latest version

 

Step 3) When you’ve downloaded it, run the Installer. In the below screen, select “Server” only if you want your local computer to work as a server. If you set up a server elsewhere, only select “Administrative tools” to remotely manage that server.

 

Step 4) you will have to set up a password during installation.

Note: Since you will need it every time you launch the application we would highly recommend writing it down somewhere safe.

 

Step 5) once the dashboard is open, enter a new website domain (with SMTP enabled from a hosting provider). After creating the domain, head towards “Protocols” followed by “SMTP.” Here, you must set up the Local host name as “localhost.”

 

Step 6) finally, click the “Accounts” item. Here, you can create an email address for which you need prior access to a top-level domain name and its DNS settings. Basically, every time you send an email, the message first gets stored in hMailServer and is later relayed to the IP address of the DNS.

You can also enable options for auto-reply, forwarding, greylisting, DNS blacklists and more in hMailServer. But, we will reserve these options for the below step. Once your email server has been successfully set up, you will need a client like Thunderbird or Outlook Express to read/write those emails.

Option B) Set up hosted e-mail using Thunderbolt client:

Step 1) Download and install Mozilla Thunderbird. Here, you have to set up an email account. Use the same email ID and password that you would normally use with the web-hosting provider.

 

Step 2) In the next screen, you are going to fine-tune your Thunderbird client settings by clicking “Manual Config”.

At this stage, you must set up your existing email account. The server hostname should be “localhost,” as you previously enabled those settings with hMailServer. As per hMailServer guidelines, use “143” for IMAP port, “993” for IMAP via SSL/TSL and either “465” or “587” for SMTP port.

 

Step 3) you can also change server settings from the Thunderbird account. Once the email address has been configured with the client, you can readily start using your new web host’s email service.

 

Step 4) Use Thunderbird mail client to run as many private email instances on hMailServer as you want. The email server is up and running and configured with the original email.

 

 
 

 

hMailServer安装使用教程

1 - Install hMailServer

Download hMailServer from here: http://www.hmailserver.com/index.php?page=background_download_file&downloadid=207.

  • In setup, select internal db engine.
  • Now you have a service called hMailServer and an administration program on the Windows start menu (hMailServer Administrator).

2 - Create a domain

  • Open hMailServer Administrator program.
  • Click on "Domains" and then "add domain".
  • At "domain name" put a fake domain to test. Use "localhost.com" (without the quotes): hMailServer requires a fully qualified domain, so, we cannot use @localhost.
  • Make sure to add your domain (localhost.com) to hosts file: C:\windows\system32\drivers\etc\hosts

3 - Change server name

  • Expand Settings > Protocols > SMTP -> Delivery of e-mail
  • At "Host name" put "localhost" (without the quotes).
  • Check if TCP Port is 25.

4 - Create an account

  • Go to "Domains", click on the created domain, and then click on "accounts", then "add account".
  • At "address", create your account name, here I use "rael" (without the quotes), and put a password.
  • Change "Administration level" to "Server".

5 - Configure "catch-all" address

  • Enabling this, you can use any email address ending with you fake domain. Example: here, my unique account is This email address is being protected from spambots. You need JavaScript enabled to view it.. But while testing systems, I can use any address like This email address is being protected from spambots. You need JavaScript enabled to view it., This email address is being protected from spambots. You need JavaScript enabled to view it., etc, because all will be redirected to This email address is being protected from spambots. You need JavaScript enabled to view it.
  • Open "Domains", click on your domain, open Advanced tab, fill field "catch-all address" with account created on previous step.

6 - Configure an Email client

  • At Windows, you can use Windows Live Email (http://explore.live.com/windows-live-essentials-other-programs?T1=t2).
  • Of course, you can use any email client.
  • While configuring
    • Incoming Server is POP3, and the username is the full email address (like This email address is being protected from spambots. You need JavaScript enabled to view it.), and the password is raw text (no encrypt).
    • POP3 and SMTP server are "localhost" (without the quotes).
    • Outgoing server do not require authentication.
  • Don't use the email client and the hMailServer Administration application at the same time!

The 11 Best Free Email Accounts and Service Providers of 2021

You need it for networking, job recruitment, downloading resources, transferring files, setting reminders, meeting with colleagues, and so much more.

Even with the rise of office chat platforms, you still depend on email for a surprising number of things. But unfortunately, not every email service is completely free. And even the free ones might not be the easiest to use or have all the features you need.

It can be a challenge to find an email service provider at no cost that balances the right features with usability. To help make your search easier, we put together a list of the different types of email accounts you can set up, followed by the eleven best email service providers you can host your account on right now for free.

Types of Email Accounts

There are two main types of email service providers to choose from: email clients and webmail. When you use your provider to access your email from a different device or location online, you can use one of three major email protocols to do so: POP3, IMAP, and Exchange.

Let's briefly go over these different types of providers and protocols.

Email Clients

Email clients are software applications that you install onto the computer itself to manage the email you send and receive. To access this email, the client interacts with a remote email server.

Email clients you've likely heard of include Microsoft Outlook, Mozilla Thunderbird, and Apple Mail.

If you want to access this type of email from the web, rather than the client's computer application, the email client uses one of the email protocols described below. For example, although you might have Outlook installed on your computer, you can also log in to your email account via outlook.com using a specific email protocol.

Webmail

Webmail is a form of email you access exclusively from the internet, and therefore exists primarily on the cloud rather than your computer. Instead of an installed application fetching your email, you manage your inbox right from your internet browser.

Webmail providers you've likely heard of include Gmail, Yahoo! Mail, and AOL (all of which have made our list of best free email accounts, below).

If you want to access your webmail from a mail app on your mobile device, rather than your desktop web browser, your webmail provider can use one of the email protocols described below.

Now, before we get into the best free email accounts, let's talk about those email protocols.

Email Protocols

Email protocols are the systems that actually retrieve your email for you. They can be used to fetch email client accounts on the internet, and fetch webmail accounts on a mobile app. Here are the three main types of email protocol your account can use.

POP3

POP stands for "post office protocol," and is best suited for people who have just one email account and email client. POP3 is the latest version of this email protocol, and allows you to access email while offline. It therefore requires less internet bandwidth.

IMAP

IMAP stands for "internet mail access protocol," and is one of the older email protocol available today. IMAP4 is considered the latest version, and unlike the POP protocol, you do not download your email to your offline email client. Instead, all your email stays online while you're accessing and managing it.

IMAP is particularly useful for people who have more than one email account and access them from multiple devices or locations.

Exchange

Exchange is a Microsoft email protocol, and is pretty similar to the IMAP protocol explained above. This protocol allows you to not only access your email over the internet from multiple devices, but also tasks, calendars, and contact information tethered to that email address. For this reason, it's particularly helpful to organizations whose employees share many types of information and collaborate remotely.

Now, take a look at seven of the best free email service providers you can get your hands on today -- both webmail and email clients included. For each email service provider, we highlighted a unique feature to help you find the best fit.

1. Gmail

Unique Feature: Native File Collaboration

Sign up here.

Type of email: Webmail

Who should use it: anyone who already uses and loves the rest of Google's products.

It might seem like an obvious top pick, but Gmail is just too versatile to not award the first slot. Gmail has the second-highest email provider market share (behind Apple iPhone's native email app), according to Litmus Labs. And ironically, one of the reasons Gmail has become so popular is because of all the communication options in your inbox that don't involve email.

Gmail is an everyday email inbox you can sign up for by registering for a Google account. But it's built into Google Suite, a group of free apps that allow you to chat, video-conference, and share files with the people in your contact list.

Google Hangouts, available from your inbox's left sidebar (or the right -- you can customize how you inbox is displayed), lets you text and video chat with other Gmail users for the things that might not warrant an email message. Like most other email accounts today, Gmail also has an intuitive calendar where you can set meetings and reminders.

Pro tip: You can also use a free product like HubSpot Meetings to easily schedule meetings without back-and-forth emails.

Unlike other email accounts, you can use your Gmail address to log into and manage your YouTube account, as well as collaborate on shared documents and spreadsheets right from a cloud-based Google Drive.

Offering a generous 15 GB of free email storage, Gmail does everything it can to make your inbox less chaotic, including advanced filters that automatically push emails into separate folders as they arrive. And none of these functions costs a dime.

2. AOL

Unique Feature: Unlimited Storage

Sign up here.

Type of email: Webmail

Who should use it: people who use email for most of their communication.

America Online (I feel nostalgic just typing those words) has quietly kept up with today's standards for a good user experience. The classic AOL is now once again one of the best free email accounts available to you.

Purchased by Verizon in 2015, AOL delivers you email from its classic news-driven homepage, and comes with the contemporary spam filters and virus protection you'd expect from your email provider. You can also send text and instant messages from specific windows in your email inbox.

AOL does have something over Gmail, though: unlimited storage. Additionally, you can import email contacts from a CSV, TXT, or LDIF file so you're not creating your "buddy list" (get it?) from scratch.

3. Outlook

Unique Feature: Multiple App Integrations

Sign up here.

Type of email: Email client

Who should use it: people who use many different platforms to connect with others.

If you ever cringed at the sight of a "Hotmail.com" email address, you can thank Outlook for this outdated domain name. But there's good news: Microsoft has reinvented its longstanding email service, and your free Outlook.com email address has many progressive features waiting for you.

While it touts a calendar and message filter that is similar to Gmail, Outlook also integrates with a number of other popular communication apps. You can connect Skype, Facebook, PowerPoint, PayPal, and even task-management software such as Trello -- making it very easy to reach and work with non-Outlook users without leaving your inbox.

Outlook offers 15 GB of free storage for each user, along with a super-clean interface.

4. Zoho

Unique Feature: 25 Business Addresses

Sign up here.

Type of email: Webmail

Who should use it: startups and small businesses.

This is the first of the lesser-known free email accounts to make our list, but it holds a lot of potential for businesses.

The first thing you'll notice about Zoho is its user-friendliness. From integrating with Google Drive, Box, and other cloud-based file managers, to its built-in task manager, this email service offers a simple way to accomplish all of your daily tasks.

The real difference-maker, though, is the ability to customize the domain name for up to 25 connected email addresses. Want to replace "@zoho.com" with the name of your business's website? You can do so under Zoho Lite, which gives you 5 GB for free -- all under This email address is being protected from spambots. You need JavaScript enabled to view it..

5. Mail.com

Unique Feature: 200 Custom Domain Names

Sign up here.

Type of email: Webmail

Who should use it: small businesses, freelancers, and the self-employed.

It doesn't get more self-explanatory than "Mail.com," does it? This email provider knows its audience -- or should I say, audiences.

Right off the bat, you'll probably notice Mail.com doesn't have stellar storage space compared to the options above: only 2 GB. But what this webmail service lacks in gigabytes it makes up for with … drumroll … 200 free custom domain names. You can replace "@mail.com" at the end of your username with just about anything that describes you. Here are some options Mail.com has precreated for you to choose from:

  • Bartender.net
  • Musician.org
  • Columnist.com
  • Engineer.com
  • Accountant.com
  • Toothfairy.com (who knew she was online?)

Mail.com doesn't rest on its 200 laurels, though, as the email provider also comes with a calendar for creating and tracking your events each week.

6. Yahoo! Mail

Unique Feature: Media and attachment history

Sign up here.

Type of email: Webmail

Who should use it: creatives and those who send and receive attachments frequently via email.

Yahoo! Mail, another well-known platform, sits just behind AOL in storage space with a whopping 1 TB (that's a terabyte) for free, along with a few key social media integrations.

In addition to custom background themes and being able to search key information from your inbox, Yahoo! Mail also makes it easy to find every photo, video, and document you've ever attached or received via email in their own tabs on your inbox's sidebar. This makes the platform especially appealing to those who share documents on a regular basis or simply want an album made of every photo they've ever had shared.

7. ProtonMail

Unique Feature: Encrypted email

Sign up here.

Type of email: Webmail

Who should use it: people who send and receive sensitive information.

ProtonMail offers just 500 MB of free space, but for the worthy trade of encrypted email, allowing you to send messages that nobody else can see, and disappear after a month.

What's the catch? Is the service hard to use? As with most webmail platforms, ProtonMail is easy to use on any device without any software needed to encrypt your emails. Its inbox interface is as easy to understand at a glance as the other email services on this list, and offers quick color-coded labels to help you further organize which emails deserve the most care and protection.

8. iCloud Mail

Unique Feature: Label senders as VIPs

Sign up here.

Type of email: Webmail

Who should use it: people who use Mac and want everything on one system.

If you’re a Mac user, you may want to consider using iCloud Mail as your email provider. Their free email account comes with 5GB of storage that you can use to sync your photos, files, or email. It’s important to note that storage is shared between all of your apps and devices — so if you take a lot of photos on your iPhone, you may eat into your email storage allowance for the month. Upgraded plans start at $0.99/month and go up to $9.99/month.

One of the biggest advantages of using iCloud over other email providers on this list is the ease of integration. Apple builds its desktop and iPhone mail apps with all email clients in mind, but it pays special attention to making the experience delightful for iCloud users. 

Some of the pros of iCloud Mail include an easy to use search functionality, easy-to-use rules, and an ability to label senders as VIP. When a contact is marked as VIP, new messages will automatically filter to a separate tab on the left, saving you both time and energy. 

9. GMX Mail

Unique Feature: Alias email addresses

Sign up here.

Type of email: Webmail

Who should use it: people who need multiple emails with one central inbox.

While you may not have heard of GMX Mail, it’s been around for quite a while (since 1997) — and it has a bunch of features that make it worth considering. First off, GMX offers 65GB of storage. That’s a lot of storage for a free email service. In fact, they claim that allows you to keep nearly half a million messages in your Inbox!

Another feature worth noting is the ability to send large attachments. While many services have caps for your email attachments, GMX Mail allows you to send files up to 50GB. That’s great if you share a ton of photos, presentations, or other large files from your account.

But the feature of GMX Mail that really sets it apart is the ability to set up to 10 alias email addresses all from within one account. This can be useful in many situations — both personally and professionally. On a personal note, you could use one alias for all of your online purchases and logins — to keep marketing emails separate from your personal messages. From a business perspective, multiple email addresses can be useful for managing role based emails such as This email address is being protected from spambots. You need JavaScript enabled to view it. or This email address is being protected from spambots. You need JavaScript enabled to view it..

10. Mozilla Thunderbird

Unique Feature: Customization features, and the ability to open multiple emails in tabs

Sign up here.

Type of email: Email clients

Who should use it: anyone looking for a simple, but customizable email inbox.

Thunderbird, a free email application from Mozilla, known for Firefox, offers a quick email inbox setup and a simple, easy-to-use user interface.

The app offers customizable features, such as theme settings and app extensions that can improve your email experience. The email app also allows you to open multiple emails in tabs, similarly to how you would open multiple web pages in Firefox browsers.

11. Yandex Mail

Unique Feature: 10 GB of free cloud storage

Sign up here.

Type of email: Webmail

Who should use it: anyone seeking a free email with additional storage capabilities.

Yandex is a Russian web company that offers a global email tool. With the tool, you can sign up for a free account, link it to your Facebook, Twitter, or Gmail accounts, and personalize your email inbox.

Like many of the other providers on this list, Yandex's email inbox can be set to filter or prioritize emails so you see messages from real people. It can also recognize keywords in messages and subject lines and organize emails into categorized inboxes. Additionally, users who sign up for Yandex mail get 10 GB of free cloud storage.

Making the Most of Your Email

And with that, you have some of the best options for free email accounts this year. But who knows? Your next email address could be entirely different while giving you just what you need to succeed.

Once you've chosen an email provider and launched a new email address specifically for your marketing needs, you should also leverage apps, outside software, and APIs to add to your email strategy.

One powerful tool worth noting is HubSpot's Free Email tool. The tool allows you to link your email address to the HubSpot CRM, while also allowing you to build email templates and send messages straight from the HubSpot software. Even more beneficial? The software even lets you track basic analytics and collect email subscriber contacts in your CRM -- which can then be added to your email marketing lists.

磁盘、磁盘分区和Linux文件系统

一、磁盘
磁盘(disk)是指利用磁记录技术存储数据的存储器。
磁盘是计算机主要的存储介质,可以存储大量的二进制数据,并且断电后也能保持数据不丢失。早期计算机使用的磁盘是软磁盘(Floppy Disk,简称软盘),如今常用的磁盘是硬磁盘(Hard disk,简称硬盘)。

解决方法

1. 利用注册表解决磁盘被保护:
进入注册表器,单击开始菜单---选择运行“REGEDIT
找到HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies项,将右侧窗口中名为WriteProtect的键值改为0,若没有这个选项键值就在同目录下建立这一项并把键值改成0。
2. 更改磁盘策略
当重启后再次出现写保护问题时请进行如下操作
1、选择U盘符右键-属性-硬件
2、选择U盘以清华普天为例如图示
3、选择属性-策略
4、将策略改为如图所示。
问题解决。因为本人是按照如上两个步骤进行的更改,各位网友可以不用转化格式进行后面的更改策略的方法试一下是否可行,如可行最!除修改注册表方法外两种只能当次解决U盘的写保护,请谨慎选用, 最好不要进行转化格式操作,如果进行了格式转换,FAT32转NTFS数据不会丢失,待U盘恢复正常后可格式化至FAT32, FAT32至NTFS转化简单,但反过来就麻烦了,并且转完后数据易丢失。

故障分析

进入“我的电脑”本地磁盘双击打不开的情况很普遍,只能通过资源管理器打开。双击打不开盘符的状况一般都是autorun病毒引起,通常我们的解决方法如下:

删除文件

打开“我的电脑”,依次单击“工具→文件夹选项→查看”,选中“显示所有文件和文件夹”后“确定”,然后用“资源管理器”打开各个分区,若发现各分区根目录下有autorun.inf隐藏文件,删除它们并重启电脑。

重设法

同样打开“我的电脑”,依次单击“工具→文件夹选项→文件类型”,找到“驱动器”并选中,然后单击“高级”按钮,弹出“文件类型”窗口,再单击“新建”,如图,在操作里输入“open”,在“用于执行操作的应用程序”里输入“explorer.exe”,点“确定”后返回到“文件类型”窗口,选中“open”且单击“设为默认值”,最后单击“确定”,重新启动电脑试试看。

注册表法

打开注册表器,定位至“HKEY_CLASSES_ROOT\Drive\shell”分支,将其下的键值全部删除,保存后退出注册表器。

发展历史

在过去的50年中,磁盘驱动器走过了很长的一段路。请跟随我们走过这段历史,回首我们按年度列出的磁盘驱动器发展史上50件具有里程碑意义的事件——从最早推出的产品到各种新技术以及在这中间的一切。
1956年:IBM向客户交付第一台磁盘驱动器RAMAC 305,可存储5MB数据,每MB成本为10000美元。它有2个冰箱那样大,使用50个24英寸盘片。
1961年:IBM发明在空气垫上或“空气支撑物”上“悬浮”的磁盘驱动器磁头。
1963年:IBM推出第一个活动磁盘驱动器1311,拥有6个14英寸盘片,可存储2.6MB数据。
1966年:IBM推出第一个使用缠绕线圈铁氧记录磁头的驱动器。
1970年:通用数据公司(1971年更名为西部数据公司)在加州成立。
1973年:IBM宣布推出第一个现代“温彻斯特”磁盘驱动器3340,使用了密封组件、润滑主轴和小质量磁头。
1978年:第一个RAID(冗余阵列)驱动器诞生。
1979:磁盘制造商希捷科技公司于1979年由Al Shugart挑头创立。
1979:IBM的3370使用了7个直径为14英寸的盘片,存储容量可达571MB。3370也是首款使用薄胶片磁头的磁盘,
1979:IBM的“Piccolo”电脑磁盘使用了6个直径为8英寸的盘片,存储容量可达64MB。
1979:希捷科技公司研发出最早的磁盘接口——ST-506,之后便广泛用于微型计算机中。
1980:IBM发布了当时首个存储容量以GB为单位的磁盘,其大小和一台电冰箱大小差不多,重量为250kg,出售价格为40000美元。
1980:希捷科技公司发布首个大小为5.25英寸的磁盘。
1981:Shugart Associates联手NCR共同研发出一个智能磁盘接口,命名为Shugart Associates Systems Interface (SASI),该接口是SCSI(Small Computer System Interface,小型计算机系统接口)的前辈。
1982:Western Digital宣布推出了首个单芯片“温彻斯特”磁盘控制器——WD1010。
1983:Rodime宣布推出了当时首个3.5英寸的磁盘——RO352,它包括有两个盘片,存储容量可达10MB。
1984:Western Digital为IBM PC/AT制造出首个“温彻斯特”磁盘控制卡,并成为了当时的一种工业标准。
1985:Control Data、Compaq Computer和 Western Digital共同合作,并研发出40-pin的IDE接口。IDE是Intelligent Drive Electronics(智慧电子驱动器)的缩写。
1985:磁盘控制器首次整合到磁盘驱动当中。
1985:Quantum(昆腾)发布了Plus Hardcard磁盘,它在无需一个可用的插槽,或单独控制卡的情况下,可再多配置一个磁盘。
1985:Western Digital宣布推出了首款ESDI(Enhanced Small Device Interface,增强型小型设备接口)控制板,它允许容量更大、速度更快的磁盘用于电脑当中。
1986:官方的SCSI规格发布,而苹果电脑公司的Mac Plus也是首台使用该规格的电脑之一。
1988:Prairie Tek宣布推出了220磁盘,这是首个2.5英寸的磁盘,主要是针对初生的笔记本电脑市场推出的。220磁盘使用了两个盘片,存储容量可达20MB。
1988:Connor发布了首个高为1英寸的3.5英寸磁盘,还有磁盘沿袭了这种设计。
1988:Western Digital成功收购Tandon公司,转型为专业的磁盘制造商。
1990:Western Digital发布了其首个3.5英寸的Caviar(鱼子酱) IDE磁盘。
1991:IBM向外界宣布推出了0663 Corsair,这是首款采用感应式薄胶片磁阻(MR)磁头的磁盘。它设计有8个直径为3.5英寸的盘片,存储容量可达1GB。(MR磁头早在1984年就用于IBM的磁盘驱动器。)
1991:Integral Peripherals推出了使用一个直径为1.8英寸的盘片,存储容量可达21MB 的1820 Mustang磁盘。
1992:希捷科技公司首次向外界展示了其2.5英寸的磁盘,在当时给了人们极大的震撼。
1992:希捷科技公司成功的推出了存储容量为2.1GB的Barracuda(酷鱼),这是首个采用7200r/min转速马达的磁盘。
1992:惠普推出了C3013A Kitty Hawk磁盘,使用了两个直径为1.3英寸的盘片,存储容量可达2.1GB。
1994:Western Digital成功研发出Enhanced IDE,这是一个改良版的磁盘接口,并打破了当时528MB存储容量上限的束缚。EIDE同样也允许配置光驱和磁盘驱动器。
1996:IBM成功研发出在1个盘片上可存储100亿比特/英寸的磁盘技术。
1996:希捷科技公司宣布推出了其Cheetah(捷豹)系列磁盘,这是首个采用10000r/min转速马达的磁盘。
1997:IBM宣布推出了首个采用巨磁阻磁头(GMR)的磁盘——Deskstar 16GP Titan,在三个直径为3.5英寸的盘片上可装配16.8GB的存储容量。
1998:IBM宣布推出了Microdrive(微磁盘),这是当时世界上最小的磁盘,一个单一的1英寸盘片的容量可达340MB。
2000:Maxtor(迈拓)成功收购了其竞争对手Quantum的磁盘业务。就当时的情况而言,Quantum是世界上第二大磁盘制造商,仅仅位于希捷技术公司之后。而成功收购了Quantum以后,Maxtor便一举成为世界上最大的磁盘制造商。
2000:希捷科技公司发布了首款采用15000r/min转速马达的磁盘——Cheetah X15。
2002:希捷科技公司在磁盘历史又获得了一个第一的称号,这都是因为它发布了Barracuda ATA V Serial ATA磁盘。
2002:希捷科技公司向外界演示了垂直磁性记录技术,每英寸的密度可达100GB。
2002:其实,在2002年有很多技术值得我们去记住,但希捷科技公司成功演示的Heat-Assisted Magnetic Recording(热辅助磁记录,HAMR)技术却格外耀眼,HAMR磁性记录技术采用了激光热辅助设计。
2003:IBM宣布把其数据存储部门出售给日立,IBM由此也结束了在磁盘领域的辉煌历程。
2003:Western Digital推出了首个10000r/min的 SATA磁盘——Raptor(猛禽),存储容量为37GB。该款产品主要是为企业设计的,但是游戏玩家很快就发现,其实把该磁盘用于双磁盘RAID配置中,使得台式电脑的性能会有很大的提升。
2004:东芝宣布推出了世界上首款0.85英寸的磁盘——MK2001MTN,在一个单一的盘片上,存储容量可达2GB。
2005:东芝宣布推出了MK4007 GAL,该磁盘采用了直径为1.8英寸的盘片设计,存储容量为40GB。同时,MK4007 GAL也是首款采用垂直磁性记录设计的磁盘。
2006:希捷科技公司成功收购了Maxtor,使得其在磁盘制造工业的竞争对手再度缩小。
2006:希捷科技公司宣布推出了Momentus 5400.3笔记本电脑磁盘,这是首款采用垂直磁性记录设计的2.5英寸磁盘型号,其存储容量也达到160GB。
2006:希捷科技公司发布了当今世界上存储容量最大的磁盘——Barracuda 7200.10,存储容量达到了750GB。
2006:Western Digital宣布推出了10000r/min Raptor X SATA磁盘,其存储容量达到了150GB。不仅如此,Raptor X还采用了透明的外观设计,用户可以看到它运作时内部的情况。
2006:Cornice和希捷技术这两家公司都在2006年宣布推出了1英寸磁盘,存储容量为12GB。

产生起源

可是不久之后,人们又发现了另一个问题:人们要存储到磁盘上的内容越来越多,众多的信息存储在一起,很不方便。这样就导致了文件的产生。
 
二、硬盘分区
硬盘分区是指将硬盘的整体存储空间划分成多个独立的区域,分别用来安装操作系统、安装应用程序以及存储数据文件等。但在分区之前,应该做一些准备及计划工作,包括一块硬盘要划分为几个分区,每个分区应该有多大的容量,以及每个分区准备使用什么文件系统等。对于某些操作系统而言,硬盘必须分区后才能使用,否则不能被识别。通常,从文件存放和管理的方便、容易、快捷性出发,建议将硬盘划分多个分区,用以存放不同类型的文件,如存放操作系统、应用程序、数据文件等。
硬盘分区是在一块物理硬盘上创建多个独立的逻辑单元,这些逻辑单元就是C盘、D盘、E盘等。硬盘分区从实质上说就是对硬盘的一种格式化。

定义

硬盘分区,是指将硬盘的整体存储空间划分成多个独立的区域,分别用于操作系统、应用程序以及数据文件等。但在分区之前,应该做一些准备及计划工作,包括一块硬盘要划分为几个分区,每个分区应该有多大的容量,以及每个分区准备使用什么文件系统等。对于某些操作系统而言,硬盘必须分区后才能使用,否则不能被识别。通常,从文件存放和管理的方便、容易、快捷性出发,将硬盘划分多个分区,用以存放不同类型的文件,如存放操作系统、应用程序、数据文件等
硬盘分区是指在一块物理硬盘上创建多个独立的逻辑单元,以方便文件管理与使用,这些逻辑单元就是所谓的C盘、D盘、E盘等。硬盘分区从实质上说就是对硬盘的一种格式化

分区原则

随着科技的发展,硬盘的容量越来越大,市场上1TB或2TB的大容量硬盘已经很常见。大容量硬盘给用户提供更多存储空间的同时,也使得在创建硬盘分区之前,好好地规划硬盘分区的方案成为必要。下面给出硬盘分区应该遵循的一些基本原则,以方便用户更好地管理自己的硬盘
1.为C盘选择合适分区格式
C盘一般都是系统盘,安装主要的操作系统,通常有FAT32和NTFS两种选择。如果是安装 Windows Xp,则使用FAT32要更加方便一些。因为在C盘的操作系统损坏或清除开机加载的病毒木马时,往往需要用启动工具盘来修复。而很多启动工具盘大多数情况下不能辨识NTFS分区,从而无法操作C盘。如果是安装 Windows7,则只能选择NTFS格式
2.C盘不宜太大
C盘是系统盘,硬盘的读/写比较多,发生错误和磁盘碎片的几率也较大,扫描磁盘和整理碎片是日常工作,而这两项工作的所需时间与磁盘的容量密切相关。C盘的容量过大,往往会使这两项工作速度很慢,从而影响工作效率
3.逻辑分区使用NTFS分区
NTFS文件系统是一种基于安全性及可靠性的文件系统,除兼容性之外,它远远优于FAT32。它不但可以支持2TB大小的分区,而且支持对分区、文件夹和文件的压缩,可以更有效地管理磁盘空间。因此,除了在主系统分区为了兼容性而采用FAT32以外,其他分区采用NTFS比较适宜。
4.双系统乃至多系统好处多
如今木马、病毒泛滥,系统缓慢、无法启动都是常见的事情。一旦出现这种情况,重装、杀毒要消耗很多时间。有些顽固的开机加载的木马和病毒甚至无法在原系统中删除,而此时如果有一个备份的系统就显得很有必要,启动到另一个系统,可以从容地杀毒、删除木马、修复另一个系统。即使不做处理,也可以用另一个系统展开工作,不会因为电脑问题耽误事情。因此,双系统乃至多系统好处很多分区中除了C盘外,再保留一个或两个备用的系统分区很有必要,该备份系统分区还可同时安装一些软件程序,容量大概20GB左右即可。
5.系统、程序、资料分离
Windows默认把“我的文档”等一些个人数据资料都放到系统分区中。这样一来,要格式化系统盘来彻底杀灭病毒和木马,而又没有备份资料的话,数据安全就很成问题
6.保留至少一个大容量的分区
随着硬盘容量的增加,文件和程序的体积也是越来越大。如果将硬盘平均分区的话,当存储大型文件或安装大型的应用程序时,就会遇到麻烦。因此,对于大硬盘来说,分出一个容量在100GB以上的分区用于大型文件的存储是十分必要的。
7.为备份创建一个分区
若需要为重要的文件或系统备份数据,除了使用外设(移动硬盘、U盘)外,还可以在硬盘上专门分一个区作为备份盘,用于存储重要文档备份、系统资料备份和系统镜像文件等。下面以安装 Windows7系统、硬盘容量为500GB、主要用于工作学习和家庭娱乐为主的电脑硬盘分区方案为例,介绍如何进行硬盘分区。安装 Windows7系统,系统占用一个盘, Windows7系统最小占用16GB的空间,推荐分配50GB的空间;软件安装占用一个盘,使用150GB的空间;娱乐用一个盘,分配200GB的空间;工作学习盘,由于工作与学习使用的文件不是很大,多为文本文件,所以分配50GB;最后剩下的50GB的空间主要是用于保存系统备份,以及重要的数据备份使用。

主要类型

硬盘分区之后,会形成三种形式的分区状态:主分区、扩展分区和非DOS分区。

主分区

主分区是一个比较单纯的分区,通常位于硬盘的最前面一块区域中,构成逻辑C磁盘。其中的主引导程序是它的一部分,此段程序主要用于检测硬盘分区的正确性,并确定活动分区,负责把引导权移交给活动分区的DOS或其他操作系统。此段程序损坏将无法从硬盘引导,但从软驱或光驱引导之后可对硬盘进行读写

扩展分区

扩展分区的概念比较复杂,很容易造成硬盘分区与逻辑磁盘的混淆。分区表的第四个字节为分区类型值,正常的可引导的大于32MB的基本DOS分区值为06,扩展的DOS分区值是05。如果把基本DOS分区类型改为05则无法启动系统,并且不能读写其中的数据。如果把06改为DOS不识别的类型如EFH,则DOS认为该分区不是DOS分区,当然无法读写。很多人利用此类型值实现单个分区的加密技术,恢复原来的正确类型值即可使该分区恢复正常。但扩展分区是不能直接使用的,它是以逻辑分区的方式来使用的,所以说扩展分区可分成若干逻辑分区。其关系是前者包含后者的关系,所有的逻辑分区都是扩展分区的一部分

非DOS分区

非DOS分区是一种特殊的分区形式,它是将硬盘中的一块区域单独划分出来供另一个操作系统使用,对主分区的操作系统来讲,是一块被划分出去的存储空间,只有非DOS分区的操作系统才能管理和使用这块存储区域。
在实际分区时,通常把硬盘分为主分区和扩展分区,然后根据硬盘大小和使用需要将扩展分区继续划分为几个逻辑分区,因此,建立硬盘分区的步骤是:建立主分区-建立扩展分区-将扩展分区分成多个逻辑分区。

分区格式

硬盘分区格式有多种,现在分区最常用的就是NTFS格式,之前的FAT32格式已经逐渐被淘汰,还有一些更久远的硬盘分区格式已经被人淡忘。下面简单介绍一下硬盘分区格式

FAT32格式

FAT32格式采用32位的文件分配表,使其对磁盘的管理能力大大增强,突破了FAT16对每一个分区的容量只有2GB的限制,在一个不超过8GB的分区中,FAT32分区格式的每个簇容量都固定为4KB,与FAT16相比,可以大大地减少硬盘空间的浪费,提高了硬盘利用效率。Windows 2000和Windows XP能够读写任何大小的FAT32文件系统,但是这些平台上的格式化程序只能创建最大32GB的FAT32文件系统。目前,支持这一磁盘分区格式的操作系统有Windows 98、Windows 2000、Windows XP、Windows Server 2003和Windows 7。

NTFS格式

NTFS分区格式是Windows NT网络操作系统的硬盘分区格式,它具有更安全的文件保障,提供文件加密,能够大大提高信息的安全性;具有更好的磁盘压缩功能;支持最大达2TB的大硬盘,并且随着磁盘容量的增大,NTFS的性能不像FAT那样随之降低。其最显著的优点是安全性和稳定性极其出色,在使用中不易产生文件碎片,对硬盘的空间利用及软件的运行速度都有好处。除了Windows NT外,Windows 2000、Windows Server 2003、WindowsXP、Windows Vista和Windows 7也支持这种硬盘分区格式,且一般Windows 7系统安装均采用该分区格式。

ext2/3格式

ext2是GNU/Linux系统中标准的文件系统,其特点为存取文件的性能极好,对于中小型的文件更显示出优势。在一般常见的Linux86系统中,簇最大为4KB,则单一文件大小上限为2048GB,而文件系统的容量上限为16384 GB。至于ext3文件系统,它属于一种日志文件系统,是对ext2系统的扩展,除具有ext2的特点外,它还具有高可用性、数据的完整性、文件系统的速度快、多种日志模式等优点。ext2或ext3文件格式存取效率较高,安装Linux时一般选择ext2/3格式,但是Windows是不识别的

FAT16文件系统

FAT16又称FAT即文件分配表,它是DOS和Windows 3.x操作系统广泛使用的16位文件系统,它的优点是有极好的兼容性,微软公司的DOS、Windows95/98/ME/NT/2000/XP,以及其他各类操作系统都支持FAT16。但是,FAT16文件系统不支持长文件名,而且单个分区的最大容量为2GB,一个“簇”(磁盘容量的最小单位)占用的空间为16KB。
电脑将信息保存在硬盘上称为“簇”的区域内,使用的簇越小,保存信息的效率就越高。在文件数量大的情况下FAT16文件系统浪费硬盘空间比较严重。由于现在的硬盘容量越来越大,文件也越来越多,FAT16文件系统已经不能满足现在使用者的要求,所以FAT16文件系统基本已经被淘汰了

常用的硬盘分区软件

给硬盘分区时需要用到分区软件,常用的分区软件主要有Fdisk,PatilionMagic,DM,DiskGenius,Acronis Disk Director Suite和Windows自带磁盘管理工具等,用户也可以在安装Windows操作系统时用安装程序进行分区
Fdisk是微软公司在DOS和Windows操作系统中自带的分区软件,该软件性能最稳定、兼容性好,但不支持无损分区,分区时会损坏硬盘上的数据,分区速度很慢,而且不能很好地支持大容量的硬盘分区。
PatitionMagic即分区魔术师,曾经是一款最常用的分区软件,界面友好、操作简单、功能强大且支持无损分区。但自2004年发布了8. 05版本后,该软件已不再发布新版本,因此,该软件不能很好地支持最新的硬盘,正逐步被淘汰。
DM是一款功能强大、体积小巧的通用分区软件,最显著的特点是具有惊人的分区速度。
DiskGenius是一款磁盘管理及数据恢复软件,目前最新版本是3.8.0。DiskGenius除了具备基本的分区功能外,还提供了硬盘分区和坏道修复,硬盘文件恢复,分区镜像备份与还原,分区复制,硬盘复制等强大功能
Acronis Disk Director Suite是一套强大的硬盘管理工具,曰前最新版本是11.0.0.216,它可以进行分区管理和在不损失资料的情况下对现有硬盘进行重新分区或优化调整,可以对损坏或删除分区中的数据进行修复

硬盘分区管理

虽然一个硬盘最多可以划分为4个主分区或者3个主分区和1个扩展分区,但通常都是将硬盘划分为一个主分区和一个扩展分区。
1.更改光盘驱动器的盘符
在创建扩展分区前,一般先将光盘驱动器的盘符设为Z盘,这样做是为了避免后面的逻辑分区盘符被隔断。更改光盘驱动器盘符的操作步骤如下:
(1)双击“控制面板”窗口中的“管理工具”图标,进入“管理工具”文件夹
(2)双击“管理工具”文件夹中的“计算机管理”图标,启动“计算机管理”程序窗口。在窗口左边选择“磁盘管理”选项,然后在右下窗口中右击CD-ROM0图标,在弹出的快捷菜单中选择“更改驱动器名和路径”命令
(3)系统弹出“驱动器号和路径”对话框,在对话框中单击“更改”按钮,弹出“更改驱动器号和路径”对话框,在“指派以下驱动器号”后面的下拉列表中选择Z选项,然后单击“确定”按钮关闭对话框。
2.创建硬盘扩展分区
主分区的建立完成后,接下来的工作就是创建一个扩展分区,然后在扩展分区中进一步划分逻辑分区,最后再对各逻辑分区进行格式化。创建扩展分区时,只需要指定分区大小,操作步骤如下
(1)在“计算机管理”程序窗口左边选择“磁盘管理”选项,然后在右下子窗口中右击“未指派”图标在弹出的快捷菜单中选择“新建磁盘分区”命令,启动“新建磁盘分区向导”对话框。
(2)单击“下一步”按钮,在对话框中选择“扩展磁盘分区”单选按钮,然后单击“下步”按钮。
(3)在“分区大小”数值框中输入分区大小(以MB为单位)。
(4)单击“完成”按钮关闭对话框,此时“磁盘管理”窗口右下方位置便出现一个新创建的扩展分区。
3.创建硬盘逻辑分区
扩展分区创建好后,还需要进一步划分逻辑分区。创建逻辑分区前,需要先规划好将扩展分区划分成几个逻辑分区,以及每个逻辑分区的大小。创建逻辑分区的操作步骤如下:
(1)在磁盘管理窗口中,右击新建的扩展分区,在弹出的快捷菜单中选择“新建逻辑驱动器”命令,启动“新建磁盘分区向导”对话框。
(2)单击“下一步”按钮,因为是创建逻辑分区,所以“主磁盘分区”和“扩展磁盘分区”两项不可用,只能选择“逻辑驱动器”单选按钮
(3)单击“下一步”按钮,在“分区大小”数值框中输入数字,一般为20000(约20GB)
(4)单击“下一步”按钮,选择“指派以下驱动器号”单选按钮,并在右侧下拉列表框中选择驱动器盘符
(5)单击“下一步”按钮,进入格式化分区对话框,如果要立即格式化当前创建的逻辑分区,可以选择“按下面的设置格式化这个磁盘分区”单选按钮,然后在“文件系统”下拉列表中选择FAT32选项,其他设置采用默认值
 
三、Linux文件系统
 
Linux文件系统中的文件是数据的集合,文件系统不仅包含着文件中的数据而且还有文件系统的结构,所有Linux 用户和程序看到的文件、目录、软连接及文件保护信息等都存储在其中。

创始人

Linus Torvalds
林纳斯·本纳第克特·托瓦兹(Linus Benedict Torvalds)出生于芬兰赫尔辛基市。父亲尼尔斯·托瓦兹(Nils Torvalds)是一名活跃的共产主义者及电台记者。托瓦兹家族属于在芬兰占6%的少数民族芬兰瑞典人。他毕业于赫尔辛基大学计算机科学系,1997年至2003年在美国加州硅谷任职于全美达公司(Transmeta Corporation)参与该公司芯片的code morph技术研发。后受聘于开源码发展实验室(OSDL : Open Source Development Labs,Inc),全力开发Linux内核。现任职于Linux基金会。

基本介绍

很详细地了解某个操作系统的实际工作方式是非常困难的,因为大多数操作系统的源代码都是严格保密的。在以实际使用为目标的操作系统中,让任何人都可以自由获取系统源代码,无论目的是要了解、学习还是修改,这样的系统并不多。本论文的主题就是这些少数操作系统中的一个:Linux。
Linux是一个性能稳定、功能强大、效率高的操作系统。它在功能特性方面与Unix系统相似,同时又具有多任务、多用户、多平台等若干特性。Linux的源代码是开放的,阅读Linux源代码,无疑是深入学习Linux的最好方法。

系统原理

Linux 最早的文件系统是Minix,但是专门为Linux 设计的文件系统——扩展文件系统第二版或EXT2被设计出来并添加到Linux中,这对Linux产生了重大影响。EXT2文件系统功能强大、易扩充、性能上进行了全面优化,也是所有Linux发布和安装的标准文件系统类型。
每个实际文件系统从操作系统和系统服务中分离出来,它们之间通过一个接口层:虚拟文件系统或VFS来通讯。VFS使得Linux可以支持多个不同的文件系统,每个表示一个VFS 的通用接口。由于软件将Linux 文件系统的所有细节进行了转换,所以Linux核心的其它部分及系统中运行的程序将看到统一的文件系统。Linux 的虚拟文件系统允许用户同时能透明地安装许多不同的文件系统。
在Linux文件系统中,作为一种特殊类型/proc文件系统只存在内存当中,而不占用外存空间。它以文件系统的方式为访问系统内核数据的操作提供接口。/proc文件系统是一个伪文件系统,用户和应用程序可以通过/proc得到系统的信息,并可以改变内核的某些参数。
在Linux文件系统中,EXT2文件系统、虚拟文件系统、/proc文件系统是三个具有代表性的文件系统,本论文试图通过对他们的分析来研究Linux文件系统机制。并且在分析这三种文件系统的基础上对Linux文件系统操作进行了解、研究(本论文选取了open和close两种操作进行研究)。在第二部分中将介绍EXT2文件系统;第三部分论述虚拟文件系统的特点;第四部分简要介绍/proc文件系统;最后,介绍两种具体文件系统操作的实现。

文件系统

在Linux中普通文件和目录文件保存在称为块物理设备的磁盘或者磁带上。一套Linux系统支持若干物理盘,每个物理盘可定义一个或者多个文件系统。(类比于微机磁盘分区)。每个文件系统由逻辑块的序列组成,一个逻辑盘空间一般划分为几个用途各不相同的部分,即引导块、超级块、inode区以及数据区等。
引导块:在文件系统的开头,通常为一个扇区,其中存放引导程序,用于读入并启动操作系统;超级块:用于记录文件系统的管理信息。特定的文件系统定义了特定的超级块;inode区(索引节点):一个文件或目录占据一个索引节点。第一个索引节点是该文件系统的根节点。利用根节点,可以把一个文件系统挂在另一个文件系统的非叶节点上;数据区:用于存放文件数据或者管理数据。
Linux最早引入的文件系统类型是MINIX。MINIX文件系统由MINIX操作系统定义,有一定的局限性,如文件名最长14个字符,文件最长64M字节。第一个专门为Linux设计的文件系统是EXT(Extended File System),但目前流行最广的是EXT4。
第二代扩展文件系统由Rey Card 设计,其目标是为Linux 提供一个强大的可扩展文件系统。它同时也是Linux界中设计最成功的文件系统。通过VFS的超级块(struct ext2_sb_info ext2_sb)可以访问EXT2的超级块,通过VFS的inode(struct ext2_inode_info ext2_i)可以访问EXT2的inode。
文件系统EXT2的源代码在/usr/src/linux/fs/ext2目录下,它的数据结构在文件/usr/src/linux/include/linux/ext2_fs.h以及同一目录下的文件ext2_fs_i.h和ext2_fs_sb.h中定义。
EXT2文件系统将它所占用的逻辑分区划分成块组(block group)。

逻辑分区

和很多文件系统一样, EXT2 建立在数据被保存在数据块中的文件内这个前提下。这些数据块长度相等且这个长度可以变化,某个EXT2 文件系统的块大小在创建(使用mke2fs)时设置。每个文件的大小和刚好大于它的块大小正数倍相等。如果块大小为1024 字节而一个1025 字节长的文件将占据两个1024 字节大小的块。这样你不得不浪费差不多一半的空间。我们通常需要在CPU 的内存利用率和磁盘空间使用上进行折中。而大多数操作系统,包括Linux 在内,为了减少CPU 的工作负载而被迫选择相对较低的磁盘空间利用率。并不是文件中每个块都包含数据,其中有些块被用来包含描叙此文件系统结构的信息。EXT2通过一个inode 结构来描叙文件系统中文件并确定此文件系统的拓扑结构。inode 结构描叙文件中数据占据哪个块以及文件的存取权限、文件修改时间及文件类型。EXT2 文件系统中的每个文件用一个inode 来表示且每个inode 有唯一的编号。文件系统中所有的inode都被保存在inode 表中。 EXT2 目录仅是一个包含指向其目录入口指针的特殊文件(也用inode表示)。
对文件系统而言文件仅是一系列可读写的数据块。文件系统并不需要了解数据块应该放置到物理介质上什么位置,这些都是设备驱动的任务。无论何时只要文件系统需要从包含它的块设备中读取信息或数据,它将请求底层的设备驱动读取一个基本块大小整数倍的数据块。EXT2 文件系统将它所使用的逻辑分区划分成数据块组。每个数据块组将那些对文件系统完整性最重要的信息复制出来, 同时将实际文件和目录看作信息与数据块。为了发生灾难性事件时文件系统的修复,这些复制非常有必要。

与微软比较

相同点

用户和组
Linux是多用户多任务操作系统而Windows是单用户多任务操作系统。都可以由许多不同的用户来使用,为每个用户提供单独的环境和资源。基于用户身份来控制安全性。都可以以组成员的方式来控制资源的访问权限,这样在用户数目较大时可以不必为每一个帐号设置权限。
用户和组可以集中管理,让多个服务器共享相同的用户和身份验证数据。
文件系统
Linux和Windows都支持多种文件系统。文件资源可以通过NetBIOS、FTP或者其他协议与其他客户机共享。可以很灵活地对各个独立的文件系统进行组织,由管理员来决定它们在何处可以以何种方式被访问。
端口和设备
两种操作系统都支持各种物理设备端口,比如并口、串口和 USB 接口。支持各种控制器,比如 IDE 和 SCSI 控制器。Linux 还支持很多“刚刚上市”的标准硬件。
网络
Linux和Windows都支持多种网络协议,比如TCP/IP、NetBIOS和IPX。都支持多种类型的网络适配器。都具备通过网络共享资源的能力,比如共享文件和打印。都可以提供网络服务能力,比如 DHCP 和 DNS。
服务
Linux和Windows都提供服务。所谓服务,指的是那些在后台运行的应用程序,可以为系统和远程调用该服务的计算机提供一些功能。在系统引导的时候可以单独控制并自动启动这些程序。(注意:Linux 中沿用了 Unix 的习惯,称这种应用程序为 daemon)

不同点

Linux 的应用目标是网络而不是打印
Windows最初出现的时候,这个世界还是一个纸张的世界。Windows的伟大成就之一在于您的工作成果可以方便地看到并打印出来。这样一个开端影响了 Windows 的后期发展。
同样,Linux 也受到了其起源的影响。Linux 的设计定位于网络操作系统。它的设计灵感来自于 Unix操作系统,因此它的命令的设计比较简单,或者说是比较简洁。由于纯文本可以非常好地跨网络工作,所以 Linux 配置文件和数据都以文本为基础。
对那些熟悉图形环境的人来说,Linux服务器初看可能比较原始。但是Linux开发更多关注的是它的内在功能而不是表面上的东西。即使是在纯文本的环境中,Linux同样拥有非常先进的网络、脚本和安全能力。执行一些任务所需的某些表面上看起来比较奇怪的步骤是令人费解的,除非您认识到 Linux 是期望在网络上与其他 Linux系统协同执行这些任务。Linux的自动执行能力也很强,只需要设计批处理文件就可以让系统自动完成非常详细的任务。Linux 的这种能力来自于其基于文本的本质。
可选的 GUI
Linux有图形组件。Linux支持高端的图形适配器和显示器,完全胜任图形相关的工作。许多数字效果艺术家在Linux工作站上来进行他们的设计工作,而以前这些工作需要使用IRIX系统来完成。但是,图形环境并没有集成到 Linux 中,而是运行于系统之上的单独一层。这意味着您可以只运行 GUI,或者在需要时才运行 GUI。如果您的系统主要任务是提供Web应用,那么您可以停掉图形界面,而将其所用的内存和CPU资源用于您的服务。如果您需要在 GUI 环境下做一些工作,可以再打开它,工作完成后再将其关闭。
Linux 有图形化的管理工具,以及日常办公的工具,比如电子邮件、网络浏览器和文档处理工具等。不过,在 Linux 中,图形化的管理工具通常是控制台 (命令行) 工具的扩展。也就是说,用图形化工具能完成的所有工作,用控制台命令同样可以完成。同样,使用图形化工具并不妨碍您对配置文件进行手工修改。其实际意义可能并不是特别显而易见,但是,如果在图形化管理工具中所做的任何工作都可以以命令行的方式完成,这就表示那些工作也可以由一个脚本来实现。脚本化的命令可以成为自动执行的任务。Linux 同时支持这两种方式,并不要求您只用文本或者只用 GUI。您可以根据您的需要选择最好的方法。
Linux 中的配置文件是人类可读的文本文件,这与过去的 Windows 中的 INI 文件类似,但与 Windows 的注册表机制在思路上有本质的区别。每一个应用程序都有其自己的配置文件,而且通常不与其他的配置文件放在一起。不过,大部分的配置文件都存放于一个目录树 (/etc) 下的单个地方,所以看起来它们在逻辑上是在一起。文本文件的配置方式使得不通过特殊的系统工具就可以完成配置文件的备份、检查和工作。
文件名扩展
Linux不使用文件名扩展来识别文件的类型。相反,Linux根据文件的头内容来识别其类型。为了提高文件可读性您仍可以使用文件名扩展,但这对 Linux 系统来说没有任何作用。不过,有一些应用程序,比如 Web 服务器,可能使用命名约定来识别文件类型,但这只是特定的应用程序的要求而不是 Linux 系统本身的要求。
Linux通过文件访问权限来判断文件是否为可执行文件。任何一个文件都可以赋予可执行权限,这样程序和脚本的创建者或管理员可以将它们识别为可执行文件。这样做有利于安全。保存到系统上的可执行的文件不能自动执行,这样就可以防止许多脚本病毒。
重新引导是最后的手段
如果您使用Windows已经很长时间了,您可能已经习惯出于各种原因(从软件安装到纠正服务故障)而重新引导系统。在Linux思想中您的这一习惯需要改变。Linux在本质上更遵循“牛顿运动定律”。一旦开始运行,它将保持运行状态,直到受到外来因素的影响,比如硬件的故障。实际上,Linux系统的设计使得应用程序不会导致内核的崩溃,因此不必经常重新引导(与Windows系统的设计相对而言)。所以除了Linux内核之外,其他软件的安装、启动、停止和重新配置都不用重新引导系统。
如果您确实重新引导了 Linux 系统,问题很可能得不到解决,而且还会使问题更加恶化。学习并掌握 Linux 服务和运行级别是成功解决问题的关键。学习 Linux 最困难的就是克服重新引导系统的习惯。
另外,您可以远程地完成Linux中的很多工作。只要有一些基本的网络服务在运行,您就可以进入到那个系统。而且,如果系统中一个特定的服务出现了问题,您可以在进行故障诊断的同时让其他服务继续运行。当您在一个系统上同时运行多个服务的时候,这种管理方式非常重要。
命令区分大小写
所有的 Linux 命令和选项都区分大小写。例如, -R 与 -r 不同,会去做不同的事情。控制台命令几乎都是小写的。

About Us

Since 1996, our company has been focusing on domain name registration, web hosting, server hosting, website construction, e-commerce and other Internet services, and constantly practicing the concept of "providing enterprise-level solutions and providing personalized service support". As a Dell Authorized Solution Provider, we also provide hardware product solutions associated with the company's services.
 

Contact Us

Address: No. 2, Jingwu Road, Zhengzhou City, Henan Province

Phone: 0086-371-63520088 

QQ:76257322

Website: 800188.com

E-mail: This email address is being protected from spambots. You need JavaScript enabled to view it.