Home
Man
Search
Today's Posts
Register

This forum is closed for new posts. Please post beginner questions to learn unix and learn linux in the UNIX for Beginners Questions & Answers forum.

Help Understanding Output and question about /dev/

Tags
beginners

 

 
Thread Tools Search this Thread
# 1  
Old 07-09-2009
Help Understanding Output and question about /dev/

Hi,

I am having some problems understanding the info from the following output:

Disk /dev/sda: 17849 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

Device Boot Start End #cyls #blocks Id System
/dev/sda1 * 0+ 499 500- 4016218+ 83 Linux
/dev/sda2 500 999 500 4016250 82 Linux swap / Solaris
/dev/sda3 1000 17848 16849 135339592+ 83 Linux
/dev/sda4 0 - 0 0 0 Empty


I wan to know how large each partition is. I selected the size for /dev/sda2 in fdisk to be 1000M but if I am understanding the info correctly I only have 0.5megs for /dev/sda2. Can someone tell me how to effectively create partition sizes in fdisk? it seems when I try and specify the size using the actual size it does not work well.

One other question:
/dev/shm 517172 0 517172 0% /dev/shm

Is /dev/shm the swap partition /dev/sda2?

Thanks!
# 2  
Old 07-09-2009
I make /dev/sda2 to be 3.8 Gb.

i.e. 4016250 blocks of 1024 bytes per block.

(4016250 * 1024) / 1024 / 1024 /1024 Gigabytes
# 3  
Old 07-09-2009
Quote:
Originally Posted by methyl
I make /dev/sda2 to be 3.8 Gb.

i.e. 4016250 blocks of 1024 bytes per block.

(4016250 * 1024) / 1024 / 1024 /1024 Gigabytes
I guess fdisk does not seem to handle creating partition sizes if you try and give it the exact size instead of blocks. Does anyone else have this problem?
# 4  
Old 07-09-2009
For future reference, please use [code][/code] tags for listings, source code, ...

Quote:
Originally Posted by mojoman
Code:
Disk /dev/sda: 17849 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start     End   #cyls    #blocks   Id  System
/dev/sda1   *      0+    499     500-   4016218+  83  Linux
/dev/sda2        500     999     500    4016250   82  Linux swap / Solaris
/dev/sda3       1000   17848   16849  135339592+  83  Linux
/dev/sda4          0       -       0          0    0  Empty

This means that each of the 500 cylinders allocated for /dev/sda2 is 8225280 bytes (or about 8MB) large, which is about 4GB in total. Or, from the next column, it consists of 4016250 blocks 1024 bytes = ~4GB.

You can specify the intended size by using '+1024M' (=1GB) when fdisk asks for the ending block number.

Quote:
Originally Posted by mojoman
One other question:
/dev/shm 517172 0 517172 0% /dev/shm

Is /dev/shm the swap partition /dev/sda2?
No, it's a pseudo filesystem (much like /dev, /proc, /sys) used for shared memory usage (IPC/Message passing). Swap partitions don't show up in the output of mount/df. Use swapon -s for that.
# 5  
Old 07-09-2009
I have tried swapon -s as you suggested and I see nothing which is strange since CENTOS at boot reports that it mounts the SWAP partition. My fstab is:

# This file is edited by fstab-sync - see 'man fstab-sync' for details
/dev/sda3 / ext3 defaults 1 1
/dev/sda1 /boot ext3 defaults 1 2
/dev/sdb1 /home8 ext3 defaults 1 2
/dev/devpts /dev/pts devpts gid=5,mode=620 0 0
/dev/shm /dev/shm tmpfs defaults 0 0
/dev/proc /proc proc defaults 0 0
/dev/sys /sys sysfs defaults 0 0
LABEL=SWAP-sda2 swap swap defaults 0 0
/dev/fd0 /media/floppy auto pamconsole,exec,noauto,managed 0 0
/dev/hda /media/cdrom auto pamconsole,exec,noauto,managed 0 0
~

WHen I try executing swapon -L SWAP-sda2 I get:
swapon: cannot find the device for SWAP-sda2

What should I do?
# 6  
Old 07-09-2009
It sounds like the label wasn't put into the swap partition when it was formatted, hence centos can't find it on boot. That it says its mounting swap may only mean its at the point where it would, not that it's actually found it. You can reformat the swap partion with mkswap -L label /path/to/device
 

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Understanding output of "last" command kitykitykity UNIX for Advanced & Expert Users 2 02-24-2015 02:02 PM
Question /help understanding vi logs ? rveri Shell Programming and Scripting 7 04-11-2013 07:01 PM
Command understanding the output file destination in case of standard output!!!!! ravisingh Red Hat 3 02-22-2013 05:41 PM
Understanding the output of fwtmp confusedAdmin Shell Programming and Scripting 6 03-02-2012 11:30 AM
Understanding nm command output yatrik007 UNIX for Dummies Questions & Answers 2 02-07-2011 09:42 PM
Understanding the output of TOP SkySmart Shell Programming and Scripting 0 07-09-2010 09:17 PM
problem in understanding the output of errpt -d H -T PERM -s `date +"%m%d%H00%y"` Sounddappan Shell Programming and Scripting 1 07-09-2010 12:57 PM
Problem in understanding the output of errpt -d H -T PERM -s `date +"%m%d%H00%y"` Sounddappan AIX 0 07-09-2010 11:32 AM
Understanding the output command Ariean UNIX for Dummies Questions & Answers 5 01-13-2010 05:54 PM
Ifconfig output - help understanding flags 'Smart, Simplex', etc littlefrog OS X (Apple) 1 01-14-2009 02:33 PM


All times are GMT -4. The time now is 02:54 AM.

Unix & Linux Forums Content Copyright 1993-2018. All Rights Reserved.
UNIX.COM Login
Username:
Password:  
Show Password