Identifying Partitions / Can I save my own files in /boot

Asked by Matsobane

Hi Guys,

I have partitioned 80gig hard drive into 45.9gig(ext) and called it /dev/sda1 and 22.9gig(ext) called it /dev/sda5, and the rest of space as swap area.

The first partition(45.9gig) was meant for Linux to run on and the other for future installation Windows XP. But it seems that things have been swapped around, the system looks like is running on the 22.9gig.

When I install other softwares and store data, they all get stored on this 22.9gig partition. And I would like things to be the other way around because I am running out of space.

When I go to System>Administration>System Monitor>File Systems, this is what appears:
===================================================
Device Directory Type Total Free Available Used
===================================================
/dev/sda5 / ext 22.9GiB 6.3GiB 5.1GiB 16.6Gib 76%
/dev/sda1 /boot ext 45.9GiB 45.7GiB 43.3GiB 205.5MiB 0%

/boot seems to be empty, when navigate to this directory, i find other system files (e.g. abi-2.6.28-11-generic.txt,etc).
Can I store my data in this directory?
How can make sure that future software installations use this directory?

Please help.

Matsobane
Centurion, Pretoria. South Africa.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Tom
Solved:
Last query:
Last reply:
Revision history for this message
- (uzf) said :
#1

>>Can I store my data in this directory?
You *could* use the /boot-dir for storing data, but...ahm, it is just not meant to be that way.
In /boot linux stores the boot-loader data, if any files is missing or changed, you risk to lose your boot-loader and that would be fatal. (Okay, not "worlds end"-bad, but you would have to reinstall it from another source like super grub disk.)

More prudent way would be, to the rest of your installation to your /dev/sda1.

You could do it that way: You need a live cd. Boot it and open a terminal. The Ubuntu e.g. ;)

Go root. 'sudo su -'
Make some dirs for your partions. 'mkdir -p /mnt/sda1 /mnt/sda2'
Mount these. 'mount /dev/sda1 /mnt/sda1 && mount /dev/sda2 /mnt/sda2'
Then move your files over. 'rsync --progress --exclude=/temp/ --exclude=/boot --exclude=*.inc /mnt/sda2 /mnt/sda1/'
You have to mod your /etc/fstab a bit, go 'nano /mnt/sda1/etc/fstab' and change the /dev/sda2 for / to /dev/sda1.

Reinstall your boot loader for the changed setting (Not sure about this, maybe some one take a look over it)
'mount --bind /dev /mnt/sda1/dev'
'chroot /mnt/sda1'
'update-grub'
'grub-install /dev/sda' (try grub-install --recheck /dev/sda if it fails)
Strg-D to exit the chroot.
Reboot. Hope. :)

This is only a quick shot. Somebody should really overlook it, before you go trying, Matsobane.
The easier way maybe is to simply reinstall Ubuntu. But i am always for the "working on it"-option. :)

Evening.

P.S.: I'm not responsible for any possible data loss, you maybe encounter.

Revision history for this message
Dale Jefferson (dalejefferson-deactivatedaccount-deactivatedaccount) said :
#2

Hi Matsobane,

It looks like thing have been a little messed up. The partitioning part of the installer is still a little confusing.

/boot is normally under a 100MB and used for storing the files needed to boot.
/home is where you store your personal files.
swap should be 2-4GB

I would reinstall and just use the default (all one big partition) option. It will create a ~76GB / partition which will include your /home and a small <4GB swap partition.

Windows can not share or read the Linux file system so you will need to leave a spare partition not free space in a Linux partition.

Revision history for this message
gadolinio (gadolinio) said :
#3

Hi Matsobane.
As Sebastian Gurkasch perfectly said, you will certainly not die from having-stored-something-in-the-/boot-directory, but i would STRONGLY disrecommend you to mess up with system's folders. And that wouldn't solve your primary problem, as you would still be using the smaller partition for ubuntu.
You can try redistributing the space to make things the other way around, i mean, enlarge the ubuntu partition using some space of the now-empty one. Reboot your computer with an ubuntu liveCD, and open system-->administration-->gparted partition editor. There you'll see a graphic representation of your hard drive's structure. Right click the ubuntu partition, and choose to resize it. You'll see the program is very easy to use, and without any terminal commands.
This way you will have all the space you want in ubuntu, and you can leave less for your future windows...
Hope you find this useful

Revision history for this message
Matsobane (matsobane-khwinana) said :
#4

Thanks guys....

gadolinio...I have used your suggestion: liveCD and gparted partition editor.

I have shrinked the big partition that has /boot directory from 45.9GB to 6.7GB, which left me with 40GB of unallocated memory.
I then created a new partition out of that memory for data storage and formatted it to ext3, but the thing is: the partition is there but I can't create files and folders in there, it says I am not the owner but "root" is.

How do I change this permission?

Was formatting to ext3 the write thing to do?

Revision history for this message
Best Tom (tom6) said :
#5

The normal user is only allowed to write into the /home folder. Many people put their /home folder on it's own partition to keep all their data and settings safely away from the main OS & programs. Yes ext3 is probably the best for most of us.
http://embraceubuntu.com/2006/01/29/move-home-to-its-own-partition/

However it might be worth starting again with installing Ubuntu because it seems like you are getting in a right muddle. Start from a LiveCd session so that you can use it to surf into here or elsewhere if you get stuck and need to look something up halfway through installing. If you have trouble getting to a LiveCd session here's a guide
https://help.ubuntu.com/community/BootFromCD

Then just install using this guide for advice
https://help.ubuntu.com/community/WindowsDualBoot

but you might need to use "Manual Partitioning" to sort your partitions out. My recommendation for the best way to partition your drive to maximise performance and to make it robust is to layout the partitions like this

sda1 size = 2xRam "Primary Partition" format 'file-system' = 'linux-swap'
sda2 10Gb "Primary Partition" file-system=ext3, set it's "Mount Point = /"
sda3 45Gb "Primary Partition" file-system = fat32 for Windows
sda4 20Gb "Extended Partition"
 . sda5 20Gb "Logical Partition" file-system = ext3, set it's "Mount Point = /home"

Don't bother to have a separate /boot because it doesn't really help much except on certain ancient hardware setups and it does make things unnecessarily complicated. Note that Ubuntu probably can't make an ntfs partition for your Xp so when you install Windows you'll need to reformat that fat32 from within the Windows installer. There is a bug-report about this issue and apart from that Ubuntu is great at dealing with stuff on ntfs partitions. The reason for putting the /home at the end of the drive and inside an extended partition is to increase flexibility for the future. Drives can only have 3 primary partitions and an extended one (or 4 primary ones) so the 4th partition on a drive needs to be an extended partition in case you later find a need for more partitions as an extended partition can contain a lot of partitions but a primary one can't. You'll notice that the / partition doesn't really need more than 5Gb but giving it plenty of extra room doesn't hurt at this stage. If there is any extra space then give it to Windows. Note also that i've arranged to have the swap and the OS's at the front of the drive where read/writes happen faster. The data is relegated to the end of the drive because it tends to get cached (queued up) in ram and swap whereas read/writes to the OS tend to be unpredictable so the faster read/write times are more important to system files rather than data. Also note that while Ubuntu can happily use data stored on your Windows side Windows can't read linux data so i tend to keep most of my data in Windows partitions so that both OS's can read everything ;)

Oh, if you are going to install Windows 2nd then this guide might help after that
https://help.ubuntu.com/community/WindowsDualBoot#Recovering%20GRUB%20after%20reinstalling%20Windows

Also you might want to work through this guide to sort all your multimedia straight after installing Ubuntu
https://help.ubuntu.com/community/Medibuntu
i tend to go with non-free at first. It doesn't usually invoke costs but does make things a lot easier until you really find your way with OpenSource ;)

Then these guides might help clarify a few things, the 1st is just for dipping into occasionally rather than reading all the way through
https://help.ubuntu.com/community/SwitchingToUbuntu/FromWindows
http://librenix.com/?inode=21
https://help.ubuntu.com/community/Antivirus
https://help.ubuntu.com/community/RootSudo
the rest are just some background reading :)

Good luck and regards from
Tom :)

Revision history for this message
Tom (tom6) said :
#6
Revision history for this message
gadolinio (gadolinio) said :
#7

Waaaaaaaaiiiit! I didn't see how you had your partitions distributed. You have no partition for windows there!
/dev/sda5 / ext 22.9GiB ---> this is ubuntu's, and yours. This is the actual partition you're using.
/dev/sda1 /boot ext 45.9GiB---> this /boot part is not free/available for windows.

