LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 07-09-2009, 06:09 PM   #1
Kap1234
LQ Newbie
 
Registered: Jul 2009
Posts: 10

Rep: Reputation: 0
Hiding ntfs partition in linux


I need to hide a ntfs partition in linux (from boot dvd opensuse if it matters). Is it possible?
And another question: when i used fdisk from linux boot dvd, and divided my hdd space into partitions, counting the exact space each partition will have, i allocated 10GB to one of them. But when i booted from windows boot cd it show 9.3, why is that?? Have i done something wrong allocating using fdisk?
 
Old 07-09-2009, 06:38 PM   #2
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,074

Rep: Reputation: 386Reputation: 386Reputation: 386Reputation: 386
Quote:
Originally Posted by Kap1234 View Post
I need to hide a ntfs partition in linux (from boot dvd opensuse if it matters). Is it possible?
It depends on what do you mean. If you mean being unable to see the ntfs partition from *any* arbitrary livecd you want to use, that's impossible. The hardware is there, the OS just needs to find a suitable device driver for it and as long as there's a driver the fs can be seen.

If you mean to disable it for a given installation you just need to make sure that the ntfs driver is not loaded in your concrete linux distribution.

Note that even without a driver, the partition and the device node will be accessible by tools like fdisk, and the device node will be present in /dev/, you just won't be able to mount the volume and access its contents with normal methods.

What you ask for would required some kind of unification between the firmware of your hardware and the multiple OSes you use. There's currently no way that your hardware will present a certain info to a given OS and a completely different info to another given OS... To start with, your hardware doesn't even know what an OS is.

Quote:
And another question: when i used fdisk from linux boot dvd, and divided my hdd space into partitions, counting the exact space each partition will have, i allocated 10GB to one of them. But when i booted from windows boot cd it show 9.3, why is that?? Have i done something wrong allocating using fdisk?
In the international magnitude system, a Giga is 1000 Mega, and a Mega 1000 Kilo, and a Kilo, 1000 units.

Someone thought one day that just because it's convenient for computers, a Giga for us would better be 1024, and so on.

So your disk is perfectly fine, it just depends on how you count the bytes. To avoid confusion people seem to use "GB", "MB" and so on for 1024 multiples, and "GiB", "MiB" for international system units, multiples of 1000.
 
Old 07-09-2009, 08:43 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,406

Rep: Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396
Re MB vs MiB etc; actually, its the other way around: http://en.wikipedia.org/wiki/Gibibyte
 
Old 07-09-2009, 08:51 PM   #4
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,074

Rep: Reputation: 386Reputation: 386Reputation: 386Reputation: 386
Thanks for the correction
 
Old 07-09-2009, 09:21 PM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Quote:
Originally Posted by i92guboj View Post
It depends on what do you mean. If you mean being unable to see the ntfs partition from *any* arbitrary livecd you want to use, that's impossible. The hardware is there, the OS just needs to find a suitable device driver for it and as long as there's a driver the fs can be seen.
Well ... there *is* a way.

You just need to delete the partition (make sure you backup
the original record). It can be re-created with the same
boundaries and just spring back to life.

That said: this only hides it from the higher level tools,
with dd or other low-level tools (or a utility that restores
partition tables) anyone can still get to it.

And the risk of course is that one accidentally *reclaims* the
free space with a new partition and/or file-system. ;}




Cheers,
Tink
 
Old 07-09-2009, 09:32 PM   #6
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,074

Rep: Reputation: 386Reputation: 386Reputation: 386Reputation: 386
Well, that's certainly possible.

However, it would help to know what exactly the purpose of this is. If what he wants is to hide the ntfs so it's not harmed accidentally while installing or testing linux distros, then this will definitely not help (in fact, it can only be worse unless you know exactly what portion of the unallocated space can or can't be used.

If what he wants is to avoid the windows partition being automounted, then either fstab or udev are the places to look into, that, or disable ntfs completely at kernel level as I said.
 
Old 07-09-2009, 10:09 PM   #7
jefro
Moderator
 
Registered: Mar 2008
Posts: 17,000

Rep: Reputation: 2513Reputation: 2513Reputation: 2513Reputation: 2513Reputation: 2513Reputation: 2513Reputation: 2513Reputation: 2513Reputation: 2513Reputation: 2513Reputation: 2513
Wonder if gdisk would suit your requirement. As above anyone with access and or admin can un-hide.
 
Old 07-09-2009, 10:28 PM   #8
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,074

Rep: Reputation: 386Reputation: 386Reputation: 386Reputation: 386
Quote:
Originally Posted by jefro View Post
Wonder if gdisk would suit your requirement. As above anyone with access and or admin can un-hide.
If you are speaking about the partition type byte, that's broadly irrelevant. Linux doesn't care about it, and it's just a byte, nothing else. Linux will mount the partitions based on the fs that there's inside, just change the partition types in fdisk for all your partitions and see how they are ignored by linux.

