Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (2) </ [1] 2 >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: Frugal /home simlink to another partition, how I did it< Next Oldest | Next Newest >
clivesay Offline





Group: Guests
Posts: 935
Joined: Dec. 2003
Posted: Dec. 06 2004,16:42 QUOTE

I am experimenting with my first frugal install and was trying to figure out how to place things in a /home dir without eating up a bunch of memory at restore. I think this will work for that but again, I don't know what the heck I am doing.  :p

With a little forum searching and experimentation, I came up with this method. Thought I would share as it seems to work.

Q: How do I store all my misc files on a separate partition using a frugal install and access them from /home/dsl automagically?

A: I installed Frugal on /hda1, mounted /hda5 and created a folder called /MyDocuments. After that, I opened the /opt/bootlocal.sh file and added:

Code Sample

sudo mount /dev/hda5
ln -s /mnt/hda5/MyDocuments /home/dsl


Now when I reboot, I have a symlink to /mnt/hda5/MyDocuments in my /home/dsl directory.

If there is a better way, I am open to suggestions!

Thanks

Chris
Back to top
Profile PM MSN YIM 
cbagger01 Offline





Group: Members
Posts: 4264
Joined: Oct. 2003
Posted: Dec. 06 2004,17:50 QUOTE

Your approach will work fine if your hda5 parititon is a Linux (EXT2/3, reiser etc) partition.

If it is a FAT/FAT32 partition, then some information will be lost in translation.

A solution is to make a loopfile on your FAT/FAT32 partition, format the file as a virtual EXT2 hard drive and then mount it.  Then link it to /home/dsl like you just did with hda5.
Back to top
Profile PM 
clivesay Offline





Group: Guests
Posts: 935
Joined: Dec. 2003
Posted: Dec. 06 2004,18:39 QUOTE

hmmm didn't know that. Once again you are a wealth of info, CB.

I'll have to read up on your suggestion. It's currently over my head.

Take care

Chris
Back to top
Profile PM MSN YIM 
Numenor Offline





Group: Members
Posts: 20
Joined: April 2004
Posted: Dec. 08 2004,04:40 QUOTE

Quote (cbagger01 @ Dec. 06 2004,12:50)
A solution is to make a loopfile on your FAT/FAT32 partition, format the file as a virtual EXT2 hard drive and then mount it.  Then link it to /home/dsl like you just did with hda5.

I knew about using loop to mount devices etc but this intrigues me...how is this done..I've read a little on the web but it doesnt seem to address this...everytime I read this board I am humbled... :p


--------------
"There's something corrupt going on around my pants and I just cant seem to locate it."-Groucho Marx
Back to top
Profile PM WEB YIM 
cbagger01 Offline





Group: Members
Posts: 4264
Joined: Oct. 2003
Posted: Dec. 08 2004,05:29 QUOTE

OK,

Here is a quick explanation from memory. You might need to play around with things a little bit to gain a better understanding or fix my mistakes.

In Linux, storage devices are treated like files, so you can directly access the data on your hard drive by performing operations on /dev/hda for example.

The same is true in reverse.  It is possible to create a file located somewhere (on an existing C:\ drive or a USB storage device) and then manipulate this file as if it were another hard drive.

First, you should mount your destination device.  For example, here is a command for the first IDE hard drive partition that exists on a Windows98 system:


sudo su
mkdir /mnt/windrive
mount -t vfat /dev/hda1 /mnt/windrive


You can now create or delete files on this drive.  The contents are located in the /mnt/windrive directory (aka the "mountpoint").

Next, create an empty 100MB file on this drive using the dd command:


dd if=/dev/zero of=/mnt/windrive/my_fake_hd.img bs=100M count=1


Next, format the file as a virtual EXT2 filesystem:


mkfs -t ext2 /mnt/windrive/my_fake_hd.img



Now, using the "loop" device, we will mount this file as a virtual hard drive:


mkdir /mnt/fakehd
mount -t ext2 -o loop /mnt/windrive/my_fake_hd.img  /mnt/fakehd


And you can now read or write files into your fake 100MB hard drive located at mountpoint "/mnt/fakehd".  When you reboot into windows, you will see a 100MB file named "my_fake_hd.img" that is sitting in your C:\ directory.


If you need to unmount the virtual hard drive, just type:


umount /mnt/fakehd


Now in clivesay's case, he would also need to create a symlink that points the "/home/dsl/" directory location over to the "/mnt/fakehd" mountpoint.


Hopefully, I didn't forget anything and this will be of help to you.  At least it should help you understand the concepts at work here.


Good Luck.
Back to top
Profile PM 
5 replies since Dec. 06 2004,16:42 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (2) </ [1] 2 >/
reply to topic new topic new poll
Quick Reply: Frugal /home simlink to another partition

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code