You are not logged in.

#1 2010-02-08 17:35:57

TaylanUB
Member
Registered: 2009-09-16
Posts: 150

Invisible files etc.

I downloaded MINIX 3 some time out of curiousity (have yet to try it), and taking a look into the ISO, the first thing drawing my attention is the absence of any kind of Unix files i'm familiar with. Basically there's two text-files (readme and version) and a "bootflop.img". The readme says that there's a lot of "invisible files" involved in the installation process.

Reading made me curious as to wether anything similar exists in a regular GNU+Linux installation.
I'm actually pretty sure it's not the case (somehow it would really suck, and i see no reason), but i'd like to ask (more like get a confirmation for) a couple of more practical questions that seem relevant:
Say i have a healthy GNU+Linux installation on `/mnt/nix0` (ext2), and an empty ext2 on `/mnt/empty`. Will a simple `cp -r /mnt/nix0/* /mnt/empty` create a %100 identical OS on the empty partition?
Say i have a GNU+Linux installed on a healthy ext2fs, on `/mnt/nix0`; will a simple `rm -rf /mnt/nix0/*` do the same thing as a mke2fs on the partition?


(Edit: Sorry, wrong section; i see this section is for Arch related questions.)

Last edited by TaylanUB (2010-02-08 18:05:33)


``Common sense is nothing more than a deposit of prejudices laid down by the mind before you reach eighteen.''
~ Albert Einstein

Offline

#2 2010-02-08 18:09:33

sj87
Member
Registered: 2010-02-06
Posts: 6

Re: Invisible files etc.

You should use "cp -rp", p is to preserve privileges. It copies all the files but there are still some other things to be taken care of.

Firstly, you need to re-install GRUB, because the boot loader part resides in the master boot record and is lost if you change primary HDD. And probably won't work anyways if you move root partition elsewhere.

Secondly, you need to fix /etc/fstab because in Arch the partitions are mounted by their IDs and they change if you create new partitions, even if the partition devices (/dev/sda0 etc) stayed the same.

Last edited by sj87 (2010-02-08 18:13:56)

Offline

#3 2010-02-08 18:23:06

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: Invisible files etc.

TaylanUB wrote:

Say i have a GNU+Linux installed on a healthy ext2fs, on `/mnt/nix0`; will a simple `rm -rf /mnt/nix0/*` do the same thing as a mke2fs on the partition?

No, mke2fs creates an ext{2,3,4} partition. Deletion of files just happens to be a side affect. It's sort of like blowing up world and building a new planet in its place vs. shooting everyone. While in the end, everyone is dead, very different things have happened.


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#4 2010-02-08 18:31:02

TaylanUB
Member
Registered: 2009-09-16
Posts: 150

Re: Invisible files etc.

