removed disk partitions - disk is now too small
I have a 12o GB disk that was originally partitioned into 4 disks. I decided to be more flexible (this is intended to be a backup disk) so I deleted all of the partitions via fdisk and created a new one. Unfortunately, the new one is only showing it is 49GB. I assume I need to format it after partitioning(?) but I can't figure out how.
Of course there may be a size limit for a primary partition as well...
any help here would be most helpful!!
I'm assuming this is in preparation of a fresh OS install . . .
Is fdisk/cfdisk showing your total capacity for all devices to be only 49GB? Or does the 49GB reflect those devices with a filesystem?
At any rate: to format a partition in linux, here's a man page excerpt for mkfs (the linux formatter, or more precicely, filesystem creator):
mkfs [ -V ] [ -t fstype ] [ fs-options ] filesys [ blocks ]
mkfs is used to build a Linux file system on a device, usually a hard disk partition. filesys is either the device name (e.g. /dev/hda1, /dev/sdb2) or the mount point (e.g. /, /usr, /home) for the file system. blocks is the number of blocks to be used for the file system.
The exit code returned by mkfs is 0 on success and 1 on failure.
In actuality, mkfs is simply a front-end for the various file system builders (mkfs.fstype) available under Linux. The file system-specific builder is searched for in a number of directories like perhaps /sbin, /sbin/fs, /sbin/fs.d, /etc/fs, /etc (the precise list is defined at compile time but at least contains /sbin and /sbin/fs), and finally in the directories listed in the PATH enviroment variable. Please see the file system-specific builder manual pages for further details.
Produce verbose output, including all file system-specific commands that are executed. Specifying this option more than once inhibits execution of any file system-specific commands. This is really only useful for testing.
Specifies the type of file system to be built. If not specified, the default file system type (currently ext2) is used.
File system-specific options to be passed to the real file system builder. Although not guaranteed, the following options are supported by most file system builders.
Check the device for bad blocks before building the file system.
Read the bad blocks list from filename
Produce verbose output.
This is actually a working system. I have a disk that was multiply partitioned and I now want to use strictly as a backup so I don't want the partitions any more. I ran fdisk and deleted the partitions and then recreated a single partition. I think the step I missed was actually formatting it. Sounds like this does everything - I'll give it a shot tonight when I get home - thanks for the tip.
as a suggestion, you'll probably not want to use an ext2 filesystem, you're better off with a journaling file system like ext3 or reiserfs.
How did you get the 49GB figure?
mkfs did the trick - I'd never heard of it and when I did an apropos on fornat and fdsik, I don't remember it coming up - thanks for pointing it out.
I do have another question (see near the bottom of this posting.)
I did use ext3 as you suggested.
The 49GB must have been what the first partition was set to. When I did the fdisk, It resized the drive, but somehow it kept the original size before formatting.
Another thing I needed to do... I needed to mount /dev/hdd (instead of /dev/hdd1) in /etc/fstab.
Now, df -h reports:
[root@dot root]# df -h /backup/
Filesystem Size Used Avail Use% Mounted on
/dev/hdd 111G 7.9G 97G 8% /backup
(Note it is a 120 GB drive, but it is reporting as 111 GB.)
And finally, fdisk -l reports:
Disk /dev/hdd: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/hdd doesn't contain a valid partition table
The part about not having a valid partition table bothers me (although it seems to be working fine...) Can someone explain this?
thanks to all that helped!
mkfs.e2fs -j /dev/hdd
hdd is the name of the whole drive. Instead of formating the first partition only, you formated EVERYTHING. There IS no partition table, because you formated over the top of it. If you just want one partition, I wouldn't worry about it too much. Normally you would fdisk /dev/hdd to create hdd1, and then format hdd1.
When you used fdisk to check the drive stats, it tried to read the partition table, and didn't find anything that made sense. You can either use the drive as is, or you can fdisk again and format hda1 only.
Great catch - I think that is exactly what I did.
Would reformatting also report a more correct size of the drive (closer to 120GB instead of the 111GB it currently shows?)
Thanks for your help,
No. Often disk manufactures lie about the disk size.
1024B = 1KB
1024KB = 1MB
1024MB = 1GB
This is NOT the metric system, but it steals the naming convention from the metric. Disk manufacturers like to use a metric conversion to use a slightly larger number to sell the drive.
120,000,000,000B = 111.75GB
Sorry, but I think that is what is happening here.
Technically there is no such a prefix as K, it stands for Kelvin and Sir Kelvin has nothing to do with bytes.
Correct prefix is k- for 1000, and Ki for kilobinary.
Have a great day!
Ok, smart alek...
There is a bit of controversy over this that I was hoping to avoid. 'k' is a metric prefix; 'KB' on the other hand is NOT a metric unit (as I mentioned above).
A few years ago, scientist and others discovered that computer geeks were "misusing" the metric prefixes.
"Oh no, they're using our prefixes to mean something else, we've got to do something about it! Here, let's tell them that they can no longer use KB, MB, and GB. We will instead benevolently bestow upon them the KiB, MiB, and GiB."
Alright, so the push probably came mostly from those who are in the computer science field to some extent, though a minority of them. The fact remains that few people use these measurements. The fact also remains that there would be EXTREMELY little confussion if everyone just accepted the fact that memory is measured in base 1024 increments.
Note also that you didn't post the page you thought you did. The one you were after was:
Which can be found off of that page. Note also that the NIST is hosting this information, but are not taking credit for it. They are only forwarding the standard that is trying to be enforced, not the one(s) being widely used.
Sorry, I posted right page.
My point was there is no prefix "K".
You can use kB or KiB, but no KB.
Sorry again. I point flaming finger to MS. AFAIK they started to misuse this unit.
There is no standard containing prefix "K". !!! "K" stands for Kelvin degree (temperature).
The fact prefix K is not in SI table does not give you the right put it wherever you want.
Next thing you tell as the m (milli-) and M (mega-) are the same?
And stay cool, 310 K is just enough for your body.
Remember, a teacher's position comes with great responsibility.
I'm sorry that I sound hot headed about it. It just really irritates me when standards are not standard. MS may have been the culprit that spread the "misuse" around, but I have a suspicion that 'KB' was used before then.
The fact that 'K' is not in the SI table neither gives nor takes away the right to use it in this context. It is an informal industry standard. I acknowledge that if I wanted to use a formal designation, I would use KiB. If all of the sudden everyone started using this new set of terms, most of my frustration over this would go away. As it stands, the terms are just not used, not even by manufacturers (by and large).
No, you don't have to worry. 'm' and 'M' are safe from the evil likes of me! :D
The last line of your post shows intelligence and perspective. In a sense, we are all teachers and students here. The truth is, there are many wonderful teachers here at linuxquestions. There are also some who have partial answers, and are willing to lend a hand. I believe that I tend to fit in this category. I'll tend to answer when nobody more intelligent than I cares to. I prefer to think of everyone here as helping hands, all helping each other. The idea that someone will take what I say, and immediately accept it as true is scary, but it will happen.
|All times are GMT -5. The time now is 02:28 AM.|