Ask Your Question

How do I reconfigure SWAP path with out reinstalling entire Fedora21?

asked 2015-05-27 04:31:16 -0500

Orriginal gravatar image

updated 2015-05-27 08:51:02 -0500

mether gravatar image

I have 4gb SCSI disk I have been using as the SWAP disk. A Seperate physical disk from the Sys files. When I started Fedora 21 this morning it got stuck in a loop just near the end of the Plymouth screen and reported a contant flow of CRITICAL _MEDIA_ERROR on DEV SDC (which is the 4gb disk). I booted up through a USB disk into LIVE FEDORA and did a " FSCK /dev/sdc -a " and it reported the Disk as clean but when I tried booting up again (with out the USB) I get the same errors on the same disk ( SDC) and always in the same 3 sectors Any ideas why it reports as clean with FSCK but refuses to boot.? Also, How can I get the HD install of Fedora to look to a new Partition as it sSWAP so I can remove the 4gb disk from the system ? Is there a util that will allow me to create a new partition ?

Thanks for the help in advance

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2015-05-27 06:34:01 -0500

masteroman gravatar image

I mentioned in one post before that IMHO easiest method is to use swap file instad of swap partition:

First step is to create empty file of desired size (I'll create 1GB one). You can do that by issuing one of the following commands:

sudo fallocate -l 1G /swapfile


sudo dd if=/dev/zero of=/swapfile bs=1M count=1024

After that change permissions on that file:

sudo chmod 600 /swapfile

Make swap:

sudo mkswap /swapfile

And after all that activate it:

sudo swapon /swapfile

If you want your system to mount that swap automatically on boot you should add following entry in your /etc/fstab file:

/swapfile swap swap defaults 0 0

If you want to use physical partition instead of swap file for some reason you can prepare that partition and in /etc/fstab specify full path to that disk. Or you can use UUID=uuidnumber to identify disk which should be mounted as swap. To find out UUID of your partition/disk you can issue blkid /dev/sdXX where /dev/sdXX is path to your drive/partition

edit flag offensive delete link more


So basically in first collumn you can specify either disk LABEL (not recommended), disk UUID (best choice), full path to that disk/partition (good enough ;-) ).

masteroman gravatar imagemasteroman ( 2015-05-27 06:36:36 -0500 )edit

Thank y0ou for explaining all that.. Very good of you ;-) THANK YOU

Orriginal gravatar imageOrriginal ( 2015-05-27 07:47:07 -0500 )edit

No problem @Orriginal , glad if it was helpful ;-)

masteroman gravatar imagemasteroman ( 2015-05-27 18:11:33 -0500 )edit

answered 2015-05-27 04:56:07 -0500

pnadk gravatar image

If you edit /etc/fstab you can comment out the line that specifies the swap partition or point it to another one.

edit flag offensive delete link more


I had thought of that but if I do not specify a Path to a SWAP partition, what does Fedora do? Does have a "Defauklt@" it can use or will it auto create another one ?

Orriginal gravatar imageOrriginal ( 2015-05-27 05:13:42 -0500 )edit

If there is no swap specified then Fedora will run without a swap. The Linux kernel has strategies for dealing with low memory situations, but as long as you just boot to edit your /etc/fstab or to mount another drive, you will be fine. Depending on your amount of RAM you might actually never need it.

pnadk gravatar imagepnadk ( 2015-05-27 07:04:30 -0500 )edit

Thanks fo rthe info..;-)

Orriginal gravatar imageOrriginal ( 2015-05-27 07:47:27 -0500 )edit

Question Tools

1 follower


Asked: 2015-05-27 04:31:16 -0500

Seen: 225 times

Last updated: May 27 '15