Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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...
Distribution: Red Hat, Slackware, Smoothwall, Fedora, Mandrake, *BSD
Posts: 20
Rep:
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.
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.
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.
(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?
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.
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.
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.
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.
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.
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!
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.