FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 11-05-2008, 03:41 AM
"Indunil Jayasooriya"
 
Default Adding another swap

Hi ALL,

I have a harddisk with 3 primary partitions and one extended
partitions. Under extented partions , there are 15 partions.

Whole hard disk has been partitioned in a standard way, (i.e NOT LVM)

It has 2GB ram. swap is also 2GB.

Now I want to extend this swap to 4 GB.

If I use dd coomand and create a file with 2GB, Will I be able to
extend the swap witn swapon commnad?

How can I achive this?

Hope to hear form you,




--
Thank you
Indunil Jayasooriya
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 11-05-2008, 04:32 AM
Robert
 
Default Adding another swap

Indunil Jayasooriya wrote:

Hi ALL,

I have a harddisk with 3 primary partitions and one extended
partitions. Under extented partions , there are 15 partions.

Whole hard disk has been partitioned in a standard way, (i.e NOT LVM)

It has 2GB ram. swap is also 2GB.

Now I want to extend this swap to 4 GB.

If I use dd coomand and create a file with 2GB, Will I be able to
extend the swap witn swapon commnad?

How can I achive this?

Hope to hear form you,

I just now shelled into a newly-loaded FC8 box and expanded the swap
with a swap file:



[rj@mavis ~]$ ssh beau
rj@beau's password:
Last login: Tue Nov 4 11:31:13 2008
[rj@beauregard ~]$ su -
Password:
# Create the file:
[root@beauregard ~]# dd if=/dev/zero of=/root/swapfile bs=1G count=1
1+0 records in
1+0 records out
1073741824 bytes (1.1 GB) copied, 119.248 s, 9.0 MB/s
#Make the swap fs on the file:
[root@beauregard ~]# mkswap -c /root/swapfile
Setting up swapspace version 1, size = 1073737 kB
no label, UUID=c75b5eaa-b483-44c8-9e4c-c895b16b045c
# Create an entry in fstab:
[root@beauregard ~]# echo "/root/swapfile
swap swap defaults 0 0" >> /etc/fstab

# Activate the new swap area:
[root@beauregard ~]# swapon -a
# Sure enough, it is in use:
[root@beauregard ~]# cat /proc/swaps
Filename Type Size Used
Priority

/dev/sda5 partition 1534168 75304 -1
/root/swapfile file 1048568 0 -2
[root@beauregard ~]#




_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 11-05-2008, 06:16 AM
"Indunil Jayasooriya"
 
Default Adding another swap

Hi Robert ,

First off all , thank you very much for your step by steb info.
The below command creates a 1 GB file. there you have mentioned bs=1G count=1.
What is count 1 there?

> # Create the file:
> [root@beauregard ~]# dd if=/dev/zero of=/root/swapfile bs=1G count=1
> 1+0 records in
> 1+0 records out
> 1073741824 bytes (1.1 GB) copied, 119.248 s, 9.0 MB/s
> #Make the swap fs on the file:

If I want to create a file with 2 GB , then , What should I mention?
count 2 or 1?

What is the correct one out of below 2 commands

dd if=/dev/zero of=/root/swapfile bs=2G count=2

or

dd if=/dev/zero of=/root/swapfile bs=2G count=1


Hope to hear form you.

>
> _______________________________________________
> CentOS mailing list
> CentOS@centos.org
> http://lists.centos.org/mailman/listinfo/centos
>



--
Thank you
Indunil Jayasooriya
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 11-05-2008, 06:21 AM
Christopher Chan
 
Default Adding another swap

Indunil Jayasooriya wrote:

Hi Robert ,

First off all , thank you very much for your step by steb info.
The below command creates a 1 GB file. there you have mentioned bs=1G count=1.
What is count 1 there?


man dd?

You can find out for yourself you know.
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 11-05-2008, 09:49 AM
Anne Wilson
 
Default Adding another swap

On Wednesday 05 November 2008 04:41:31 Indunil Jayasooriya wrote:

> Hi ALL,

>

> I have a harddisk with 3 primary partitions and one extended

> partitions. Under extented partions , there are 15 partions.

>

> Whole hard disk has been partitioned in a standard way, (i.e NOT LVM)

>

> It has 2GB ram. swap is also 2GB.

>

> Now I want to extend this swap to 4 GB.

>

> If I use dd coomand and create a file with 2GB, Will I be able to

> extend the swap witn swapon commnad?

>

> How can I achive this?

>

> Hope to hear form you,



Are you sure you are actually using the current swap? If you are not short of RAM you probably aren't. See what top says about my laptop:



538136k total, 0k used,



Anne
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 11-05-2008, 04:13 PM
Scott Silva
 
Default Adding another swap

on 11-4-2008 11:16 PM Indunil Jayasooriya spake the following:
> Hi Robert ,
>
> First off all , thank you very much for your step by steb info.
> The below command creates a 1 GB file. there you have mentioned bs=1G count=1.
> What is count 1 there?
`bs=BYTES'
Both read and write BYTES bytes at a time. This overrides `ibs'
and `obs'.
so write with 1GB blocks and write only 1. For 2 GB you could have count=2

>
>> # Create the file:
>> [root@beauregard ~]# dd if=/dev/zero of=/root/swapfile bs=1G count=1
>> 1+0 records in
>> 1+0 records out
>> 1073741824 bytes (1.1 GB) copied, 119.248 s, 9.0 MB/s
>> #Make the swap fs on the file:
>
> If I want to create a file with 2 GB , then , What should I mention?
> count 2 or 1?
>
> What is the correct one out of below 2 commands
>
> dd if=/dev/zero of=/root/swapfile bs=2G count=2
2G x 2 = 4GB
>
> or
>
> dd if=/dev/zero of=/root/swapfile bs=2G count=1

That would give you 2 GB but so would bs=1G count=2
>
>
> Hope to hear form you.
>
>> _______________________________________________
>> CentOS mailing list
>> CentOS@centos.org
>> http://lists.centos.org/mailman/listinfo/centos
>>
>
>
>


--
MailScanner is like deodorant...
You hope everybody uses it, and
you notice quickly if they don't!!!!

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 03:21 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org