LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   removed disk partitions - disk is now too small (https://www.linuxquestions.org/questions/linux-software-2/removed-disk-partitions-disk-is-now-too-small-263474/)

jordanthompson 12-06-2004 11:03 PM

removed disk partitions - disk is now too small
 
Hi all,
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!!

thanks

gco10996 12-07-2004 06:17 AM

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 ]
DESCRIPTION
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.

OPTIONS
-V
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.
-t fstype
Specifies the type of file system to be built. If not specified, the default file system type (currently ext2) is used.
fs-options
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.
-c
Check the device for bad blocks before building the file system.
-l filename
Read the bad blocks list from filename
-v
Produce verbose output.

jordanthompson 12-07-2004 08:20 AM

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.

BrianK 12-07-2004 11:54 AM

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?

jordanthompson 12-07-2004 10:35 PM

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
[root@dot root]#

QUIESTION/OBSERVATION:
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!

Jordan

gd2shoe 12-07-2004 10:52 PM

Quote:

Originally posted by jordanthompson
...
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
...
Disk /dev/hdd doesn't contain a valid partition table
[root@dot root]#
...
QUIESTION/OBSERVATION:
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!

Jordan [/B]
Hmmm. Odd. I think I know what happened though. When you created the filesystem you typed something like:

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.

jordanthompson 12-08-2004 11:37 AM

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,
Jordan

gd2shoe 12-08-2004 02:29 PM

No. Often disk manufactures lie about the disk size.

Technically:
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.

Emerson 12-08-2004 03:40 PM

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.

http://physics.nist.gov/cuu/Units/prefixes.html

Have a great day!

gd2shoe 12-08-2004 06:03 PM

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.

gd2shoe 12-08-2004 06:08 PM

Note also that you didn't post the page you thought you did. The one you were after was:

http://physics.nist.gov/cuu/Units/binary.html

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.

Emerson 12-08-2004 06:26 PM

Sorry, I posted right page.
My point was there is no prefix "K".
You can use kB or KiB, but no KB.

gd2shoe 12-08-2004 06:36 PM

Quote:

Originally posted by Emerson
Sorry, I posted right page.
My point was there is no prefix "K".
You can use kB or KiB, but no KB.

Yeah, and my point is that I can use KB all I want to (1024 B). Until KiB actually becomes an industry standard (if ever), there is nothing wrong with using a unit name that is widely known. Don't get my wrong, I'm not totally opposed to something like KiB, I just don't see a point to trying to convince an entire industry to change it's naming scheme for no reason. I say, let the standard stand.

Emerson 12-08-2004 06:53 PM

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.

gd2shoe 12-08-2004 08:46 PM

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.

Emerson 12-09-2004 06:51 AM

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

------------End of quote

Not you. Actually, this is not funny. US is a great country. But world is joining, it's 21st century, and US is putting itself in isolation. Here is the description of a LCD monitor from bizrate.com

1280 x 1024 Pixels - Dot Pitch 0.264 Mm - SXGA

Again some sort of informal industry standard? Is this your American way? What unit is this Mm? Is it millimile? Megamile? If you adopt m as meter, why you (=americans) have to refuse m as milli and use M instead?

After WWII America decided to switch to metric system. But you (=US) stopped on half way and currently you are just increasing the mess. Some examples:

Symbol - US-Name
------ -------
A - amp (ampere)
C - coul (coulomb)
dyn - dyne
F - farad
G - gauss
g - gm (gram)
H - henry
Hz - hz (hertz)
J - joule
K - degC (kelvin)
kg - kg (kilogram)
l - liter
m - m (meter)
MHz - mhz (megahertz)
ml - ml (milliliter)
Mx - maxwell
N - nt (newton)
Oe - oe (oersted)
P - poise
Pa - pascal
s - s (sec, second)
St - stoke
T - tesla
V - volt
W - watt
Wb - weber
Ohm (Omega) - ohm

Dear gd2shoe. Maybe there is a informal industry standard in US allowing YOU (=a guy from CA) to use KB instead of kB. But this forum is read worldwide. And for rest of the world K is Kelvin degree, and KB (kelvinbyte) is a nonsense.

--
Respectfully, Emerson

Emerson 12-09-2004 07:02 AM

I recognized we have gone totally offtopic here. If you feel you need to respond - do it. I'm finished HERE.

jordanthompson 12-09-2004 11:55 AM

Anywayyyyyy..... :-)

Quote:

Originally posted by gd2shoe
Hmmm. Odd. I think I know what happened though. When you created the filesystem you typed something like:

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.

You were exactly correct about hdd versus hdd1. I reformatted (using my new tool mkfs!) and pointed it at /dev/hdd1 and everything works as advertised (no errors not warnings.)

thanks for your help and efforts

And besides, I thought that K was for Kellogs. :-)

gd2shoe 12-09-2004 03:07 PM

Quote:

Originally posted by Emerson

....
Not you. Actually, this is not funny. US is a great country. But world is joining, it's 21st century, and US is putting itself in isolation. Here is the description of a LCD monitor from bizrate.com

1280 x 1024 Pixels - Dot Pitch 0.264 Mm - SXGA

Again some sort of informal industry standard? Is this your American way? What unit is this Mm? Is it millimile? Megamile? If you adopt m as meter, why you (=americans) have to refuse m as milli and use M instead?

....
--
Respectfully, Emerson

(1) I didn't know about the flagrant error on the part of bizrate.com . Had I known that you were referencing something that had happened, I would have responded differently. Had I seen that, it would have disappointed me too.

(2) I am not personally responsible for all mistakes made by my countrymen. So please don't act like it. If you want to help Americans (or anyone), don't blame them for the stupidity that happens around them.

(3) We didn't even get half way. Not even close. I wish we had. They are teaching SI in the public schools. The schools I've been to have almost stopped teaching the old standards completely. I think the switch will happen eventually, but it will be painful. It's not even on any political agenda anymore (to my knowledge). The nation wide hassle of switching to metric is just not popular.

(4) I respect you posting your opinion here. Part of what I love about the forums are the different opinions and points of view that are brought out. This is particularly true of an international forum. I'm just particularly stubborn on this topic. Note that two different os tools told jordanthompson that his hard drive were different sizes. This is simply disgusting. The capital v. lower case 'k' issue pales in comparison (but is part of the same issue, I believe).

It would help in some cases (like this one, maybe) if you added your location to your user account. You don't need to give a street address, but a rough idea would be appreciated.

I realize that you may only read this post, but not respond to it. That's fine. I understand and respect your motivation for doing so. I have felt that you misunderstood me in some aspects, and I will extend to you the same privilege. If I have misunderstood some of your intentions/reasoning then just shake you're head, and expect that the next time we meet up it will be on a different (more civil) topic.


All times are GMT -5. The time now is 07:35 AM.