Partitioning an hd with bad sector

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.
Locked
MOGM

Partitioning an hd with bad sector

Post by MOGM »

Hi to everybody,
i'm trying to install linux mint on my laptop (compaq presario R3000) but i'd like not to lose the xp partition.
I tried this way:
-freed about 25 gigabytes on the win partition
-made a backup copy of my data
-defragged the disk three times
-booted from the mint cd (felicia, main edition)

The problem is that gparted refuses to resize the ntfs partition, since it has a "bad sector". It recommends executing chkdsk /F/R and reboot twice, then resize the partition with ntfsresize -bad--sectors.

I tried doing this but all i can get is to reduce the space available to win without being able to create a partition for linux.

Please, help me to say Windows goodbye
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Fred

Re: Partitioning an hd with bad sector

Post by Fred »

MOGM,

Greetings. Let me get a bit more information. Will Windows still boot and run correctly?

Boot the Mint live cd and find a program in your menu called gparted. It is a partitioning program. Open it and post a screen shot of your partition table.

At least you have a backup of your data, so that is one thing you have going for you. :-)

Fred
MOGM

Re: Partitioning an hd with bad sector

Post by MOGM »

Tanks for the interest, Fred.
Win runs perfectly, i took the screen you asked me.
Here it is
Image


I shot also the error screen.
Image

Hope it helps.
DataMan

Re: Partitioning an hd with bad sector

Post by DataMan »

As the warning message you display mentioned, you are probably on borrowed time with this h/d. If you've done the remidiation recommended and it hasn't resolved the situation, you should definitely be thinking short term of making the capital expenditure toward a replacement h/d. Post back if you need assistance in backing up your partitions for re-imaging back to a new h/d.

DataMan
Fred

Re: Partitioning an hd with bad sector

Post by Fred »

MOGM,

I am torn between taking the tact Dataman has in the above post or pointing you toward more analysis.

There is a tool set called "smartmontools" in the repos that could give you more info regarding the health of the hard drive. You might want to google it and read a bit. If in fact you are actually having a problem with the disk itself and not a problem with ntfs file system corruption, then you should begin immediately to transition to another hard drive before disaster strikes and you are out of the computer business. At least as far as the hard drive goes. :-)

Since you are still functional with Windows I suspect it is a disk problem and not a file system problem but using "smartmontools" will be able to nail that down for you.

I am sure there are Windows tools that can do the same thing but I am not familiar with what they might be enough to recommend a particular program.

Good luck.

Fred
MOGM

Re: Partitioning an hd with bad sector

Post by MOGM »

Fred,
I've googled smartmontools and found a winxp version.
When running the test i receive the following output:
Image
From my newbie interpretation it seems that the drive is ok, but as said i have also made a backup of my data, just in case.
viking777

Re: Partitioning an hd with bad sector

Post by viking777 »

So let us assume your disk is OK then. Can you just bring me up to date, have you tried the ntfsresize option yet or not? If you have, what happened? Ntfsresize doesn't actually shrink partitions itself, it just resizes the filesystem so it takes up less space on the existing partition leaving you to resize the partition youself.
MOGM

Re: Partitioning an hd with bad sector

Post by MOGM »

I've already tried ntfsresize with the --bad-sector option, but since it does not shrinks the partition and GParted still refuses to do it i'm struk at this point.
I'd be grate to anyone who can tell me a way to create a new partition for the mint installation.
By the way, if the disk is ok, why GParted signals an error?
Fred

Re: Partitioning an hd with bad sector

Post by Fred »

MOGM,

I am going to throw out a few possibles for you to mix-n-match and choose from. :-)

Observations:

1.) My suspicions were wrong. The disk is probably just fine. Which would indicate some undefined file system corruption.

