LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-04-2015, 07:26 PM   #1
ccunlimited
Member
 
Registered: May 2015
Posts: 36

Rep: Reputation: Disabled
I need support to troubleshooting swap partion


swap partion need support

Last edited by ccunlimited; 05-04-2015 at 11:19 PM.
 
Old 05-04-2015, 11:45 PM   #2
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware
Posts: 6,387
Blog Entries: 6

Rep: Reputation: Disabled
Hi & Welcome to Linux Questions.

Were are going to need more information than that in order to help you.

What is the output of fidsk -l?
 
Old 05-05-2015, 12:29 AM   #3
ulto
Member
 
Registered: Apr 2004
Posts: 52

Rep: Reputation: 1
Also df -Th; cat /etc/fstab
 
Old 05-05-2015, 11:19 AM   #4
ccunlimited
Member
 
Registered: May 2015
Posts: 36

Original Poster
Rep: Reputation: Disabled
I create seperate partions / ,/var,/usr,/var/log ,/usr/share,/tmp,/home and swap

I edit the /etc/crypttab and i comment out the line which it contain cryptswap and i replace it by the line which contain my volume group uuid
after chrooted , after doing all steps i rebooted the system i check the swap partion by running
swapon -a (i get this) :
swapon: stat failed /dev/mapper/cryptswap1: No such file or directory

I check using swapon -s (i get this):
Filename Type Size Used Priority
/dev/dm-7 partition 8388604 0 -1

I google much time about this and to sure is the swap is active or not and always the swap usage is 0 when check by # htop #free m #free -k

i Found a guy he post he has the same probleme and he comment out /dev/mapper/cryptswap1 from /etc/fstab and after he running
swapon -a
and the error swapon: stat failed /dev/mapper/cryptswap1: No such file or directory
not appear anymore i make this and the erorr is not appear anymore but i thought this is not a soulation

i want to troubleshooting this and sure if my swap is running or not i post here some of my terminal resualts
#free -m
total used free shared buffers cached
Mem: 8174512 2444828 5729684 39112 59684 1159584
-/+ buffers/cache: 1225560 6948952
Swap: 8388604 0 8388604

# swapon -s
Filename Type Size Used Priority
/dev/dm-7 partition 8388604 0 -1

# dmsetup status
vggnome-gnomehome: 0 374546432 linear
vggnome-gnomeusrshare: 0 62914560 linear
vggnome-gnomeswap: 0 16777216 linear
vggnome-gnomeroot: 0 41943040 linear
vggnome-gnometmp: 0 2097152 linear
vggnome-gnomevarlog: 0 20971520 linear
cryptmv: 0 624111616 crypt
vggnome-gnomeusr: 0 41943040 linear
vggnome-gnomevar: 0 62914560 linear

# sudo dmsetup info /dev/mapper/vggnome-gnomeswap
Name: vggnome-gnomeswap
State: ACTIVE
Read Ahead: 256
Tables present: LIVE
Open count: 2
Event number: 0
Major, minor: 252, 7
Number of targets: 1
UUID: LVM-********************************************* < SECRET LVM

# df -TH
udev devtmpfs 3.9G 0 3.9G 0 /dev
tmpfs tmpfs 799M 9.5M 789M 2 /run
/dev/mapper/vggnome-gnomeroot ext4 20G 867M 18G 5% /
tmpfs tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/mapper/vggnome-gnomeusr ext4 20G 2.4G 17G 13% /usr
none tmpfs 3.9G 0 3.9G 0% /run/shm
/dev/mapper/vggnome-gnometmp ext4 976M 38M 871M 5% /tmp
/dev/mapper/vggnome-gnomevar ext4 30G 1.5G 27G 6% /var
/dev/mapper/vggnome-gnomeusrshare ext4 30G 1.2G 27G 5% /usr/share
/dev/mapper/vggnome-gnomehome ext4 176G 7.3G 160G 5% /home
/dev/mapper/vggnome-gnomevarlog ext4 9.8G 56M 9.2G 1% /var/log
/dev/sda1 ext2 484M 92M 368M 20% /boot
tmpfs tmpfs 799M 36K 799M 1% /run/user/1000

