Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 10-25-2005, 08:16 AM   #1
Registered: Oct 2005
Location: France
Distribution: Mandriva 2008.0
Posts: 35

Rep: Reputation: 15
Question swapon on ntfs

Hi everyone,

I searched through this forum, but wasn't able to find a solution, I hope someone can give me some answers. Here it is :

I am using a linux live CD, slax (damn, I can't put the URL for the moment... google it !) , which is really great, and I would like to use some swap with it. Problem is the only hard drive I have is NTFS, since I'm using it on my professional laptop. I thought I could do it with kernel 2.6.12 since it is capable of writing inside existing NTFS files if it doesn't change their size, but I can't get it working. What I did was :

under linux, create a 1.0gb file on a usb drive :
dd if=/dev/zero of=/mnt/sda1_removable/swapfile.swp count=2000000
under Window$ 2000, copy it on c:/

reboot linux, make it a swapfile :
mkswap -c /mnt/hda1/swapfile.swp
swapon it :
swapon /mnt/hda1/swapfile.swp
This is where I get every time :
Invalid Argument : /mnt/hda1/swapfile.swp
What did I do wrong ? Or can't I swap on NTFS ?

Thanks in Advance !!!
Old 10-25-2005, 08:38 AM   #2
Stéphane Ascoët
Registered: Feb 2004
Location: Orleans, 120 km south of Paris
Distribution: Mandrake, Freeduc (the one I'm making), Slackware, MacOS X
Posts: 214

Rep: Reputation: 45

Hello, an advice you should follow:forget this idea. Unless you want to lose your professionnal datas on HDD.

Buy an external storage system.
Old 10-25-2005, 08:46 AM   #3
Registered: Dec 2004
Location: Vietnam (Việt Nam)
Distribution: Gentoo (desktop), Arch linux (laptop)
Posts: 728

Rep: Reputation: 33
Yes, I agree Stéphane Ascoët.
Although linux kernel 2.6.10+ can write on ntfs but it was extremely dangerous.
Most of distro disable this features.
But some Live CD enable its to statisfied windows user.
I think there must be some solution somewhere on the internet but you should give up this idea.
Do so can throw away your data once day
Old 10-25-2005, 08:49 AM   #4
Senior Member
Registered: Dec 2004
Location: Lee, NH
Distribution: OpenSUSE, CentOS, RHEL
Posts: 1,794

Rep: Reputation: 46
Originally posted by TruongAn
[B]Although linux kernel 2.6.10+ can write on ntfs but it was extremely dangerous.
Most of distro disable this features.
Not really. NTFS write in 2.6.10+ is actually very safe but you cannot change the size of a file. If you enable the new NTFS write in the kernel and use the swap file on the NTFS partition as Linux swap you should have no problems since the file size never changes, so the MFT never needs to be touched.

It is kernels prior to 2.6.10 where NTFS writes are dangerous.
Old 10-25-2005, 09:37 AM   #5
Registered: Oct 2005
Location: France
Distribution: Mandriva 2008.0
Posts: 35

Original Poster
Rep: Reputation: 15
Thanks for your help, guys...

Yes, I was quite confident in the kernel 2.6.12 to be safe enough to write within existing ntfs files. It's just that it seems that the swapon command refuses to work on an ntfs partition, or I misunderstood the problem... I wonder if anyone ever tried to do it. I agree it is a strange way to use linux, but that would really help me.


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
weird 'swapon -a' error elluva Slackware 3 08-18-2004 02:39 AM
swapon command Krenn Slackware 3 08-13-2004 08:53 AM
swapon hda6 - invalid argument ??? thepasty Mandriva 1 07-09-2004 09:37 AM
2.6.3 swapon - function not implemented Sammy2ooo Linux - General 3 03-10-2004 07:08 AM
mount a partition and swapon on boot(fstab??) edman007 Linux - Newbie 4 10-01-2003 05:53 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:08 PM.

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