Hiding a partition from the O.S.

Archived topics about LMDE 1
Forum rules
LMDE 2 support ends on 1-1-2019
Locked
birchy
Level 1
Level 1
Posts: 25
Joined: Thu Apr 26, 2012 3:04 pm

Hiding a partition from the O.S.

Post by birchy » Mon Apr 30, 2012 3:22 pm

I've been using Linux for around 4 years, so this isn't a complete "Newbie question" as such.

I've just installed a fresh version of LMDE 201204 and set it up to my liking. I am now thinking that I should make a clone of this install with CloneZilla, just in case anything goes wrong. It would also make future installation easier and faster. Note that I've never used CloneZilla before. I've partitioned my 1TB hard drive as follows:

gparted.png
gparted.png (63.29 KiB) Viewed 3160 times
sdb1 is the LMDE installation I want to clone and sdb6 is where I intend to store the clone. The problem is that the sdb6 (OS_CLONE) partition is showing up in Nautilus but I want to "hide" it from the O.S. and ONLY use it when running CloneZilla. I tried setting the "hidden" flag in gparted but it was only temporary. I also edited fstab with "noauto" but that didn't work either:

Code: Select all

# /dev/sda6 (OS_CLONE = 10GB)
UUID=0d0f8fc0-55e3-4f3b-a1c1-060858dacbca	none	ext4	noauto	0	2
I've double checked the UUID and know it is correct. Can I "hide" this drive using fstab or should I use another method?

Also, as a newbie to cloning, is it the best way to backup my fresh install? I wonder if it is possible to make a custom installation DVD that ALSO saves all my current settings, etc? Would that be easier than using CloneZilla?

Thank you in advance...

birchy
Level 1
Level 1
Posts: 25
Joined: Thu Apr 26, 2012 3:04 pm

Re: Hiding a partition from the O.S.

Post by birchy » Mon Apr 30, 2012 4:27 pm

Just noticed another weird thing.... Those "empty" partitions supposedly contain 311MB and 13.81GB?? I did an ls and rm the lost+found folder but now I get...

Code: Select all

ls -a /media/STORAGE
.  ..
What's going on there? Never seen that before. :?


EDIT:
This was a stupid question. Obviously those directories are required by the O.S. root.

As for the "used" space...turns out it's the data management section required by the ext4 format, which is pretty gutsy. I've done about 15 installations over the years while trying out the never ending selection of Linux distros but never noticed that before. You live and learn. :)

http://ubuntuforums.org/showthread.php?t=1373390

birchy
Level 1
Level 1
Posts: 25
Joined: Thu Apr 26, 2012 3:04 pm

Re: Hiding a partition from the O.S.

Post by birchy » Tue May 01, 2012 12:04 pm

Was expecting a little more help than this. Luckily I have previous experience so know that the Ubuntu forums are a gold mine of helpful advice. A newbie would of given up by now and installed Ubuntu....

The solutions to the original questions:


Hiding the partition
The most obvious way to hide a partition would be to open gParted and set the "hidden" flag, but for some reason the check box wouldn't change when I tried it. Possibly because the format is ext4...I don't really know and didn't research it further. The next option is to use the File System Table file located at /etc/fstab. This file is a list of hard drive instructions that will be run at boot-up. It basically consists of a drive identification (Note that I use the UUID instead of /dev/sd* as it will not change), a mount point, the file format and some mounting instructions. After trying many settings (noauto, nouser, etc) without success, I accidentally tried to use a none existent mount point and found the drive was hidden from the O.S. but visible only to gParted. That was all I wanted to achieve so I ended up adding this line to my fstab file:

Code: Select all

UUID=a99f1ce2-1c12-41fe-8f68-54cf59ad37be	hidden	ext4	ro,noauto	0	0
Note that the mount point "hidden" does not exist. I'm assuming this just causes a mount fail at boot-up which in turn causes the O.S. to ignore the partition. AFTER cloning the O.S. partition, the UUID is the same for both partitions...which will also cause a mount fail because that UUID will already be mounted as root. So after cloning, when both the O.S. and Backup partitions have the same UUID, you can remove or comment-out the above line. Whether or not causing a mount failure is the correct way to hide a partition or drive is debatable but it doesn't appear to have an ill-effects.



Formatting the drive
As it was a 1TB drive, I wanted to break it down into partitions. The basic partition types are Primary and Extended. An Extended partition must be split into Logical partitions before it can be used . You can only partition a drive into 4 Primary partitions but an Extended partition can be split into multiple Logical partitions. The strategy I chose was to split my drive as follows:

1. 50GB Primary partition for the O.S.
2. 4GB Primary partition for memory Swap
3. 10GB Primary to hold a clone of my "clean" O.S. partition
4..a) 867GB (all of the remaining space) as an Extended partition
....b) 867GB Logical partition for Storage/Data



Cloning the O.S.
Having installed LMDE 201204, all my "usual" applications and set them all up to my preferences, it makes sense to clone the partition. This obviously makes future re-installation much faster as we don't need to go through the setup procedure again and also gives a good backup in case anything goes wrong. I've never cloned a drive or partition before, so played around with CloneZilla as it was recommended by many people. It looked over-complicated and asked lots of questions and wasn't able to copy my 5GB O.S. because the source partition was 50GB and the target was 10GB. I think there are some command line options to force it to do that, but I found it a little scary as I didn't want to lose my O.S. setup. You can also temporarily re-size the source drive but that required gParted...

As it happens, gParted also allows you to clone a drive or partition. It makes a lot of sense to use this tool as we already have it on our Live CDs/DVDs and most of use are familiar with using it. The procedure was very straight forward and I found it MUCH easier than using CloneZilla:

1. Boot up using your Linux Live CD/DVD and start gParted.
2. Re-size the source partition so it is the same size or smaller than the target partition using right-click -> Resize/Move. I made mine 10240MB (10GB).
3. Right-click on the source partition and select Copy.
4. Right-click on the target partition and select Paste.
5. Re-size the source partition back to its original size. (50GB in my case)

I've not used the backup image yet, but assume the procedure is a straight copy/paste, with no need to re-size because the target partition is larger than the source partition:

1. Boot up using your Linux Live CD/DVD and start gParted.
2. Right-click on the source partition and select Copy.
3. Right-click on the target partition and select Paste.

User avatar
äxl
Level 5
Level 5
Posts: 524
Joined: Fri Apr 06, 2012 6:14 am
Location: Germany

Re: Hiding a partition from the O.S.

Post by äxl » Sun May 06, 2012 3:01 am

birchy wrote:Was expecting a little more help than this. Luckily I have previous experience so know that the Ubuntu forums are a gold mine of helpful advice. A newbie would of given up by now and installed Ubuntu....
You have to realize that LMDE is a relatively new distribution and not the main edition of Mint. So there are not many people who can answer your easy to place but complex to answer questions after 21 hours. Having found it yourself in this time should show you that these are common (not solely Linux) questions. I would have probably linked you to a wiki ...

But thanks for putting the answers to your questions here.
the UUID is the same for both partitions
There are ways to change the UUID if wanted.
I've not used the backup image yet, but assume the procedure is a straight copy/paste, with no need to re-size because the target partition is larger than the source partition:
This looks really interesting to me since I don't like CloneZilla either. But resizing a boot partition already sounds bad in theory so please check if the image works. I need to know. ;)
My Linux history: Ubuntu 10.04 - 10.10 - LMDE 201109 - UP4 My sources.list/preferences

Computers is not science. And it's not magic - it's something in between.

birchy
Level 1
Level 1
Posts: 25
Joined: Thu Apr 26, 2012 3:04 pm

Re: Hiding a partition from the O.S.

Post by birchy » Mon May 07, 2012 8:03 pm

äxl wrote:But resizing a boot partition already sounds bad in theory so please check if the image works. I need to know. ;)
Well the obvious solution is to make sure the source is smaller than the target BEFORE installing a fresh O.S. But it resized twice without any problems.

FYI, the clone boots fine, in fact if you see my other thread, I'm having problems now because the UUID's are the same and it occasionally boots instead of my main O.S. partition. I'm planning on moving the clone to an 8GB flash drive as logic dictates that having the "backup" on the same hard drive as the "master" is not a good idea if the drive fails. But at least I proved that gParted is MUCH easier to use than Clonezilla. :wink:

User avatar
äxl
Level 5
Level 5
Posts: 524
Joined: Fri Apr 06, 2012 6:14 am
Location: Germany

Re: Hiding a partition from the O.S.

Post by äxl » Tue May 08, 2012 3:11 am

Big thanks! Sorry, had to confirm because this almost sounds too easy. :D
My Linux history: Ubuntu 10.04 - 10.10 - LMDE 201109 - UP4 My sources.list/preferences

Computers is not science. And it's not magic - it's something in between.

Locked

Return to “LMDE 1 Archive”