# cat /etc/fstab
/dev/mapper/vggnome-gnomeroot / ext4 errors=remount-ro 0 1
# /boot was on /dev/sda1 during installation
UUID=16ea917a-e9a5-4a22-ab5c-5994175f12c8 /boot ext2 defaults 0 2
/dev/mapper/vggnome-gnomehome /home ext4 defaults,nodev,nosuid,noexec,nouser,errors=remount-ro 0 0
/dev/mapper/vggnome-gnometmp /tmp ext4 defaults,nodev,nosuid,noexec 0 0
/dev/mapper/vggnome-gnomeusr /usr ext4 defaults,nodev 0 0
/dev/mapper/vggnome-gnomeusrshare /usr/share ext4 defaults,nodev,nosuid 0 0
/dev/mapper/vggnome-gnomevar /var ext4 defaults,nodev 0 0
/dev/mapper/vggnome-gnomevarlog /var/log ext4 defaults,nodev,nosuid,noexec 0 0
/dev/mapper/vggnome-gnomeswap none swap sw 0 0
/dev/mapper/cryptswap1 none swap sw 0 0
tmpfs /tmp tmpfs nosuid,nodev 0 0
none /run/shm tmpfs nosuid,nodev,noexec,ro 0 0
tmpfs /dev/shm tmpfs defaults,nodev,nosuid,noexec,ro 0 0
/tmp /var/tmp none rw,noexec,nodev,nosuid,bind 0 0

**SO should i add cryptswap to /etc/crypttab or should i create a new swap and how to do this correctly
P.S My pc running 8G or ram is this cause the swap always usage is 0 because i have enough ram
i wish to find some help here thanks

Last edited by ccunlimited; 05-05-2015 at 08:41 PM.
 
Old 05-05-2015, 05:04 PM   #5
JeremyBoden
Member
 
Registered: Nov 2011
Posts: 939

Rep: Reputation: 174Reputation: 174
Depends what you are doing, but an 8GB PC would struggle to use any swap, ever.

Don't forget that you can create swap files which do the same job as swap partitions/volumes, but slightly less efficiently.

Last edited by JeremyBoden; 05-05-2015 at 05:10 PM.
 
1 members found this post helpful.
Old 05-05-2015, 05:38 PM   #6
ccunlimited
Member
 
Registered: May 2015
Posts: 36

Original Poster
Rep: Reputation: Disabled
Thanks for your replay,So do you think im ok with this configuration

Last edited by ccunlimited; 05-05-2015 at 05:57 PM.
 
Old 05-05-2015, 07:18 PM   #7
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware
Posts: 6,387
Blog Entries: 6

