LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-18-2013, 02:47 AM   #1
rajini23
Member
 
Registered: Sep 2011
Posts: 162

Rep: Reputation: Disabled
Unhappy wants to remove swap partition


Hi,

In one of the linux server swap is in secondary partition /dev/sdb2

in secondary hard disk i got more 32GB free space so i though to create a new partition, but unknowingly i have selected 2 partition number in fdisk which swap is alread accupied, now i wants to 32gb space to be removed from swap partition /dev/sdb2 and create the new partition, please help me on this....

note: but after created the partition in swap it was showing only 15GB not the enrite harddisk space...
 
Old 01-18-2013, 03:27 AM   #2
ukiuki
Senior Member
 
Registered: May 2010
Location: Planet Earth
Distribution: Debian
Posts: 1,030

Rep: Reputation: 385Reputation: 385Reputation: 385Reputation: 385
Use gparted to manage you partitions it is going to be a lot easier.

Regards
 
Old 01-18-2013, 03:49 AM   #3
rajini23
Member
 
Registered: Sep 2011
Posts: 162

Original Poster
Rep: Reputation: Disabled
Thanks, for the update ,but it is not showing now it added into the swap partition i am not able to make the filesystem.

getting an error that partition is already mount not able to make filesystem...

how to split that 32gb from that hardisk
 
Old 01-18-2013, 04:47 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Partitioning is not possible on mounted partitions.

"Use gparted" will usually mean : Using a 'Gparted live cd'.
 
Old 01-18-2013, 05:10 AM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
It is not clear from the original question what you have done. Maybe you modified the existing swap partition -- for example deleted the old one and created a new one, maybe with a different size. Maybe you formatted it.

Easiest solution (assuming you can reboot) would be to comment out the swap line from /etc/fstab and reboot. If you can't reboot use the swapoff command.

You can then remove the problem partition(s) and start over. Use the mkswap command to format the swap partition. [EDIT: use the mkfs command to format the file system partition]. Adjust /etc/fstab as required.

Then either reboot or use the swapon command to enable the new swap partition.

Last edited by catkin; 01-18-2013 at 05:13 AM.
 
Old 01-18-2013, 05:22 AM   #6
ukiuki
Senior Member
 
Registered: May 2010
Location: Planet Earth
Distribution: Debian
Posts: 1,030

Rep: Reputation: 385Reputation: 385Reputation: 385Reputation: 385
Quote:
Originally Posted by rajini23 View Post
...getting an error that partition is already mount not able to make filesystem...
You cant manage the swap partition while it is mounted/on ,first step is: turn swap off then unmount the partition.

Regards
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
swap file vs. swap partition verndog Ubuntu 16 07-09-2012 08:49 PM
swap file or swap partition? What is better? zemir Linux - Newbie 28 08-19-2011 09:15 PM
Which software can remove bad blocks from the swap partition? frenchn00b Linux - Software 3 09-09-2009 11:20 AM
Can swap file or a swap partition be mounted and read? Mr-Bisquit Linux - General 3 06-08-2009 02:16 PM
Hard Drive Partition Management - Mandriva Double Partition with Swap File partition moshebagelfresser Linux - Hardware 2 05-23-2008 10:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration