Solid State Drive Fragmantation?

A

athiker

My guess is that since being in the BIOS avoids disk activity, it's not
gong to be at cross-purposes with the drives' firmware, whereas Windows
might do enough, even when ostensibly not being used, to confuse the
process.

My other guess is that the advice that athiker got is actually bogus.

Of course, in both cases, the operative phrase is "my guess".

Gene's post made me wonder if I had heard incorrectly so today I
finally got time to contact Crucial again and they confirmed that
there is management software that does take care of the drive and that
the reason to go to BIOS is that the drive needs to be idle.
"Overnight" was clarified to be "5 or 6 hours".

Sorry Gene.

Score a point for Paul.
 
G

Gene E. Bloch

Gene's post made me wonder if I had heard incorrectly so today I
finally got time to contact Crucial again and they confirmed that
there is management software that does take care of the drive and that
the reason to go to BIOS is that the drive needs to be idle.
"Overnight" was clarified to be "5 or 6 hours".

Sorry Gene.

Score a point for Paul.
Actually, also score a point for you for finding out and reporting it.

I was originally speculating, but now I (and others) know :)
 
S

Scott

Actually, also score a point for you for finding out and reporting it.

I was originally speculating, but now I (and others) know :)
I'm not entirely following this (bit too technical) but am I correct
in understanding that if TRIM is enabled the foregoing process is not
required?
 
P

Paul

Scott said:
I'm not entirely following this (bit too technical) but am I correct
in understanding that if TRIM is enabled the foregoing process is not
required?
Going through the TRIM article on Wikipedia, TRIM seems to make
the drive aware of more parts of the drive being reusable. If
the drive and partition are not "full", then the drive can add
the unused bits to its unused pool. And then, find more opportunities
for garbage collection and rearranging the data. Take my Windows 7 partition,
with its 26GB or so of data. If that was sitting on an 80GB SSD, then
the drive would then know about another (80GB - 26GB) being free.
Whereas, on a well used drive, without TRIM, the entire 80GB could
be seemingly occupied with data (as far as the drive is concerned),
meaning, when the drive does GC, the only spares it has, are the
hidden spares from when the drive was commissioned. (An 80GB drive, might
have 10 or 15GB reserved, out of reach of the user. Each drive has some
level of unused blocks, which will be unused even when the drive
is full as far as the user is aware.)

Keep in mind as well, that there is one level of indirection involved
in flash drives. (That's done, so the drive can do wear leveling.)
You as the user, think you've stored something in
Sector 0. The SSD keeps a mapping table, and knows sector 0 is stored
at located 123456 at the moment. If you rewrite sector 0 as the user,
the drive may allocate another block 342546 and store sector 0 there.
Because of the indirection and mapping notion, it's possible for the
storage state of the SSD internally, to bear no resemblance to how
you think the data is stored at the file system level. Garbage
collection makes no sense, unless you're aware there is indirection
present, and only the SSD knows the mapping between sector number,
and where in the flash, the data is actually stored. If that mapping
is ever corrupted, you're screwed.

Garbage collection then, is tidying up the internal organization, so
that high-speed writing is possible when the user asks for it. If the
drive didn't GC, perhaps write speed would be pathetically slow when
you needed it.

I don't get the impression, that TRIM solves garbage collection. Garbage
collection still has to run. And should be running, any time the disk
is idle. Exactly what the definition of idle is, I haven't a clue. In
"hardware land", this could be any time there is nothing sitting in a
command queue. Meaning, the drive could work on GC the instant it
finishes the last command. If a command comes in, it may require the
GC to "replan" the last operation it was going to do, in case the
system state changed such as to invalidate the move it was planning to do.
Maybe all it would take, is a "blip" to the disk every two seconds,
to prevent it from making any forward progress on GC (because it's forced
to replan things, and that may take some time).

Without any other tools here to work on it, if I wanted to intuit
what a drive was doing, I'd monitor DC current flow into the SSD
as a function of time. That might help me to determine, when the drive
has gone idle, and when it is busy. Some drives (SandForce), the
available data suggests a big current flow difference between being
active and being idle. Some other brands, the specs seem to indicate
the current flow levels are ridiculously (unbelievably) low. So perhaps
I could definitely tell you a SandForce was doing something in the background,
whereas on a Samsung, maybe the numbers would be too small to reliably
use. If the drive had an "internal activity LED", we wouldn't need
to come up with ideas like this. But otherwise, I don't know of a way
to determine what a drive is doing.

Even your hard drive, is busy behind the scenes. Only, in the case
of a hard drive, it's "not doing anything evil". A hard drive, runs
internal SMART routines when it's not busy, intended to test that
certain things still work on the drive. On at least one SCSI drive,
noted in the past, you can tell there is internal activity, because
the drive used to make an audible "buzz" sound of head movement,
every 71 seconds. It was so loud, that it drove several users
right round the bend. That's how you find out a hard drive,
has its own processor, and it can be doing things internally
when you think it is otherwise idle. Since the drive was intended
for servers, the disk manufacturer didn't consider the noise
level to be a problem. But people with that drive in a bedroom,
it didn't stay powered there for long.

Paul
 
S

Scott

Going through the TRIM article on Wikipedia, TRIM seems to make
the drive aware of more parts of the drive being reusable. If
the drive and partition are not "full", then the drive can add
the unused bits to its unused pool. And then, find more opportunities
for garbage collection and rearranging the data. Take my Windows 7 partition,
with its 26GB or so of data. If that was sitting on an 80GB SSD, then
the drive would then know about another (80GB - 26GB) being free.
Whereas, on a well used drive, without TRIM, the entire 80GB could
be seemingly occupied with data (as far as the drive is concerned),
meaning, when the drive does GC, the only spares it has, are the
hidden spares from when the drive was commissioned. (An 80GB drive, might
have 10 or 15GB reserved, out of reach of the user. Each drive has some
level of unused blocks, which will be unused even when the drive
is full as far as the user is aware.)

Keep in mind as well, that there is one level of indirection involved
in flash drives. (That's done, so the drive can do wear leveling.)
You as the user, think you've stored something in
Sector 0. The SSD keeps a mapping table, and knows sector 0 is stored
at located 123456 at the moment. If you rewrite sector 0 as the user,
the drive may allocate another block 342546 and store sector 0 there.
Because of the indirection and mapping notion, it's possible for the
storage state of the SSD internally, to bear no resemblance to how
you think the data is stored at the file system level. Garbage
collection makes no sense, unless you're aware there is indirection
present, and only the SSD knows the mapping between sector number,
and where in the flash, the data is actually stored. If that mapping
is ever corrupted, you're screwed.

Garbage collection then, is tidying up the internal organization, so
that high-speed writing is possible when the user asks for it. If the
drive didn't GC, perhaps write speed would be pathetically slow when
you needed it.

I don't get the impression, that TRIM solves garbage collection. Garbage
collection still has to run. And should be running, any time the disk
is idle. Exactly what the definition of idle is, I haven't a clue. In
"hardware land", this could be any time there is nothing sitting in a
command queue. Meaning, the drive could work on GC the instant it
finishes the last command. If a command comes in, it may require the
GC to "replan" the last operation it was going to do, in case the
system state changed such as to invalidate the move it was planning to do.
Maybe all it would take, is a "blip" to the disk every two seconds,
to prevent it from making any forward progress on GC (because it's forced
to replan things, and that may take some time).

Without any other tools here to work on it, if I wanted to intuit
what a drive was doing, I'd monitor DC current flow into the SSD
as a function of time. That might help me to determine, when the drive
has gone idle, and when it is busy. Some drives (SandForce), the
available data suggests a big current flow difference between being
active and being idle. Some other brands, the specs seem to indicate
the current flow levels are ridiculously (unbelievably) low. So perhaps
I could definitely tell you a SandForce was doing something in the background,
whereas on a Samsung, maybe the numbers would be too small to reliably
use. If the drive had an "internal activity LED", we wouldn't need
to come up with ideas like this. But otherwise, I don't know of a way
to determine what a drive is doing.

Even your hard drive, is busy behind the scenes. Only, in the case
of a hard drive, it's "not doing anything evil". A hard drive, runs
internal SMART routines when it's not busy, intended to test that
certain things still work on the drive. On at least one SCSI drive,
noted in the past, you can tell there is internal activity, because
the drive used to make an audible "buzz" sound of head movement,
every 71 seconds. It was so loud, that it drove several users
right round the bend. That's how you find out a hard drive,
has its own processor, and it can be doing things internally
when you think it is otherwise idle. Since the drive was intended
for servers, the disk manufacturer didn't consider the noise
level to be a problem. But people with that drive in a bedroom,
it didn't stay powered there for long.
Thanks for this interesting explanation. It sounds as though running
on BIOS is of benefit after all. However, I am not sure what is
meant by this. Do you just start the computer then use the command
that takes you to the BIOS then leave it overnight? How does the
computer know to do anything if there is no operating system, or is
this part of the BIOS function?

I assume you would switch off the screen as presumably screensaver
will not work.

One more mystery: if you have wireless keyboard, how can you enter
BIOS at all? Is there a keyboard driver in BIOS without needing
Windows?
 
G

Gene E. Bloch

See inline -

Thanks for this interesting explanation. It sounds as though running
on BIOS is of benefit after all. However, I am not sure what is
meant by this. Do you just start the computer then use the command
that takes you to the BIOS then leave it overnight? How does the
computer know to do anything if there is no operating system, or is
this part of the BIOS function?
Go to the BIOS and don't do anything. The function is part of the SSD's
BIOS, not the motherboard's - according to what I have read in this
thread. Just leave the BIOS waiting for you - it is very patient. Then
next morning, tell the BIOS to continue the boot process and go on to
read your newsgroups when booting is complete.
I assume you would switch off the screen as presumably screensaver
will not work.
Only if you have a CRT monitor. LCD monitors aren't subject to burn-in.
Screensavers are no longer anything but entertainment. Unless the $0.03
worth of electricity is of concern to you.
One more mystery: if you have wireless keyboard, how can you enter
BIOS at all? Is there a keyboard driver in BIOS without needing
Windows?
There is no difference to the BIOS between a wireless keyboard and a
wired keyboard. The dongle looks like any other keyboard connection, as
far as the BIOS can tell.
 
S

Scott

See inline -



Go to the BIOS and don't do anything. The function is part of the SSD's
BIOS, not the motherboard's - according to what I have read in this
thread. Just leave the BIOS waiting for you - it is very patient. Then
next morning, tell the BIOS to continue the boot process and go on to
read your newsgroups when booting is complete.


Only if you have a CRT monitor. LCD monitors aren't subject to burn-in.
Screensavers are no longer anything but entertainment. Unless the $0.03
worth of electricity is of concern to you.


There is no difference to the BIOS between a wireless keyboard and a
wired keyboard. The dongle looks like any other keyboard connection, as
far as the BIOS can tell.
Great. Thanks very much. I shall follow these instructions.
 
G

Gene E. Bloch

Great. Thanks very much. I shall follow these instructions.
I just recalled something that was a problem with keyboard and mice, so
I should pass that info along, although I no longer recall the exact
details.

I had a keyboard with two USB ports on it, i.e., a built-in USB hub. The
BIOS would never recognize keystrokes on that keyboard when I had a
mouse plugged into one of its ports. I tossed it.
 
S

Scott

I just recalled something that was a problem with keyboard and mice, so
I should pass that info along, although I no longer recall the exact
details.

I had a keyboard with two USB ports on it, i.e., a built-in USB hub. The
BIOS would never recognize keystrokes on that keyboard when I had a
mouse plugged into one of its ports. I tossed it.
Bizarrely it won't let me into BIOS. If I press F10 or Esc nothing
happens. It says to press Control I but this does nothing either. Can
you get to BIOS from Windows after Windows has loaded?
 
R

Robin Bignall

On Thu, 07 Mar 2013 18:21:56 +0000, Scott

[SSD]
Thanks for this interesting explanation. It sounds as though running
on BIOS is of benefit after all. However, I am not sure what is
meant by this. Do you just start the computer then use the command
that takes you to the BIOS then leave it overnight? How does the
computer know to do anything if there is no operating system, or is
this part of the BIOS function?
It appears that the SSD does the garbage collection itself, when it is
idle. I don't know what 'idle' means either, but I left the machine
booted into BIOS overnight last night.
I assume you would switch off the screen as presumably screensaver
will not work.
Yes.

One more mystery: if you have wireless keyboard, how can you enter
BIOS at all? Is there a keyboard driver in BIOS without needing
Windows?
Modern BIOS handles USB.

I did all of that, without seeing any appreciable difference, so I don't
have any idea of whether it was successful, or did absolutely nothing.
 
P

Paul

Scott said:
Bizarrely it won't let me into BIOS. If I press F10 or Esc nothing
happens. It says to press Control I but this does nothing either. Can
you get to BIOS from Windows after Windows has loaded?
The history of USB HID devices is spotty. There have been cases of
hardware combinations, where a USB keyboard can't deliver a character
to the BIOS, so you can enter setup. Some users back then, would
keep a USB and a PS/2 keyboard connected, using the PS/2 keyboard
purely for the BIOS Setup screen.

On the wireless devices, the more modern your wireless dongle and
wireless keyboard are, the more likely they work properly at startup.
Again, some ancient wireless ones, didn't work at BIOS level. That
should be fixed by now. On older computers, you have to check
a separate BIOS setup page, which is just for configuring USB,
and enable certain legacy functions (so a USB key press, is
actually stuffed by the BIOS, into the PS/2 processing queue).

If your keyboard won't work for you, to enter the BIOS, then you'll
have a problem entering BIOS Setup. You could try another keyboard,
say a wired one, which you keep off to the side of the PC, and only
use it to press the "magic key" to enter the BIOS. The BIOS screen
should have printed on it, during POST, what keys to use. It should
not involve the Control key as a rule. (The control key is used for
things like <control>-I for an Intel RAID setup screen or the like.
The <control> key combo tends to be used for RAID screens.) Vanilla
BIOS setup can be F2 or Delete, as a couple examples. My laptop uses
F2 for BIOS Setup and F12 for the popup boot menu. Either would work
for the purposes of BIOS parking. Once the BIOS settles down for
around 20 seconds, there should be no further activity with respect
to storage devices. And in the BIOS popup screen, it's "quiet" enough,
I can even unplug flash boot devices safely.

Another key you can use at BIOS level, is Pause/Break. If you
press the Pause key, that stops the printing to the screen by
the BIOS. It's intended to allow the user some time to read the
screen. On my laptop with the Insyde branded BIOS, there is only
a BIOS screen visible for one second, so you have to be damn fast
to press any necessary key. Using the Pause key, is how I got
that screen to stand still long enough, to read that I needed
to press F2 or F12 :)

You have to have reflexes like a Ninja, to use my laptop...

The only other idea that comes to mind, to make the disk
"quiet", would be booting a Linux LiveCD. Linux still
looks at disks at startup, to see what's on them (for
example, using a swap partition if it can find one). But
perhaps after that, if you don't click anything, it
should stay quiescent. On some of those, if you
don't like the spinning CD noise all night long,
you can enter "TORAM=yes" on the boot command
line, which copies the boot CD into RAM, and then
you're "allowed" to eject the CD. Linux LiveCDs can
also be copied to USB pen drives (a method I use
for my Ubuntu key).