Cloaking a partition, physically, is just impossible. The hardware doesn't understand about partitions at all in first place. It's just some arbitrary layout that has been established by convention and most OSes agree with, but not necessarily (linux can work on an unpartitioned disk, and bsd's and other unixes use different schemes with slices and whatever else).

You can change, that silly byte, you can erase it, you can be creative and use all kind of tricks, but you can't say your hardware not to show a given partition because the hardware doesn't even know what a partition is, and since the hardware shows it, your OS sees it, there's no way around that, that is, unless your OS chooses to ignore partitions of a given type.

Even in windows, any partitioning tool will show you all what there's to see, even the so-called hidden partitions. In linux, you will see the device nodes under /dev/ regardless of how your partition is marked.
 
Old 07-10-2009, 12:56 AM   #9
Kap1234
LQ Newbie
 
Registered: Jul 2009
Posts: 10

Original Poster
Rep: Reputation: 0
No, sorry all for misunderstanding, i meant booting from opensuse dvd, using the rescue system option(i just thought some options may not work from there), i need to create a ntfs partition as sda1, hide it before installing windows, then install windows on sda2. I have formatted my hdd, and destroyed the recovery partition used by samsung recovery solution, so I want to somehow recreate it, though I've read its not possible this way, but i want to try. Also, about the capacity question, i have formatted the partition in linux using fdisk, selecting exactly +10Gb(not G which means gigibyte) so why would windows show 9.3Gb or it showa it in Gib??
 
Old 07-10-2009, 01:10 AM   #10
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,074

Rep: Reputation: 386Reputation: 386Reputation: 386Reputation: 386
Quote:
Originally Posted by Kap1234 View Post
No, sorry all for misunderstanding, i meant booting from opensuse dvd, using the rescue system option(i just thought some options may not work from there), i need to create a ntfs partition as sda1, hide it before installing windows, then install windows on sda2. I have formatted my hdd, and destroyed the recovery partition used by samsung recovery solution, so I want to somehow recreate it, though I've read its not possible this way, but i want to try.
It still escapes me the purpose of this all. When installing windows you can choose which partition to use to install it. What's the purpose behind "hiding" it?

I know for sure that windows *will* break if the ordering of the partitions change (i.e. you install it in sda1 but then sda1 becomes sda2 for some obscure game you played with partitions). So beware of that.

Quote:
Also, about the capacity question, i have formatted the partition in linux using fdisk, selecting exactly +10Gb(not G which means gigibyte) so why would windows show 9.3Gb or it showa it in Gib??
That you used a given unit to create the drive doesn't mean that all the programs you are using to get its capacity are going to use that same unit. The total amount of bytes should always be the same though.

Also, strictly speaking, you "created" it with fdisk, you "formatted" it with anything else (the windows installer, mkfs or whatever).

Last edited by i92guboj; 07-10-2009 at 01:12 AM.
 
Old 07-10-2009, 03:24 AM   #11
Kap1234
LQ Newbie
 
Registered: Jul 2009
Posts: 10

Original Poster
Rep: Reputation: 0
1)Alright, if you want to understand the purpose, I'll start over. I have samsung notebook q310 that has program called samsung recovery solution 3. It uses a special hidden ntfs partition to store backup image that later can be used to fully recover drive C: with all programs and windows vista itself, that was /dev/sda1 before i zeroed my hdd. Now i want to recreate it on my blank hdd and hide it before installing windows on sda2. Will this gdisk help me? Or is it sufficient enough to just enter fdisk in linux, and change sda1 id to hidden ntfs/hpfs??
2) Quote: "That you used a given unit to create the drive doesn't mean that all the programs you are using to get its capacity are going to use that same unit. The total amount of bytes should always be the same though." Alright I found out that windows really shows capacity in GiB, but i still don't understand something, if I have 250GB=250000mb, even if it's ~250GB, and i divide it by 1024, it will be ~244, and windows shows 232.9, Can someone explain my this trivial .
 
Old 07-10-2009, 03:38 AM   #12
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,074

Rep: Reputation: 386Reputation: 386Reputation: 386Reputation: 386
Quote:
Originally Posted by Kap1234 View Post
1)Alright, if you want to understand the purpose, I'll start over. I have samsung notebook q310 that has program called samsung recovery solution 3. It uses a special hidden ntfs partition to store backup image that later can be used to fully recover drive C: with all programs and windows vista itself, that was /dev/sda1 before i zeroed my hdd. Now i want to recreate it on my blank hdd and hide it before installing windows on sda2. Will this gdisk help me? Or is it sufficient enough to just enter fdisk in linux, and change sda1 id to hidden ntfs/hpfs??
You can change it to hidden of whatever you want. The main point here is that you need to install your OS to sda2. Both the linux and the windows installers will allow you do do that, regardless of the status of the first partition.

What escapes me still is why do you need (or why do you think you need) sda1 to have any special "hidden" status. However, I am no specialist in Windows, maybe something basic is escaping my understanding.

Quote:
if I have 250GB=250000mb, even if it's ~250GB, and i divide it by 1024, it will be ~244, and windows shows 232.9, Can someone explain my this trivial .
Your maths are still a bit fuzzy, 250,000,000,000 bytes we have. If we count in multiples of 1024, they *aren't* 250000mb. If we use 1024 as the unit, we must use it for all the conversions, and not just one of them. So, 250,000,000,000 bytes are:
  • 244,140,625 kilobytes
  • 238,418 megabytes
  • 232 gigabytes

