[SOLVED] can I do mkfs after transferring data to HD
Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I was having some trouble with a Hard drive that I store my photo's and other personal data on. Fisrtly, it was messing my OS up, so that it would not boot to the desktop, but only to the command line where it would report that this drive was somehow corrupted and needed to be repaired. Secondly, the OS was reporting that certain files were 380,000.2 TB in size. this drive is only 200 GB.
I didn't want to do the repair until I found a way to back up my data. I found another hard drive to do backup to but I had to take some data off of it. Which I did.
In the spirit of trying learn command line I decided to partition and format the hard drive using fdisk. I found some easy to use directions and proceeded to partition the drive. Unfortunately, I failed to realize the directions were only for the partitioning part [my fault for not reading further]. What I missed was that after using fdisk to partition, you must use mkfs to set filesystem type.[I thought I had done that in fdisk using the "l" , "t" commands within fdisk].
My questions are:
1] Can I do this mkfs command after I have put my data on the new hard drive or should I start fresh and redo partioning? [I have not deleted the other drive so my data is still there.]
2] What would be the cause of the incorrectly reported file sizes?
Presuming you have your data safely tucked away somewhere else:
- the partition type in the partition table says what type (Linux) not what filesystem.
- after partitioning like that you have to mkfs to format a filesystem type (ext3, jfs, whatever - even NTFS). This will delete all data in this partition.
- logic errors in the metadata causes all sorts of weird errors - fsck is used to "fix" these; "man fsck" for info.