Laptop Hard Drive

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
User avatar
linuxviolin
Level 8
Level 8
Posts: 2081
Joined: Tue Feb 27, 2007 6:55 pm
Location: France

Re: Laptop Hard Drive

Post by linuxviolin »

Linux n00b wrote:I know Linux changed to ext3 by default for some time already. There must be some good about it.
ext3 "was supposed to be the "native" Linux filesystem". But the fsync(2)/fdatasync(2) bug with ext3/reiserfs4 exposed by Firefox 3 ("this bug show how nasty can it be when you want to flush a specific file, and it actually flushes everything to disk...") should perhaps make us try something else... :?:

And JFS is very good.
And I guess though JFS today is not actively developed, it is maintained. But yes, "It's such a pity it's stalled!"

Even Linus seems not to like ext3.

From http://kerneltrap.org/node/14148:
From: Linus Torvalds [email blocked]
To: Ingo Molnar [email blocked]
Subject: Re: [PATCH 00/23] per device dirty throttling -v8
Date: Sat, 4 Aug 2007 09:17:44 -0700 (PDT)



On Sat, 4 Aug 2007, Ingo Molnar wrote:

> > [ my personal interest in this is the following regression: every time
> > i start a large kernel build with DEBUG_INFO on a quad-core 4GB RAM
> > box, i get up to 30 seconds complete pauses in Vim (and most other
> > tasks), during plain editing of the source code. (which happens when
> > Vim tries to write() to its swap/undo-file.) ]
>
> hm, it turns out that it's due to vim doing an occasional fsync not only
> on writeout, but during normal use too. "set nofsync" in the .vimrc
> solves this problem.

Yes, that's independent. The fact is, ext3 *sucks* at fsync. I hate hate
hate it. It's totally unusable, imnsho.

The whole point of fsync() is that it should sync only that one file, and
avoid syncing all the other stuff that is going on, and ext3 violates
that, because it ends up having to sync the whole log, or something like
that. So even if vim really wants to sync a small file, you end up waiting
for megabytes of data being written out.

I detest logging filesystems.

Linus
From: Linus Torvalds [email blocked]
To: Ingo Molnar [email blocked]
Subject: Re: [PATCH 00/23] per device dirty throttling -v8
Date: Sat, 4 Aug 2007 10:39:56 -0700 (PDT)



On Sat, 4 Aug 2007, Ingo Molnar wrote:
>
> yeah, it's really ugly. But otherwise i've got no real complaint about
> ext3 - with the obligatory qualification that "noatime,nodiratime" in
> /etc/fstab is a must.

I agree, we really should do something about atime.

But the fsync thing is a real issue. It literally makes ext3 almost
unusable from a latency standpoint on many loads. I have a fast disk, and
don't actually tend to have all that much going on normally, and it still
hurts occasionally.

One of the most common (and *best*) reasons for using fsync is for the
mail spool. So anybody that uses local email will actually be doing a lot
of fsync, and while you could try to thread the interfaces, I don't think
a lot of mailers do.

So fsync ends up being a latency issue for something that a lot of people
actually see, and something that you actually end up working with and you
notice the latencies very clearly. Your editor auto-save feature is
another good example of that exact same thing: the fsync actually is there
for a very good reason, even if you apparently decided that you'd rather
disable it.

But yeah, "noatime,data=writeback" will quite likely be *quite* noticeable
(with different effects for different loads), but almost nobody actually
runs that way.

I ended up using O_NOATIME for the individual object "open()" calls inside
git, and it was an absolutely huge time-saver for the case of not having
"noatime" in the mount options. Certainly more than your estimated 10%
under some loads.

The "relatime" thing that David mentioned might well be very useful, but
it's probably even less used than "noatime" is. And sadly, I don't really
see that changing (unless we were to actually change the defaults inside
the kernel).

Linus
WOW......

"The fact is, ext3 *sucks* at fsync. I hate hate
hate it. It's totally unusable, imnsho."

"ext3 violates that, because it ends up having to sync the whole log, or something like
that. So even if vim really wants to sync a small file, you end up waiting
for megabytes of data being written out.

I detest logging filesystems."

"But the fsync thing is a real issue. It literally makes ext3 almost
unusable from a latency standpoint on many loads. I have a fast disk, and
don't actually tend to have all that much going on normally, and it still
hurts occasionally. "

What is the filesystem preferred by Linus? :roll:

Also from Andrew Morton:
From: Andrew Morton [email blocked]
To: Ingo Molnar [email blocked]
Subject: Re: [PATCH 00/23] per device dirty throttling -v8
Date: Sat, 4 Aug 2007 09:51:43 -0700

On Sat, 4 Aug 2007 18:37:33 +0200 Ingo Molnar [email blocked] wrote:

>
> * Linus Torvalds [email blocked] wrote:
>
> > > hm, it turns out that it's due to vim doing an occasional fsync not
> > > only on writeout, but during normal use too. "set nofsync" in the
> > > .vimrc solves this problem.
> >
> > Yes, that's independent. The fact is, ext3 *sucks* at fsync. I hate
> > hate hate it. It's totally unusable, imnsho.
>
> yeah, it's really ugly. But otherwise i've got no real complaint about
> ext3 - with the obligatory qualification that "noatime,nodiratime" in
> /etc/fstab is a must. This speeds up things very visibly - especially
> when lots of files are accessed. It's kind of weird that every Linux
> desktop and server is hurt by a noticeable IO performance slowdown due
> to the constant atime updates,

Not just more IO: it will cause great gobs of blockdev pagecache to remain
in memory, too.
So yes, with ext3 we should use "noatime,data=writeback" but then I guess there is no advantage over JFS.

About hdparm I agree with you.
Linux n00b wrote:Saving energy is good, but it comes after the hard drive life. If my hard drive dies because of this crazy load cycle, there is no point to save that 1 or 2W energy.
..............................

The "default" setting for power management is crazy.
If I had a laptop I'll change it for 254 for sure...
K.I.S.S. ===> "Keep It Simple, Stupid"
"Simplicity is the ultimate sophistication." (Leonardo da Vinci)
"Everything should be made as simple as possible, but no simpler." (Albert Einstein)
Fred

Re: Laptop Hard Drive

Post by Fred »

linuxviolin,

Keep digging my friend. You will find more. :-)

As I said early in the thread, the companion mode line I would have you put in fstab to go with data writeback mode was taken directly from a post by Linus T.

My reason for staying with ext3 is the simple fact that it is so popular, receives lots of developer attention, and most of the distributions have been well tested with it.

I am waiting for the xfs file system to attract a bit more attention in the Linux world. It has a good solid code base that has been well tested. It just never received much TLC from Linux developers.

Fred
User avatar
linuxviolin
Level 8
Level 8
Posts: 2081
Joined: Tue Feb 27, 2007 6:55 pm
Location: France

Re: Laptop Hard Drive

Post by linuxviolin »

Fred wrote:data writeback mode was taken directly from a post by Linus T.
Fred............ :wink: :D :D :D
Fred wrote:My reason for staying with ext3 is the simple fact that it is so popular, receives lots of developer attention, and most of the distributions have been well tested with it.
There is probably a lot more people testing "exotic" filesystems on community-based distribution like Debian than there is on RedHat/Fedora for example.
Fred wrote:I am waiting for the xfs file system to attract a bit more attention in the Linux world. It has a good solid code base that has been well tested. It just never received much TLC from Linux developers.
Yes but "beware of XFS, it wasn't designed for an environment that has no safety (UPS and the likes). It makes agressive use of caching which means if you get a power failure/blackout not all data may have been written to the disk at the time of the blackout. But that's also the reason why XFS is so fast."

Some extra info from here:

There is a nice thing about Delayed allocation: "In situations where many short-lived temporary files are created, XFS may never need to write these files to disk at all."

But as for the missing UPS, etc., the article states XFS is "allowing for fast recovery after an unexpected reboot", so...?!

Anyway: "Like ReiserFS, XFS only journals metadata, and does not take any special precautions to ensure that the data makes it to disk before metadata is written." But this is valid for JFS too!

Also "in it's early days, XFS was known for corruption and data loss and claims that it's still prone to data loss can be read even in relatively recent times, e.g. here from 2005"

About option, XFS has barrier on by default. Using the option "nobarrier" is a speed/load improvement. ext3 and JFS have no barrier by default.

A new quote:
Back when XFS wasn't really supported for booting, or only certain versions of GRUB/LILO would support XFS. Plus in it's early days, XFS was known for corruption and data loss.

ReiserFS always seemed like a fad to me. Too slow for practical desktop use and caused higher CPU usage on some of my older machines. Maybe if I ran a server that dealt with files in the k's instead of MB's it would be different. That left ext2/3 or JFS. Given the speed and low CPU usage of JFS, it's a no brainer. Though JFS today is not actively developed, it is maintained. The mailing list has an IBM tech that will trouble shoot his heart out until the issue is solved.
JFS is a good option.
I've been using JFS for years because I have an older computer with a slower proc and JFS has the lowest CPU requirements. Also the electricity here is unreliable and sometimes goes out with no warning. When the power comes back on I start my computer again and everything is fine.

The only 2 problems I have had with JFS are related to distro-hopping:

1. If I change distros and re-use my /home partition, sometimes the file system gets broken and the /home partition won't mount. To fix it I have to log in as root and run fsck.jfs -av /dev/hdb1

2. If I change distros and the new one doesn't support JFS, the home partition won't mount. When that happens install jfsutils.
Well, after all this I should say that the choice is between JFS and XFS. I guess I would go for IBM's JFS...

As I have said elsewhere in another post, if someone is interested, you can find some links to interesting information about ext3, XFS, JFS, ReiserFS... here
K.I.S.S. ===> "Keep It Simple, Stupid"
"Simplicity is the ultimate sophistication." (Leonardo da Vinci)
"Everything should be made as simple as possible, but no simpler." (Albert Einstein)
Fred

Re: Laptop Hard Drive

Post by Fred »

linuxviolin wrote:
Yes but "beware of XFS, it wasn't designed for an environment that has no safety (UPS and the likes). It makes agressive use of caching which means if you get a power failure/blackout not all data may have been written to the disk at the time of the blackout. But that's also the reason why XFS is so fast."

There is a nice thing about Delayed allocation: "In situations where many short-lived temporary files are created, XFS may never need to write these files to disk at all."
Agreed, which is exactly why if I had a laptop computer I would be drawn to xfs. It looks pretty attractive from several standpoints when you consider that power failures on a laptop should be a non-issue. How often does you battery unexpectedly fall out of your laptop? :-)

For a desktop I would have to agree and say that jfs would be a better/safer option than xfs.

You may have a better feel for jfs than I do, but I see little difference between jfs and ext3 writeback. Therefore I would tend to stay with ext3 for the reasons I stated before. Though I certainly wouldn't argue with someone who wished to use jfs instead of ext3. Except to say that ext3 ordered mode might be a bit safer, power failure wise, on a desktop and a bit slower. :-)

When thinking in terms of file systems, I believe you need to think of what you are going to use them for and the environment they will operate in to make the best decisions. What is best for a GP laptop might not be the best choice for a desktop work station, which might not be the best choice for a database server in a data center.

Thanks for all the research and links. You had a couple there that I hadn't seen before. :-)

Fred
User avatar
linuxviolin
Level 8
Level 8
Posts: 2081
Joined: Tue Feb 27, 2007 6:55 pm
Location: France

Re: Laptop Hard Drive

Post by linuxviolin »

Fred wrote:When thinking in terms of file systems, I believe you need to think of what you are going to use them for and the environment they will operate in to make the best decisions. What is best for a GP laptop might not be the best choice for a desktop work station, which might not be the best choice for a database server in a data center.
Yes probably... :D
Fred wrote:I see little difference between jfs and ext3 writeback.
I guess we can/should use ext3 with "noatime,data=writeback" but then maybe there is no advantage over JFS.

But we must not forget the fsync(2)/fdatasync(2) bug with ext3/reiserfs4... ext3 has an "incomplete" implementatione (fsync/fdatasync). This may be "unpalatable"

So, no advantage for ext3 plus bug, then maybe a change might be a good idea? :roll:
K.I.S.S. ===> "Keep It Simple, Stupid"
"Simplicity is the ultimate sophistication." (Leonardo da Vinci)
"Everything should be made as simple as possible, but no simpler." (Albert Einstein)
Fred

Re: Laptop Hard Drive

Post by Fred »

linuxviolin wrote:
So, no advantage for ext3 plus bug, then maybe a change might be a good idea? :roll:
You have certainly made a convincing argument for jfs on the desktop in place of ext3. If we could get a little more involvement of developers, on the kernel side and the distro side, I would be with you 100%. :-)

All other things being equal, I think I would still favor xfs on the laptop however. Power is just not an issue there and disk activity and speed have too high a priority to ignore.

Fred
routine

Re: Laptop Hard Drive

Post by routine »

Awesome, I love these types of posts... you guys had me reading about Linux file systems for the past two days. Thanks... I've decided to go with JFS.
AK Dave

Re: Laptop Hard Drive

Post by AK Dave »

Yeah, it really helped me get my geek on, hardcore gonzo-style.
milen

Re: Laptop Hard Drive

Post by milen »

Hello !

I tried to increase the writeback time like it's shown in the LessWatts' site from Fred's post. It says Permission Denied even when executed with sudo. What am I missing?

Milen
Linux n00b

Re: Laptop Hard Drive

Post by Linux n00b »

I know I'm new, but if sudo doesn't work, you can just use su (provide you have enabled root account).

My understanding is enable logon with su is bad bad idea, but enable the account isn't.
milen

Re: Laptop Hard Drive

Post by milen »

Hello !

The last few days I made an experiment. I read a post ( from launchpad if I'm correct.... ) about solving the Load_Cycle problem with making some activity of the hdd - a script touches a file. So I made a script that uses touch command ( touch - change file timestamps ) with -a option ( -a change only the access time ). First I put it in a loop every 10-15 seconds but the cycling was still here. The wait time went down to 6 sec. - there was decrease of the Load_Cycle_Count per hour - less than 10. The hdd temperature - less than 48, usually 42.

I think "touch" is not making such traffic to interfere the proper working of the system and this could be useful, for those, who can't solve the issue by changing file system modes and/or hdparm -B parameters, as last opportunity ( if nothing else works ) to override the strange act of the hdd.

What do you think?

Milen
User avatar
linuxviolin
Level 8
Level 8
Posts: 2081
Joined: Tue Feb 27, 2007 6:55 pm
Location: France

Re: Laptop Hard Drive

Post by linuxviolin »

For all those who might be or are interested in XFS (maybe Fred for example... :lol:) here is an article by a guy convinced that XFS is «just not adequate for laptops or even desktops»

Food for thought... :roll:
K.I.S.S. ===> "Keep It Simple, Stupid"
"Simplicity is the ultimate sophistication." (Leonardo da Vinci)
"Everything should be made as simple as possible, but no simpler." (Albert Einstein)
Fred

Re: Laptop Hard Drive

Post by Fred »

linuxviolin wrote:
Food for thought... :roll:
Agreed :-)

Thanks for the link. I like the concepts behind xfs for laptops but like I said earlier I do wish it could get more developer time. In that respect it has the same problem that jfs has.

Fred

EDIT: What do you think of ZFS? I keep hearing good things about it but don't have any knowledge about it.
Linux n00b

Re: Laptop Hard Drive

Post by Linux n00b »

ZFS? One more thing I need to read about.

I have done a little reading about XFS, JFS and ext3. My impression is ext3 is pretty bad comparing to JFS or XFS. There are more bugs or design flaws I didn't think a solid system like Linux would adopt. If I reinstall Mint (not sure will upgrade to Mint6 once it is out), I will try JFS.

I also read about this new ext4, it sounds much better than ext3. How far away we can expect a stable final version of ext4/
MagnusB
Level 6
Level 6
Posts: 1252
Joined: Sun Nov 18, 2007 12:39 pm
Location: Norway

Re: Laptop Hard Drive

Post by MagnusB »

Fred wrote: EDIT: What do you think of ZFS? I keep hearing good things about it but don't have any knowledge about it.
ZFS use a ton of RAM, and it is one of the major reasons that the Solaris live CD is slow..
Image
You're not drunk if you can lie on the floor without holding on.
--Dean Martin
User avatar
linuxviolin
Level 8
Level 8
Posts: 2081
Joined: Tue Feb 27, 2007 6:55 pm
Location: France

Re: Laptop Hard Drive

Post by linuxviolin »

Fred wrote:What do you think of ZFS? I keep hearing good things about it but don't have any knowledge about it.
Fred, for now I tend to say like MagnusB

And
ZFS, however, is aimed at server installs and probably won't be seen on the desktop as often due to its larger hardware / RAM requirements.
(Kris Moore, PC-BSD lead developer)
K.I.S.S. ===> "Keep It Simple, Stupid"
"Simplicity is the ultimate sophistication." (Leonardo da Vinci)
"Everything should be made as simple as possible, but no simpler." (Albert Einstein)
milen

Re: Laptop Hard Drive

Post by milen »

Yuki_Nagato wrote:I have an HP laptop running Phoenix BIOS. The load cycle is doing about 90 an hour. These fixes have done nothing to lower that.

However, my laptop never makes a sound. I sit here pressing "UP" and "ENTER" to run smartcrt over and over, watching my cycles climb, but never a sound.
There are very interesting posts and suggestions here, what have you tried?

What is your hd? The sound that the hd makes when makes a load cycle is specific, your drive may be is working very quietly, preventing you from hearing anything. Or may be the load cycle count is not correct.

Milen
Fred

Re: Laptop Hard Drive

Post by Fred »

olesya wrote:
I am totally agreed with you.
Now that is a mouth full. There is a lot of meat in this thread. :-)

If you been through and absorbed this entire thread, you have indeed been quite busy. :-)

Fred
milen

Re: Laptop Hard Drive

Post by milen »

Hello, all!

A few days ago I did a fresh default install of Mint 7 on ext4 partitions (HP Pavilion dv6000 laptop, WDC harddrive). When on power supply, I didn't have the load cycling problem! On battery - something like 1 cycle per minute. I suppose that the good result on power was caused by the functions of the ext4 that also have their disadvantages. The cycling problem, when on battery, I solved by disabling laptop-mode. By now it works beautifully, the most cycling I got, was 2 cycles per hour. Just nice :)

Milen

EDIT: Well, after a little more testing, the cycling appeared again when on battery. Sometimes it disappears and reappears. So I did some editing of the laptop-mode.conf and enabled laptop-mode again. Now I'm counting my hd's cycles :)

Greetings,
Milen
MarcoB

Re: Laptop Hard Drive

Post by MarcoB »

milen wrote:Hello, all!

A few days ago I did a fresh default install of Mint 7 on ext4 partitions (HP Pavilion dv6000 laptop, WDC harddrive). When on power supply, I didn't have the load cycling problem! On battery - something like 1 cycle per minute. I suppose that the good result on power was caused by the functions of the ext4 that also have their disadvantages. The cycling problem, when on battery, I solved by disabling laptop-mode. By now it works beautifully, the most cycling I got, was 2 cycles per hour. Just nice :)

Milen

EDIT: Well, after a little more testing, the cycling appeared again when on battery. Sometimes it disappears and reappears. So I did some editing of the laptop-mode.conf and enabled laptop-mode again. Now I'm counting my hd's cycles :)

Greetings,
Milen
Hi!

Mind sharing your results?

I get the same problem only when on battery.
Checking acpi, I found that it sets hdparm -B 128 while on battery. Doing 254 the cycling stops.
But I rather checking laptop-mode as it might be the cause of this.

So what did you do? Is the problem gone for you?
Locked

Return to “Beginner Questions”