As Tom says, you don't need a special partition for /boot.
And when you make one for windows, don't use ext3; windows doesn't recognize (al least not out-of-the-box) ext partitions; if you want windows to read and write ext file system you have to install some program - which i don't know, but i think i've heard of.
The windows installer formats it in NTFS for its own installation.
And regarding the part for data storage, i'd also use NTFS, so that it is possible to see it from windows too. NTFS can be used by both operative systems. It would be an advantage to have a "shared" partition, where you can save files from both systems, and transfer them from one to the other.

·If writing in the storage partition is forbidden for you, because you are not its owner, you can make it yours.
First, locate the 40Gb partition's path. For example: "/media/data".
Go to applications-->system tools-->root's terminal. (or, what is the same: press alt+F, and execute "gksu /usr/bin/x-terminal-emulator").
When the root's terminal appears, type "cd PATH_WHERE_THE_PARTITION_IS_MOUNTED". In the case of the partition "/media/data", you should type "cd /media". (just in case: note the space between "cd" and "/media"). Press enter.
And finally, type "chown YOUR_GROUP_NAME NAME_OF_THE_PARTITION". If your user/group name is "matsobane", then you must write "chown matsobane data".
All together:
open root's terminal.
cd /media ENTER
chown matsobane data ENTER

Once you do this, you'll be able to use that partition.
Tell us how thigs go...

Revision history for this message
gadolinio (gadolinio) said :
#8

HEY! Alt+F in incomplete!!!! i meant "alt+F2"!!!

Revision history for this message
Tom (tom6) said :
#9

Hi Gadolinio

The /home partition can't be an ntfs (or fat32) partition, or can it? If it could be then that would be incredibly cool. I know 20Gb might be a bit excessive but as all Wine programs get 'installed' into /home i figured it best to give lots of space here because we all like to experiment around with Ubuntu, especially at the beginning.

Hopefully after installing and playing around installing a few extra things and getting a feel for linux generally then we could help Matsobane resize things a bit to fine-tune them and hopefully give Windows a bit more room.

Good luck and regards from
Tom :)

Revision history for this message
Tom (tom6) said :
#10

I think Dale Jefferson was right with most of what he said. The swap is normally around 2 to 4 Gb with Ubuntu.
https://help.ubuntu.com/community/SwapFaq
With much smaller distros it might be a lot less but Ubuntu is made for more top-end machines.

The main reason for having a separate /boot partition is so that each new install of a new gnu&linux distro (or anything else) doesn't wipe your carefully customised boot menu. However, if you do install lots of different OS's then each time you do they tend to get mbr to point at their own grub/lilo/ntldr so yu would have to re-'fix' the mbr to point at your /boot. Also you would then have to re-edit the "menu.lst" to include an option for the new OS - as you will have to if you install Windows after Ubuntu anyway. Mostly installing anything other than Windows installs grub or lilo which automatically searches out all the OS's on your system and creates a menu item for them automatically. So not having a separate /boot can usually be an advantage because it means less faffing around after installing an OS. As for personalising the boot menu with pictures and changing titles around and stuff, wellit's kinda fun but a bit pointless when the main aim of the menu is to quickly get you into the 'right' OS quickly. Re-theming the desktop; changing the wallpaper and tweaking the desktop effects makes a lot more sense because you'll be able to usefully enjoy it a lot more ;)

I always enjoy getting fire-writing set-up quickly to see the looks on people's faces although a VJ i showed it off to was more impressed with my hand-writing using a mouse rather than the effect!! Most people are impressed by the effect tho :)

Good luck and regards from
Tom :)

Revision history for this message
gadolinio (gadolinio) said :
#11

Mmmm i'm not sure whether >THE< /home directory can be in a ntfs partition, but one could surely create >A< /home directory in a ntfs partition... It is possible to create a directory called /home or whatever you want it to be called, have all permissions over it, add it to the bookmarks appearing in "Places" menu, etc. The problem (or the thing about which i don't know much) would be installing programs in that directory rather than in the "official" /home one. Maybe you could move the official /home to the ntfs part., and make programs recognize/use it somehow. Yes, if /home could be naturally in ntfs, that would be great. Ha, you could also make it to be the "my documents" folder in windows, too! Right clicking the "my documents" icon in the windows desktop and going to properties gives you that option. What would it be like to have a single personal folder, for two operative systems...?