Rep: Reputation: Disabled
Looking at the output you have 6 EXT 4 journaling fs partitions but you don't have a swap partition.
Post the output of fisk -l (that's the small letter L and run it as root)

Depending on the size of your HDD you could easily create a 1 GB linux-swap partition.
Swap holds temporary memory packages so you could create a swap file if you don't want to create a swap partition.
This link will show you how to make a swap file.
http://www.cyberciti.biz/faq/linux-a...ap-file-howto/

What distribution are you running?
 
Old 05-05-2015, 07:36 PM   #8
ccunlimited
Member
 
Registered: May 2015
Posts: 36

Original Poster
Rep: Reputation: Disabled
Im running ubuntu-gnome 15.04 but look at the output of fdisk -l you will see swap /dev/mapper
and look at the output i post there is swap partion is active but always its usage 0
if i havent correct swap partion created on the system is there a security risk should i attention about? and if the output say the swap is configured correct is the ram 8G is the reason that is the swap usage always 0?

Disk /dev/ram0: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram1: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram2: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram3: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram4: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram5: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram6: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram7: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram8: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram9: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram10: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram11: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram12: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram13: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram14: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram15: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/sda: 298.1 GiB, 320072933376 bytes, 625142448 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x7c554342

Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 1025485 1023438 499.7M 83 Linux
/dev/sda2 1026048 625141759 624115712 297.6G 83 Linux

Disk /dev/mapper/cryptmv: 297.6 GiB, 319545147392 bytes, 624111616 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/vggnome-gnomeroot: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/vggnome-gnomeusr: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/vggnome-gnomevar: 30 GiB, 32212254720 bytes, 62914560 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/vggnome-gnomeusrshare: 30 GiB, 32212254720 bytes, 62914560 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/vggnome-gnomevarlog: 10 GiB, 10737418240 bytes, 20971520 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/vggnome-gnometmp: 1 GiB, 1073741824 bytes, 2097152 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/vggnome-gnomeswap: 8 GiB, 8589934592 bytes, 16777216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/vggnome-gnomehome: 178.6 GiB, 191767773184 bytes, 374546432 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Last edited by ccunlimited; 05-05-2015 at 08:42 PM.
 
Old 05-05-2015, 08:33 PM   #9
JeremyBoden
Member
 
Registered: Nov 2011
Posts: 939

Rep: Reputation: 174Reputation: 174
How critical is your encryption requirement?
It's not easy for someone to read the bytes from your swap area and learn anything useful.

One (easy) way to encrypt your swap is to create a swap file in /home (which is encrypted).
The swap file probably won't get used anyway.
 
1 members found this post helpful.
Old 05-05-2015, 08:37 PM   #10
ccunlimited
Member
 
Registered: May 2015
Posts: 36

Original Poster
Rep: Reputation: Disabled
Tell me what output exacttly you need it and i will post is for you excuse me in the lines is too small but this is my secound day here )
Do you think JeremyBoden if i continue the system like this without creating swap is there a security risk on my os ?
P.S i edited the font of my previuos output

Last edited by ccunlimited; 05-05-2015 at 08:43 PM.
 
Old 05-05-2015, 08:48 PM   #11
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware
Posts: 6,387
Blog Entries: 6

Rep: Reputation: Disabled
These are the only 2 partitions that I see on your machine.
Code:
/dev/sda1 * 2048 1025485 1023438 499.7M 83 Linux
/dev/sda2 1026048 625141759 624115712 297.6G 83 Linux
The output isn't in code tags and it's hard to read.
I didn't see a swap partition in the output.

When you look at your partitions in G-parted does a /dev/mapper/swap appear?

Quote:
if i havent correct swap partion created on the system is there a security risk should i attention about?
There are always security risk's so it's best to keep your distribution updated. If you are on a server you should look into Machine Harding.
http://thesimplecomputer.info/full-d...on-with-ubuntu

I'm not sure what the RAM usage for a swap is. Maybe ulto or JeremyBoden will have knowledge and advice for that.

If this were my Ubuntu box I would keep it simple with a 297 GB HDD.
-Create a partition for your journaling fs EXT 3 or EXT4 and make it 295 GB.
-Than create a 1 to 2 GB linux-swap partition.

You can perform a fresh installation or download g-parted live and repartition what you have.
 
Old 05-05-2015, 08:51 PM   #12
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware
Posts: 6,387
Blog Entries: 6

Rep: Reputation: Disabled
Quote:
Originally Posted by JeremyBoden View Post
How critical is your encryption requirement?
It's not easy for someone to read the bytes from your swap area and learn anything useful.

One (easy) way to encrypt your swap is to create a swap file in /home (which is encrypted).
The swap file probably won't get used anyway.
-::-Exactly; as I suggested making a swap in post #7.-::-
 
Old 05-05-2015, 09:02 PM   #13
ccunlimited
Member
 
Registered: May 2015
Posts: 36