Even an MSDOS boot floppy, would be better than nothing.
You stay at the A: prompt all night, the drives sleep
nicely and so on. I have an MSDOS floppy that still
works on my Core2 machine. I don't use it that often though.
One of the floppies I have, has FreeDOS on it. Which
would be another way to do it.

Paul
 
P

Paul

Robin said:
On Thu, 07 Mar 2013 18:21:56 +0000, Scott

[SSD]
Thanks for this interesting explanation. It sounds as though running
on BIOS is of benefit after all. However, I am not sure what is
meant by this. Do you just start the computer then use the command
that takes you to the BIOS then leave it overnight? How does the
computer know to do anything if there is no operating system, or is
this part of the BIOS function?
It appears that the SSD does the garbage collection itself, when it is
idle. I don't know what 'idle' means either, but I left the machine
booted into BIOS overnight last night.
I assume you would switch off the screen as presumably screensaver
will not work.
Yes.

One more mystery: if you have wireless keyboard, how can you enter
BIOS at all? Is there a keyboard driver in BIOS without needing
Windows?
Modern BIOS handles USB.

I did all of that, without seeing any appreciable difference, so I don't
have any idea of whether it was successful, or did absolutely nothing.
 
P

Paul

Paul said:
Robin said:
On Thu, 07 Mar 2013 18:21:56 +0000, Scott

