Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Find the answer to your Linux question:
New to Linux Forums? Register here for free!
    Linux Forums > Linux Resources > Linux Tutorials, HOWTO's & Reference Material > make space for linux in dual boot without repartitioning

Forgot Password?
 Linux Tutorials, HOWTO's & Reference Material   A useful collection of tutorials, guides and reviews compiled here for easy reference purposes.

Site Navigation
Linux Articles
Linux Forums
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
RSS Feeds


Linux Forum Topics
Linux Forums
Your Distro
Linux Resources
GNU Linux Zone
The Community
 
Thread Tools Display Modes
Old 07-25-2004   #1 (permalink)
Just Joined!
 
Join Date: Jul 2004
Posts: 7
make space for linux in dual boot without repartitioning

NOTE: if you read the tutorial and are still experiencing difficulties and would like help, you are asked to start a new topic on the forums.
Please do NOT reply to this thread to ask a technical question. Replies to THIS thread should be corrections and enhancements on the tutorial/howto only.
Thanks in advance for your co-operation.
LinuxForums.org

------------------------------------------

Note: I am not a linux expert. So verify these steps.

If you have a dual boot system with windows and your linux partition is falling

short of space this article will help you grab windows partition disk space to

linux (grabbed space will have ext2 filesystem !) WITHOUT REPARTITIONING

I have fedora core 1 and win98 dual boot. LINUX 3.5 GB, WINDOWS 35 gb. Soon my linux

space was insufficient.

Mounting a windows fat32 partition /dev/hdax (/dev/hda1 is your c in /mnt/y using

mount -t msdos /dev/hdax /mnt/y

won't be any good as the files in it does not support long file names .To test : make text files

yourname1 and yourname2 in your ext2/ext3 partiton ie /root or any directory were dos

partitions are not mounted. Now try copying the above files one after the other into /mnt/y

were dos drive is mounted. It will ask for overwriting conformations !!!. That means whenever

you want to use such mounted drives, some files, like above two, cannot be saved in same

directory !!!.

So this is what you have to do : use a loop filesystem.

A loop filesystem is one created in a file in a partiton with any other/same file system.
So you will be creating a file in your mounted dos partiton, make ext2 filesystem in that
file, mount that file as a 'partiton' and use the space in that file to save your linux data.
Thus you are using your dos space but still having ext2 filesystem. None of the above
problems of filename exists here, but it might be a bit slow.

Lets start (i assume you are root):

1. mount your dos partiton (preferably avoid c drive) /dev/hdax in existing path /mnt/y by

mount -t msdos /dev/hdax /mnt/y

2. make a file fedora.img of say 100 mb which acts as loop filesystem

dd if=/dev/zero of=/mnt/y/fedora.img bs=1024 count=102400

'bs' is blocksize. To make 'A' MB filesystem get count value as Ax1024=B formula

3. make ext2 filesystem in that file

mkfs -t ext2 /mnt/y/fedora.img

Press y when asked. This will successfully create the loop filesystem.

4. WARNING: Now we will mount this filesystem only in a newly created directory. Do not

mount in existing paths like /usr or /root etc !

Do 'mkdir /root/test'. Add lines

/dev/hdax /mnt/y msdos defaults

/mnt/y/fedora.img /root/test ext2 loop 0 0

to your /etc/fstab file (please back it up first). The first line is to mount ur /de/hdax.

5. Restart linux or use 'disk management' tool to mount the loop filesystem in /root/test.

( /dev/hdax should be mounted first )

6. Now the folder /root/test uses windows partition and not your linux space. Use it to

save files/folders which were occupying large space in linux. I will give you my example:


i had the source of kernel 2.6.7 in /usr/src path in directory linux-2.6.7 occupying 315 MB. So

i copyed the contents of /usr/src/linux-2.6.7/ to /root/test/ (ofcourse my loop was bigger than

created above. It was of 350 Mb). I did not copy linux-2.6.7 directory itself, only whatever is

inside it to /root/test/ Remember to enable view of hidden files and copy them also to /root/test/

Now I deleted the directory /usr/src/linux-2.6.7/ contents (keep the directory linux-2.6.7,

remove its contents only) (remember to backup till you are confident with this method)

Thus i freed my linux space !!!

Then i unmounted the loop filesystem in /root/test by
editing my /etc/fstab to remove line

/mnt/y/fedora.img /root/test ext2 loop 0 0

and adding

/mnt/y/fedora.img /usr/src/linux-2.6.7 ext2 loop 0 0

and restarting my comp.

7: Use 'df' to view the results. I again had my /usr/src/linux-2.6.7/ but now it was using loop

filesystem present in windows partiton.

8. If you want to shift a file/folder to loop filesystem, then create around 20 mb bigger

filesystem than your file/folder. Otherwise you might get disk full errors. I don't know why ?

And thats all. I was able to free around 700 MB of linux space and grab windows space

without repartitioning anything. U can use the mounted loop filesystem in many other ways.


Use ur head . Feedbacks at

tuxnoel@indiatimes.com
tux21 is offline  


 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Free Magazines
Run Your Own Web Server Using Linux & Apache - Free 191 Page Preview
Learn about everything you'll need to build and maintain your Linux servers, and to deploy Web applications to them.
subscribe
Open Source Security Myths Dispelled
Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization
subscribe
InformationWeek
InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology.
subscribe



All times are GMT. The time now is 10:22 AM.






© 2000 - 2009 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.3.0 RC2