@fsckd
But if i use the exact same mke2fs arguments as when the partition was created, and the partition doesn't have any other issues, what will be different in the end than doing an `rm -rf /mnt/foo/{*,.*}`?
Well maybe if it was a journaling filesystem, some metadata will remain after the `rm -rf` (i don't really know how that filesystem stuff works), but i could, for example, install another OS on the `rm -rf`ed partition, right? Without any problems...

sj87 wrote:

You should use "cp -rp", p is to preserve privileges. It copies all the files but there are still some other things to be taken care of.

Firstly, you need to re-install GRUB, because the boot loader part resides in the master boot record and is lost if you change primary HDD. And probably won't work anyways if you move root partition elsewhere.

Secondly, you need to fix /etc/fstab because in Arch the partitions are mounted by their IDs and they change if you create new partitions, even if the partition devices (/dev/sda0 etc) stayed the same.

Oh, i missed those.

But after fixing /etc/fstab and bootloader related issues, you'll have practically cloned the whole OS with a copying command, eh?

Sounds so simple, it's hard to believe. big_smile

Last edited by TaylanUB (2010-02-08 18:33:33)


``Common sense is nothing more than a deposit of prejudices laid down by the mind before you reach eighteen.''
~ Albert Einstein

Offline

#5 2010-02-08 19:02:21

MAroco
Member
From: Germany
Registered: 2010-01-20
Posts: 72

Re: Invisible files etc.

@fsckd: that analogy of yours is one of the most funniest I have ever read to this topic smile
Thanks for making me laugh real hard. Have to remember that.

@TaylanUB: regarding the "invisible files" I hope I don't misunderstand you here and explain the obvious smile
But there are lots of them on a regular installation. All files starting with a dot "." won't be shown in your filemanager or by "ls" command in terminals unless you activate the "show hidden files" option or pass the "-a" option i.e. "ls -a" on the terminal. The system is actually quite usefull. For example in your home-folder there are lots of hidden files and directories in which programs for example store their settings. In your day to day work you don't need to see them and rather want to look at "your" files like documents, music etc. instead of having totally cluttered output so this way you can "blend them out". On the other hand, say you get a new computer and installed your linux on it, you can just copy your home-folder to the new one and al your settings browser-bookmarks an what not are there again without you having to tweak them all again.

That you see only 2 files on the Minix CD is another topic. The .img file is an image-file, probably a squashfs. I don't know Minix but on the Arch.iso you will find something similar. You may roughly imagine that as a kind of "compressed disk image" (though thats probably not 100% technicaly correct - me no expert...). After you have started your computer with the arch CD, you will find the "normal" linux-folders like / and /home, /etc, /var... All those reside in the .img file, which gets mounted as a kind of harddisk. The compressing makes it possible to store around 2 GB of data on a 700 MB CD-Rom.

The difference between deleting everything and reformating - apart from the already mentioned GRUB and fstab issues - is mostly the way you took to arrive at your final aim "empty partition". (I still don't get over blowing up world instead of shooting everyone smile )

And that this all seems way to simple is probably owned to the fact that you are used to windows, where a  company I won't name has quite an interest in that you don't do that kind of thing but rather purchase another license.

[Edit: You can install another OS on the "rm -rf"-ed Partition, if that goes without problems will probably depend on your skills and the OS you use though smile  ]

Last edited by MAroco (2010-02-08 19:07:55)

Offline

#6 2010-02-09 15:43:17

TaylanUB
Member
Registered: 2009-09-16
Posts: 150

Re: Invisible files etc.

I'm not THAT much of a newbie. big_smile I know of the dot-files, but this MINIX CD really seems to have files that are not detected by an `ls -a`. And the .img file "bootflop" is just for floppy-disk booting for old PCs that cannot boot from CD, as said in the readme file. So not even a squashfs or something is seen. Really NO other thing than two ASCII files and the floppy booting image. (Additionally: `du -sh`ing the mount-point of the .iso says 1,5 MBs; doing a `df -h` says the .iso is 2,9 MBs and 100% full. The .iso file takes 611 MBs.)

Oh and yes, confusions like this definitely arise from how OSs install themselves, all magically and all, and then there's just a bunch of system files that you absolutely shouldn't touch (Windows), and the only way to change the OS is reformatting... (Then again, someone who only ever installed a GNU+Linux via todays graphical installers might think the same; so lets not be blatantly biased, but hate for the more correct reasons. big_smile )

My whole view on how an OS works has changed once more. Thanks for all your time.


``Common sense is nothing more than a deposit of prejudices laid down by the mind before you reach eighteen.''
~ Albert Einstein

Offline

#7 2010-02-10 18:20:12

MAroco
Member
From: Germany
Registered: 2010-01-20
Posts: 72

Re: Invisible files etc.

OK, so I was explaining the obvious, sorry to bluntly underestimate you that way, guess the NewbieCorner mislead me smile  Reading your post again, I should have anticiated from your familiar use of terminal commands...

But now you made me curious. I downloaded the iso myself and had a look at it. Think now I understand your confusion... Just two small files and a CD size round 600 MB - interesting... Googled around a bit but found no explanation either.

I know though that minix uses it's own filesystem. According to /proc/config.gz support for it is not included in the Standard-Arch kernel. So I could imagine a trick with some kind of additional minix partition/subpartition/filesystem/whatever on the disk that Arch can't read. Like you can't "see" ext4 Partitions on a harddisk if you look at it from Windows. Pure guessing in a field I'm not familiar with though. However, you seem to know more about minix than me and more about linux than I estimated, so I better keep my mouth shut, before I drop the next brick... smile

Regarding that "other OS" - just to not be misunderstood, I don't hate it at all, it's just not *my* favorite.. Your "Sounds so simple, it's hard to believe." just reminded me of my own feelings when I switched to linux, like "What you can download this for free and it's legal? And you get lots of software with it too and can give it to all your friends and thats OK? No Registration and stuff...? Where is the culprit? There must be *something* wrong here..." like that.

If you find out how they did the trick with the CD tell me please smile

Offline

Board footer

Powered by FluxBB