[SSD]
Thanks for this interesting explanation. It sounds as though running
on BIOS is of benefit after all. However, I am not sure what is
meant by this. Do you just start the computer then use the command
that takes you to the BIOS then leave it overnight? How does the
computer know to do anything if there is no operating system, or is
this part of the BIOS function?
It appears that the SSD does the garbage collection itself, when it is
idle. I don't know what 'idle' means either, but I left the machine
booted into BIOS overnight last night.
I assume you would switch off the screen as presumably screensaver
will not work.
Yes.

One more mystery: if you have wireless keyboard, how can you enter
BIOS at all? Is there a keyboard driver in BIOS without needing
Windows?
Modern BIOS handles USB.

I did all of that, without seeing any appreciable difference, so I don't
have any idea of whether it was successful, or did absolutely nothing.
Oops. Empty post there...

If you wanted to see it make a difference, you'd need to abuse your
drive with a 4KB random file write test. Then see whether an overnight
"rest" helps it. Monitor performance with HDTune Pro (write/read test)
and the like.

And it's not really practical to do those tests, on your SSD system drive.

If the sustained write speed is as good now, as it was the day you
got the drive, then GC must be working. If the drive is a lot slower,
you could experiment with "resting it". Or worst case, use
"Secure Erase" program, to reset the thing. (Then, restore from
backup.) I was reading the claim, that Secure Erase is supposed to
reset internal state information on the drive (because Secure Erase
uses a single command, and the drive processor does all the work,
and the drive then knows it is back to T=0 conditions). Secure
Erase, is a command added to the ATA command set, by people
at this facility. They proposed it.