2.) When was the last time you did a really thorough anti-virus scan of all files? Once-upon-a-time there was a cute little virus that planted itself in the file system. The way it did this was change the length of a sector from 512 to some other value. I forget now what length but it is unimportant at this point. This left another sector too short. chkdsk would fix this by marking the two non-standard sectors as defective, however when you reboot, a stub that is placed in the 1st sector, (boot sector), triggers the virus to re-plant itself and the process begins anew. A good way to get an indication of this virus is to run chkdsk and reboot twice and check the storage available. Run chkdsk again and do the same thing. If you have this or some variation of this virus you will never get it to stay fixed and the storage space will just continue to be reduced each time. This is a very hard virus to get rid of once you are infected. It is hard to find and hard to fix without using mass destruction techniques.

3.) It could be just some common file system corruption, which ntfs is prone to do, for no obvious reason, from time to time. It is just a coincidence that it doesn't seem to affect the operation of the system, at least not at this point in time.

Fixes:

1.) Stay with Windows on this drive and do nothing. System is working... at least for now.

2.) Off-load your operating system and data as is, re-constitute a fresh ntfs file system, and put everything back on the drive. At the same time you can allow space for the Linux install. If it is a virus problem you will still have it however.

3.) Backup your data, (only data, no executables or system files, and then only after they have been scanned), dd the entire drive and start over with a fresh set of partitions and new XP install. This is the drastic fix but the only one that is a 99.9% sure thing.

Fred
MOGM

Re: Partitioning an hd with bad sector

Post by MOGM »

Fred,
I made the test you suggested to find the virus, here are the results.
Prior to making the first chkdsk/f/r&reboot twice cycle i had 32.178.996.528 bytes of free space
After the first cycle they were 32.181.276.672
After a second cycle they were 32.181.514.240
Are this fluctuations normal or is a virus at work?

Unfortunately i don't have the xp install cd with me, so formatting the whole hd is not a viable option, at least for a time, which leaves me struck with an inexplicably working xp.
viking777

Re: Partitioning an hd with bad sector

Post by viking777 »

MOGM. Am I correct in thinking that the way you are tackling this is to boot from the live cd then run gparted and then try to create a partition on which to install Mint? If this is the case then why not tackle it a different way. Boot from the live cd and hit the install button. When you get to the partitioning screen select 'guided resize' or whatever it is called and let the installer create the partition for you - not something I would normally recommend, but I have run out of other ideas.

There is no reason on earth why this should work when what you are doing doesn't, but that alone makes it worth a try!

Of course if I have misunderstood and you have been doing this all along then just dismiss this post as the ramblings of a demented old man!
MOGM

Re: Partitioning an hd with bad sector

Post by MOGM »

viking777,
You are right, i was using GParted from the booted cd to partition my hd.
I've already tried using the mint installer to make a "guided resize" but it seems to have no such option and the custom installation requires to format entirely the existing partitions.
Anyway, tanks for sharing your ideas.
Fred

Re: Partitioning an hd with bad sector

Post by Fred »

MOGM,

I see nothing in your numbers that would lead me to believe that you have a virus problem. That leaves option (1) or (2) in my post above. Not that I don't want you to use Linux, but if I were in your position, I would do nothing. I tend to be pretty conservative so since you don't have an install disk for XP currently available, I wouldn't risk a mistake doing option (2). But that is just me.

I really don't know what else to tell you at this point, but will be willing to try to answer any questions you might have.

Fred
Last edited by Fred on Sat Feb 28, 2009 2:08 pm, edited 1 time in total.
MOGM

Re: Partitioning an hd with bad sector

Post by MOGM »

Fred,
In fact i do have a linux mint and ubuntu cds available, but not the xp one.
I've made a thought about using the ubuntu cd to install it and then download the mint packages, but it seems a bit to elaborate for my actual skills.
I'll simply procrastinate the installation until i can get the xp cd or the system crashes, whatever comes first.
Tanks for the advice.
Fred

Re: Partitioning an hd with bad sector

Post by Fred »

MOGM,

I misspoke in my post above. Please re-read it. lol

Fred
MOGM

Re: Partitioning an hd with bad sector

Post by MOGM »

Fred, Nevermind, i've figured it.
Locked

Return to “Beginner Questions”