Revision history for this message
gadolinio (gadolinio) said :
#12

Yay! I've successfully created a new user whose home folder is in a NTFS partition! i've started a session w/ that user and things seem to be OK. When you go to system-->adminisstration-->users and groups, and add a user, you can choose a path for his home folder; and it lets you set it to /media/ntfs_partition.
Wow, i had never thought about that...

Revision history for this message
Tom (tom6) said :
#13

WooooHooo, fantastic. I didn't think we could do that and it really opens up a lot more interesting potential for dual-boot systems :))

Nicely done Gandolinio :)) Can you boot into Windows and see how your new users folders look from there?

Regards from
Tom :)

Revision history for this message
Tom (tom6) said :
#14

I would be cautious about setting Windows to change it's "My Documents" location because that usually seems to involve a lot of messing around with the infamous Windows registry which is well worth steering clear of!!

I haven't tried with Vista or Windows7 but in Xp it usually gets quite confused and ends up setting up 2 different fodlers and makes it very unclear which you are using at any particular moment. I don't think it breaks the system but editing the registry can easily break the system with even a slight slip. Not that breaking Windows is necessarily a bad thing tho ;)

I would use this to setup a user on what Windows would call my D: 'drive' rather than setting it up in the main boot partition for Windows. Windows can't cope with long filenames which is sometimes a problem when you save web-pages - although if Windows refuses to boot because of that then it's quite easy to boot into a gnu&linux distro such as Ubuntu and just shorten the filename. Anyway i would rather boot ino Windows and just not be able to see the D: 'drive' rather than being unable to boot and then bounce back into Ubuntu to spend time fixing that and then bounce back into Windows. The less time i spend with Windows the happier i tend to be ;)

Anyway, good luck with your testing - it's great to see but take care while you're exploring the possibilities there!
Regards from
Tom :))

Revision history for this message
gadolinio (gadolinio) said :
#15

I've just finished the experiment, and it works OK. No booting problems. When I changed my_document's path, i was asked whether i wanted to move all the user's folders too. I agreed, so everything corresponding to that user is now in that directory in a data partition in ntfs.
Both users (windows and ubuntu's) can read&write&delete files in their shared folder, without any restriction of permissions. Something curious: while folders such as music and images have different names (w->"my music","my images", u->"music", "images"), desktop one is called the same: "desktop" for both OS. So, whatever you have in one desktop is also in the other. This could be good or bad, depending on what you want; i'm just "reporting" it.
You can have a single folder for music-images-etc, so that you keep all your personal files in only one directory - whichever OS you choose to use at the moment. That would be pragmatic.
Interesting thing we've learned here...
Well Tom, we couldn't mess up windows with this... But fortunately it does it by its own, so that we don't need to figure out a way ;)

Revision history for this message
Tom (tom6) said :
#16

That is truly amazing! I'm impressed!
Was this with Vista, Xp or which one?
Totally amazing that it's worked. Awesome that you risked it ;)))

Revision history for this message
gadolinio (gadolinio) said :
#17

It was with Windows XP. I also did that with Vista in a friend's computer; the idea was to move all the personal documents to another partition because C:\ was nearly full, and I don't remember why I wasn't supponsed to resize the partitions. And I must say that in Vista this is much less clear than in XP, at least for me. The path you see for your documents in not its real path... it's somewhat strange and confusing... It seems like vista doesn't want you to know where files are and modify things. And when I moved the folder, some files still remained in the previous one... Luckily i don't remember much about the issue :P
I risked it because i had feith in that it wouldn't destroy the OS... But if it had, I would be now windows-less, because I bought the computer with windows installed but they didn't give me the CD. If I hapen to need a reinstall, I have to buy it AGAIN. Nice licence M$ created... :S

Revision history for this message
Matsobane (matsobane-khwinana) said :
#18

Thanks Tom, that solved my question.

Revision history for this message
Tom (tom6) said :
#19

Brilliant, nicely done !! :)))
Thanks for holding off on marking that thread solved for gandolinio's experiment :)
Welcome to linux-land, especially the Ubuntu corner of it :)
Congrats and regards from
Tom :)