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 01-07-2012, 09:56 PM   #1
the white rabbit
LQ Newbie
 
Registered: Jan 2012
Posts: 8

Rep: Reputation: Disabled
help with setting up a swap file


Hi all,

I'm trying to set up a swap file but I'm having boot issues. I've set up a dual boot with windows and I've got 3 partitions (1 for windows, 1 for linux, and 1 as a "common area"). I've created a swap file in the common area and I can get it to show up when I use swapon. My issue is that when I restart the system, it tells me that the drive failed to mount ... s to skip mounting or m to manually recovery ... and it is not present until I manually start it again. Could anyone help me with this?

Thanks
 
Old 01-07-2012, 10:10 PM   #2
allez
Member
 
Registered: Jul 2008
Location: Russia/Siberia/Krasnoyarsk
Distribution: SuSE, CentOS, FreeBSD
Posts: 77

Rep: Reputation: 21
First, it's always better to use a swap partition without any strange experiment.
Second, what type of filesystem is used for the "common" partition? Please show here your /etc/fstab file and output of the fdisk -l command.
Third, if the "common" partition has a non-Unix filesystem, it would be a very good idea to create a swap file in the Linux partition or even create a swap partition.
 
Old 01-08-2012, 04:41 PM   #3
the white rabbit
LQ Newbie
 
Registered: Jan 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
Thanks for the reply, allez

here's the fdisk info:

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 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
Disk identifier: 0xad62ba46

Device Boot Start End Blocks Id System
/dev/sda1 2048 3074047 1536000 27 Hidden NTFS WinRE
/dev/sda2 * 3074048 69658623 33292288 7 HPFS/NTFS/exFAT
/dev/sda3 113708070 625137344 255714637+ 7 HPFS/NTFS/exFAT
/dev/sda4 69658624 111673343 21007360 83 Linux

Partition table entries are not in disk order

and here is the 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>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda4 during installation
UUID=198ee638-c3a7-476d-83d4-ea7a4b3f68f3 / ext4 errors=remount-ro 0 1


/media/The\ March\ Hare/4096Mb.swap none swap sw 0 0


I'm trying to use a swap file because I have 4 partitions already set up on this laptop and it wouldn't let me create another. I thought the swap file would be a viable alternative.
 
Old 01-08-2012, 04:50 PM   #4
konsolelover
Member
 
Registered: Jul 2011
Location: 127.0.0.1
Distribution: Arch, Ubuntu 11.04
Posts: 78

Rep: Reputation: 3
You can create logical partition if you need more than 4 partitions.
 
Old 01-08-2012, 05:05 PM   #5
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,053

Rep: Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881
Quote:
Originally Posted by the white rabbit View Post
Code:
UUID=198ee638-c3a7-476d-83d4-ea7a4b3f68f3 / ext4 errors=remount-ro 0  1 /media/The\ March\ Hare/4096Mb.swap    none   swap   sw   0   0
I have to suspect that a different filename would have given you a better chance: spaces in the filename are probably a no-no, and that array of slashes in different directions is probably problematic, too.

That said, separate partitions for swap are far more common (arguably, only for historical reasons...but, in any case, 85%, 95% or more of the installed base is with swap partitions rather than swap files, so you can guess which gets more testing, and if, for example, the mount script 'breaks' with odd characters in the filename, you know where it will be found and cured first).
 
Old 01-08-2012, 05:07 PM   #6
the white rabbit
LQ Newbie
 
Registered: Jan 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
If I set up a logical in the larger partition, would I still run into the mounting issue? Or should I use the linux partition?
 
Old 01-08-2012, 05:22 PM   #7
the white rabbit
LQ Newbie
 
Registered: Jan 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
I went ahead and deleted my swap file and changed the name so that it doesn't include any spaces. However, I'm still getting a "press S to skip mounting" during start up.
 
Old 01-08-2012, 09:12 PM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,840

Rep: Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823
The /media mounts aren't fulfilled prior to fstab. Swap on NTFS would be a very bad idea IMHO.
Put the swap file on your Linux partition.

Linux will happily use logical partitions for everything. But to do that you'd have to delete one of your current primaries (of sufficient size).
 
Old 01-08-2012, 09:59 PM   #9
the white rabbit
LQ Newbie
 
Registered: Jan 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
ok, so I moved my swap file to the linux partition and edited fstab. My common partition mounts automatically and my swap file is auto recognized. Also, getting the spaces out of the name made things a lot easier. Thanks salasi. Thank you all for your help ... much appreciated!
 
  


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
swap file vs. swap partition verndog Ubuntu 16 07-09-2012 09:49 PM
Can swap file or a swap partition be mounted and read? Mr-Bisquit Linux - General 3 06-08-2009 03:16 PM
swap file or swap space? simonb1975uk Linux - General 11 08-15-2008 03:39 PM
swap space (or) swap file yusufs Linux - Newbie 8 07-17-2008 03:02 AM
Need Help Increasing Swap by creating a swap file froggo Red Hat 3 06-13-2006 09:04 AM


All times are GMT -5. The time now is 04:59 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