http://cmrr.ucsd.edu/people/Hughes/SecureErase.shtml

Paul
 
G

Gene E. Bloch

Bizarrely it won't let me into BIOS. If I press F10 or Esc nothing
happens. It says to press Control I but this does nothing either. Can
you get to BIOS from Windows after Windows has loaded?
You can't get there from Windows. That's a pretty definitive statement,
but maybe someone has devised a way to do it (probably from a boot CD,
rather than from inside Windows). Either way, although I'm happy to go
into the BIOS the regular way, I'd be scared to try one of those methods
:)

What I did with my problem KB was to plug in a regular (hubless, I mean)
KB, or plug the mouse directly into the computer. I forgot which one of
those I did, but it worked. As I said, I got a better KB/Mouse combo
eventually.

Did F10 or Ctrl-I work for you before? They are unfamiliar to me. F2 or
Delete are the keys I've seen before, although I've seen F12 or Esc work
to get into a boot menu, from which the BIOS is possibly available.
 
S

Scott

On Fri, 8 Mar 2013 12:08:36 -0800, "Gene E. Bloch"

[snip]
You can't get there from Windows. That's a pretty definitive statement,
but maybe someone has devised a way to do it (probably from a boot CD,
rather than from inside Windows). Either way, although I'm happy to go
into the BIOS the regular way, I'd be scared to try one of those methods
:)
That's what I thought.
What I did with my problem KB was to plug in a regular (hubless, I mean)
KB, or plug the mouse directly into the computer. I forgot which one of
those I did, but it worked. As I said, I got a better KB/Mouse combo
eventually.
If I do that, can I then adjust the settings to make it recognise the
wireless keyboard in future?
Did F10 or Ctrl-I work for you before? They are unfamiliar to me. F2 or
Delete are the keys I've seen before, although I've seen F12 or Esc work
to get into a boot menu, from which the BIOS is possibly available.
F10 I think is the key for HP machines. Ctrl-I has never worked but
seems to be suggested from the screen so I tried it and it does
nothing. I think the problem only occurred after installing the
solid state drive, so I wonder if the guy that installed it disturbed
the BIOS settings.
 
G

Gene E. Bloch

On Fri, 8 Mar 2013 12:08:36 -0800, "Gene E. Bloch"

[snip]
You can't get there from Windows. That's a pretty definitive statement,
but maybe someone has devised a way to do it (probably from a boot CD,
rather than from inside Windows). Either way, although I'm happy to go
into the BIOS the regular way, I'd be scared to try one of those methods
:)
That's what I thought.
What I did with my problem KB was to plug in a regular (hubless, I mean)
KB, or plug the mouse directly into the computer. I forgot which one of
those I did, but it worked. As I said, I got a better KB/Mouse combo
eventually.
If I do that, can I then adjust the settings to make it recognise the
wireless keyboard in future?
Not unless you can do it now.
F10 I think is the key for HP machines. Ctrl-I has never worked but
seems to be suggested from the screen so I tried it and it does
nothing. I think the problem only occurred after installing the
solid state drive, so I wonder if the guy that installed it disturbed
the BIOS settings.
If so, it's surely worth plugging another keyboard in long enough to fix
the problem, yes?
 
G

Gene E. Bloch

Not unless you can do it now.
I think what I wrote is ambiguous.

What I mean is that if it couldn't already (i.e. before your troubles)
be set to recognize the wireless KB, it never will be.

And AFAIK, as I said before, a wireless keyboard looks just the same as
a wired keyboard to the BIOS. The dongle is just the near end of a USB
cable as far as the USB port is concerned, unless it takes more than
500ma to run, in which case it is not compliant to the USB standard.

I forgot - did you say whether your dongle is plugged directly into a
USB port, rather than into a hub?
 
S

Scott

I think what I wrote is ambiguous.

What I mean is that if it couldn't already (i.e. before your troubles)
be set to recognize the wireless KB, it never will be.
It did work previously.
And AFAIK, as I said before, a wireless keyboard looks just the same as
a wired keyboard to the BIOS. The dongle is just the near end of a USB
cable as far as the USB port is concerned, unless it takes more than
500ma to run, in which case it is not compliant to the USB standard.

I forgot - did you say whether your dongle is plugged directly into a
USB port, rather than into a hub?
That is truly inspirational. When I reassembled the wiring I may well
have put the dongle into a different USB port. It did not occur to me
that there was any difference. If the second port is a hub that could
explain the problem.
 
S

Scott

I think what I wrote is ambiguous.

What I mean is that if it couldn't already (i.e. before your troubles)
be set to recognize the wireless KB, it never will be.

And AFAIK, as I said before, a wireless keyboard looks just the same as
a wired keyboard to the BIOS. The dongle is just the near end of a USB
cable as far as the USB port is concerned, unless it takes more than
500ma to run, in which case it is not compliant to the USB standard.

I forgot - did you say whether your dongle is plugged directly into a
USB port, rather than into a hub?
Brilliant! It was plugged into the USB 3.0 port. I have moved it to
the USB 2.0 port and the problem is solved.
 
G

Gene E. Bloch

It did work previously.

That is truly inspirational. When I reassembled the wiring I may well
have put the dongle into a different USB port. It did not occur to me
that there was any difference. If the second port is a hub that could
explain the problem.
(Been away)

A hub is an external device (or usually is). It's like an extension
cord, expanding one USB port into two or more (I've seen as many as 8).

Since the base port is limited to supplying 500 ma of current, a port
without an external supply can't power very many devices. But the worst
thing is that some devices don't play well through hubs even without a
power problem.

From what you say, it sounds like that wouldn't be your problem
(although behind the scenes, a front panel device with four ports might
happen to be a hub).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top