250,000,000,000/1,024/1,024/1,024
 
Old 07-10-2009, 02:51 PM   #13
Kap1234
LQ Newbie
 
Registered: Jul 2009
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by i92guboj View Post
Your maths are still a bit fuzzy, 250,000,000,000 bytes we have. If we count in multiples of 1024, they *aren't* 250000mb. If we use 1024 as the unit, we must use it for all the conversions, and not just one of them. So, 250,000,000,000 bytes are:
  • 244,140,625 kilobytes
  • 238,418 megabytes
  • 232 gigabytes

250,000,000,000/1,024/1,024/1,024
Right, haven't slept whole night so was really silly .
I'm trying to format my hdd using fdisk now. So to make sure everything works fine a found a manual at http://www.ehow.com/how_1000631_hard-drive-linux.html. It is made for ext file system so i have little troubles. I want to install windows first, make sure everything works, then install linux. So using fdisk i made few ntfs partitions using this manual, formatted them using mkntfs command, now it says i need to check those partitions and write them into fstab so they would mount, all of these can be done with fsck command, but it doesn't work for ntfs. I found out that i can check my ntfs using ntfsresize -fi /dev/sdaXY (check this please so i wont do anything wrong). But how do i mount them? And do i really need that for ntfs??
 
Old 07-10-2009, 03:07 PM   #14
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,074

Rep: Reputation: 386Reputation: 386Reputation: 386Reputation: 386
Quote:
Originally Posted by Kap1234 View Post
I want to install windows first, make sure everything works, then install linux.
That's usually the best option.

Quote:
So using fdisk i made few ntfs partitions using this manual, formatted them using mkntfs command, now it says i need to check those partitions and write them into fstab so they would mount
To check the partition you usually would use fsck, but I have no idea if there's a working fsck version for ntfs. In any case, and before continuing, and for the sake of accuracy on my answers, what driver for ntfs are you using. There are two (at least), the in-kernel one, called ntfs, and a 3rd party one called ntfs-3g. The former provides only with read support (and an useless and very limited write support only). The later provides full r/w support.

So I have no idea what the correct way to check an ntfs volume on linux would be.

So, are you using ntfs or ntfs-3g?

Quote:
But how do i mount them? And do i really need that for ntfs??
I will answer this after you tell me what driver are you going to use for ntfs. If you still don't know, decide based on what kind of support do you need (read/write versus read-only).
 
Old 07-10-2009, 03:31 PM   #15
Kap1234
LQ Newbie
 
Registered: Jul 2009
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
In any case, and before continuing, and for the sake of accuracy on my answers, what driver for ntfs are you using.
Opensuse website answers that very clearly:
"Note: To prevent damage to file system, the NTFS partition that has errors will be always mounted as read only.
To correct this you should boot Windows® and run file system repair program. Repair is not yet possible from Linux.
Seems like the ntfsresize will only check for errors but wont repair anything. I wonder if i have to check at all? I have just formatted, is there any chance of error?(guess yes )

Version:
11.0 For openSUSE 11.0, ntfs-3g is installed by default and write support is enabled for root only..
By default, only root user can write on NTFS partition. Modify /etc/fstab to reflect dmask=002 to enable user writing."

So now i only need to know how to mount, as it seems anyway I will have to boot from windows bootdvd.


*About ntfsresize, it is said to use options -fi, and that goes as
-i, --info
By using this option ntfsresize will determine the theoretically smallest shrunken filesystem size supported. Most of the time the result is the space already used on the filesystem. Ntfsresize will refuse shrinking to a smaller size than what you got by this option and depending on several factors it might be unable to shrink very close to this theoretical size. Although the integrity of your data should be never in risk, it's still strongly recommended to make a test run by using the --no-action option before real resizing.

Practically the smallest shrunken size generally is at around "used space" + (20-200 MB). Please also take into account that Windows might need about 50-100 MB free space left to boot safely.

This option never causes any changes to the filesystem, the partition is opened read-only.

-f, --force
Forces ntfsresize to proceed with the resize operation even if the filesystem is marked for consistency check.
Please note, ntfsresize always marks the filesystem for consistency check before a real resize operation and it leaves that way for extra safety. Thus if NTFS was marked by ntfsresize then it's safe to use this option. If you need to resize several times without booting into Windows between each resizing steps then you must use this option.

Resizing this way is the same as error repair? =/
What is actually being repaired? bad blocks? Can i use bad blocks command instead?
 
  


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
tricky backup of Linux system to NTFS partition to increase partition size Pandarsson Linux - General 5 07-09-2008 02:35 PM
Hiding partition / directory codyko Programming 3 01-29-2008 07:36 PM
Deleted ntfs partition - added linux partition in its place - corrupt! eklhad Linux From Scratch 2 06-28-2005 01:31 AM
A partition is hiding... jsheffie SUSE / openSUSE 2 04-25-2005 12:30 PM
Hiding NTFS drive the_imax Linux - General 7 10-30-2004 02:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:34 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration