You are not logged in.
Hi, everyone
Two months ago I broke my partition table by trying to install windows 8. I had it repaired with "test-disk" , but the problem is that gparted now sees my disk as a whole 300Gb unpartitioned space, fdisk however recognizes the partition table. I was wondering what will happen if I press 'w' in fdisk
will this format the partitions and erase everything, or will it just try to do something similar to what test-disk did? I want to do this because now I have a 50 gig partition left for windows and I want to add this to my / partition. Before the problems I used to do this kind of operations with gparted.
Thanks ![]()
Offline
"w" writes any changes you've made to disk, so yes, it will reformat the partition if that's what you've selected. Were I in your shoes, I'd have made a backup before trying to install Win8, and restored that after problems emerged. You did make a backup before installing highly unstable software onto your machine, right?
Offline
If you have another drive laying around, I highly recommend making an image of your drive prior to doing anything. If you use dd, the normal warnings apply -- one misstep, and you can easily "destroy data" . Then go ahead and write the partition table. If things go awry, you can restore from your image,
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
In its normal operation*, fdisk only touches the partition table. It does not "format" in the filesystem sense, nor does it have any other affect on the actual data. It affects your ability to access the data, not the data itself.
That said, I think incorrect partition boundaries can lead to data corruption if the partition is mounted and written to.
*As opposed 'expert mode'.
Last edited by alphaniner (2012-05-16 16:56:21)
But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner
Offline
No, I didn't make backup of anything. I know it's pretty stupid
but I've never been into backups. Can u tell me how to backup just the arch partitions? Do you mean to just copy everything from / ?(without run of course) This will take ages
I cannot backup the whole drive, cause I don't have another big enough drive
Thanks
Offline
In its normal operation*, fdisk only touches the partition table. It does not "format" in the filesystem sense, nor does it have any other affect on the actual data. It affects your ability to access the data, not the data itself.
That said, I think incorrect partition boundaries can lead to data corruption if the partition is mounted and written to.
Kind of like tearing up the map. If you lose the map, you will never reliably find your data.
As someone once said, "On a clear disk, you can seek forever"
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
I won't touch it when mounted. I plan to use arch minimal install CD
The partition table which fdisk shows me when I use the p option looks good. And the filemanager also recognizes the different partitions, I can browse them etc. but gparted for some reason can't see the partition table. Is there any other tool like gparted and which is at least as reliable as gparted?
Last edited by raxbg (2012-05-16 17:16:04)
Offline
Kind of like tearing up the map.
That's why you zerox of the map (dd ... bs=440 count=1 or at least fdisk -l /dev/... >somefile) before you rip it up. The latter is all I needed to save my butt when I borked a PT. As long as you use your head, there is no reason dicking with the partition table particularly warrants a full data backup.
That said, you can bet your @$$ I'd backup even "reaquirable" data in this situation, unless doing so was more trouble than reaquiring it would be. "An ounce of prevention" and such. Unique data, fugeddaboudit. I have at least three copies of stuff I can't replace and don't want to lose.
Last edited by alphaniner (2012-05-16 18:20:32)
But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner
Offline
gparted is just a pretty front-end for the tools that actually do the work i.e. parted and the various filesystem utilities. Personally, I prefer using those directly on the cli.
Offline
tomk I'm aware of that, but since it's just a front end what will be the difference if I use the cli version?
Offline
Probably nothing... unless something is wrong with gparted. Pretty front-end = more code = more bugs.
But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner
Offline
That's why you zerox of the map (dd ... bs=440 count=1 or at least fdisk -l /dev/... >somefile) before you rip it up.
That would be backing up only the boot code that resides in the MBR and not the partition table, which is not the idea I guess.
R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K
Offline
Doh! You're right.
But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner
Offline
I took a deep breathe and pressed the 'w' but nothing's changed
I noticed something strange though, if I try to open the drive with cfdisk I am getting this error "Bad primary partition 4: Partition ends after end-of-disk". Huh I don't remember having 4 primary partitions only 2 or 3 and 1 extended. Wtf ?!? ![]()
Last edited by raxbg (2012-05-17 13:10:28)
Offline
The extended partition counts as a primary partition.
R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K
Offline
When I look at fdisk I see that the end of the extended partition is far after the end of the last partition. What will happen if I try to reduce it
Is there a way to set the end to something closer to to the end of the last partition?
Device Boot Start End Blocks Id System
/dev/sda4 99329895 625153409 262911757+ f W95 Ext'd (LBA)
/dev/sda10 245966848 625139711 189586432 7 HPFS/NTFS/exFATLast edited by raxbg (2012-05-17 15:07:48)
Offline
What if I delete all partitions after the third and recreate them, with only changing the end sector of the extended partition, and then write down the new table?
Last edited by raxbg (2012-05-17 15:32:28)
Offline
You should backup the data you have on the offending partition, delete it with whatever program you choose, fdisk will be fine, then recreate the partition and check it ends within the disk boundaries, format and copy your data back.
R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K
Offline
Why do I have to format? I will preserve the start and end points of the other partitions.
Offline
If you delete 1 partition, then recreate it with different boundaries you probably want to create a new filesystem there aka format the partition.
R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K
Offline
If you're not going to put the logical partitions back exactly as they are, I think you should be safe. But you should still backup your data if you aren't willing to risk losing it. Also, don't take this the wrong way, but you could benefit from following the link in ewaller's sig...
But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner
Offline
Haha well I am probably one of the worst "forumers", I never look at people's signatures
. Shame on me. I am sorry for the bad English
One more thing to ask. Since the goal is just to expand my / partition, do I have to go through so much pain? Isn't there another way to transfer the space allocated for windows back to the / partition? This is all I want, I don't really care that the partition table is a little messed up since everything is working.
And really sorry for responding so slow, but I have a lot of work these days.
Last edited by raxbg (2012-05-19 10:46:45)
Offline
I've learned the hard way that it is better to do a full backup before doing any operations with partitions. And you really should get all problems related to partitions sorted out, in my opinion it is a bad idea to have any program complain about the partition table, as it might cause so problems later on.
R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K
Offline
Ok I will copy everything to external drive. If I use just "sudo cp / <destination>" and then If something go wrong when messing with the partitions, if I just copy back everything will I have the same system as now?
Offline
Usually I do full disk images, I prefer that to copying individual files, If anything goes wrong it's just a matter of restoring the full disk image, at most you will end in an equal state as when you started.
If copying file by file I would use rsync but I guess it may be a matter of preference. I do use rsync but only when copying files from the backup image to newly created partitions, using cp -r should work too but I don't have experience with that.
R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K
Offline