Original Poster
Rep: Reputation: Disabled
[SIZE="3"]Yes i have gparted and i configured sda1 for boot sda2 unformatted then i create /dev/mappers inside /dev/sda2
can you help me about a guide i can delete the old swap and create encrypted one
p.s thanks for the guide which it explain the encryption but i tryed this methode before and it maked me should the password 3 times to dycrypt the partions and start the system but i edit my output fonts can any one see my output well there is /dev/mapper/vggnome-gnomeswap
look to free m command output
#free m
total used free shared buffers cached
Mem: 8174512 2100588 6073924 23344 132272 826176
-/+ buffers/cache: 1142140 7032372
Swap: 8388604 0 8388604

its display swap spcace but its use always 0

#swapon -s
Filename Type Size Used Priority
/dev/dm-7 partition 8388604 0 -1

its display /dev/dm-7

this is refere there is swap is enable right or im fault

# cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
/dev/mapper/vggnome-gnomeroot / ext4 errors=remount-ro 0 1
# /boot was on /dev/sda1 during installation
UUID=16ea917a-e9a5-4a22-ab5c-5994175f12c8 /boot ext2 defaults 0 2
/dev/mapper/vggnome-gnomehome /home ext4 defaults,nodev,nosuid,noexec,nouser,errors=remount-ro 0 0
/dev/mapper/vggnome-gnometmp /tmp ext4 defaults,nodev,nosuid,noexec 0 0
/dev/mapper/vggnome-gnomeusr /usr ext4 defaults,nodev 0 0
/dev/mapper/vggnome-gnomeusrshare /usr/share ext4 defaults,nodev,nosuid 0 0
/dev/mapper/vggnome-gnomevar /var ext4 defaults,nodev 0 0
/dev/mapper/vggnome-gnomevarlog /var/log ext4 defaults,nodev,nosuid,noexec 0 0
/dev/mapper/vggnome-gnomeswap none swap sw 0 0
/dev/mapper/cryptswap1 none swap sw 0 0
tmpfs /tmp tmpfs nosuid,nodev 0 0
none /run/shm tmpfs nosuid,nodev,noexec,ro 0 0
tmpfs /dev/shm tmpfs defaults,nodev,nosuid,noexec,ro 0 0
/tmp /var/tmp none rw,noexec,nodev,nosuid,bind 0 0

Last edited by ccunlimited; 05-05-2015 at 09:05 PM.
 
Old 05-05-2015, 09:19 PM   #14
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware
Posts: 6,387
Blog Entries: 6

Rep: Reputation: Disabled
Thanks for making the font bigger ccunlimited-

I found it:
Code:
Disk /dev/mapper/vggnome-gnomeswap: 8 GiB, 8589934592 bytes, 16777216 sectors
Your welcome for the guide:-

Encryption can be tricky It took me a few times reading the instructions to get it done correctly.

Quote:
can you help me about a guide i can delete the old swap and create encrypted one
If I'm not mistaken you should be able to use g-parted Live to delete the vggnome-gnomeswap that you have already made.
Use the free space that is left over to create the new swap file.

Last edited by Ztcoracat; 05-05-2015 at 09:23 PM.
 
Old 05-05-2015, 09:22 PM   #15
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware
Posts: 6,387
Blog Entries: 6

Rep: Reputation: Disabled
@JeremyBoden:

Is there a easier way to create a swap file besides those instructions in the link I posted?

I've never tried it, that why I'm seeing if you know?

Last edited by Ztcoracat; 05-05-2015 at 09:23 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
how to format swap partion rajesh_alpha Linux - Kernel 4 03-09-2010 10:58 AM
Urgent help regarding SWAP partion during UBUNTU installation. surtry Linux - Newbie 4 07-01-2009 12:22 AM
How much space can a swap partion get? hondo Linux - General 5 05-18-2007 03:18 PM
SWAP partion not being mounted Boffy Linux - General 6 02-14-2005 04:37 PM
Partions - Swap Partion SBFree Linux - Newbie 8 11-23-2004 06:47 AM


All times are GMT -5. The time now is 12:50 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration