I am currently working on a dual-booted PC. I am using Windows XP and Ubuntu 10.04 Lucid Lynx released in April 2010.
The allocated partition to Ubuntu that I am making use of has almost exhausted. Current memory allocations on the PC
wrt Ubuntu OS looks like this:
bodhgaya@pc146724-desktop:~$ df -h Filesystem Size Used Avail Use% Mounted on /dev/sda2 8.6G 8.0G 113M 99% / none 998M 268K 998M 1% /dev none 1002M 580K 1002M 1% /dev/shm none 1002M 100K 1002M 1% /var/run none 1002M 0 1002M 0% /var/lock none 1002M 0 1002M 0% /lib/init/rw /dev/sda1 25G 16G 9.8G 62% /media/C /dev/sdb1 37G 214M 35G 1% /media/ubuntulinuxstore bodhgaya@pc146724-desktop:~$ cd /tmp
I am trying to mount a 40GB(
/dev/sdb1 - given below) new hard disk along with my existing Ubuntu system to overcome with hard disk space related issues.
I referred to the following tutorial to mount a new hard disk onto the system:- http://www.smorgasbord.net/how-to-install-second-hard-drive-in-ubuntu-linux/
I was able to successfully mount this hard disk for Ubuntu 0S. I have this new hard disk setup in /media/ubuntulinuxstore directory.
The current partition in my system looks like this:
bodhgaya@pc146724-desktop:/media/ubuntulinuxstore$ sudo fdisk -l [sudo] password for bodhgaya: Disk /dev/sda: 40.0 GB, 40000000000 bytes 255 heads, 63 sectors/track, 4863 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x446eceb5 Device Boot Start End Blocks Id System /dev/sda1 * 2 3264 26210047+ 7 HPFS/NTFS /dev/sda2 3265 4385 9004432+ 83 Linux /dev/sda3 4386 4863 3839535 82 Linux swap / Solaris Disk /dev/sdb: 40.0 GB, 40000000000 bytes 255 heads, 63 sectors/track, 4863 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0xfa8afa8a Device Boot Start End Blocks Id System /dev/sdb1 1 4862 39053983+ 7 HPFS/NTFS bodhgaya@pc146724-desktop:/media/ubuntulinuxstore$
I have a concern
wrt the "location" where the new softwares will be installed. Generally softwares are installed via the terminal and by default a fixed path is used to where the post installation set up files can be found (I am talking in context of the drive).
This is like the typical case of Windows, where softwares by default are installed in the C: drive. These days people customize their installations to a drive which they find
apt to serve their purpose (generally based on availability of hard disk space). I am trying to figure out how to customize the same for Ubuntu.
As we all know the most softwares are installed via commands given from the Terminal. My road block is how do I redirect the default path set on the terminal where files get installed to this new hard disk.
This if done will help me overcome space constraints I am currently facing
wrt the partition on which my Ubuntu is initially installed. I would also by this, save time on not formatting my system and reinstalling Ubuntu and other softwares all over again.
Please help me with this, your suggestions are much appreciated.
My current situation:
This is just my current situation post the initial problem faced by me(as per the question posted) and how I actually tried to get around it...
Thank you for your answers and comments, I am sorry, I have already tried something else which seems to have zeroed down my chances of getting back Ubuntu up & running for me now on my PC.
Every time now I try booting Ubuntu, I guess due to lack of space it no more boots on my PC. All this happened after I made one change in the system mount file located at /etc/fstab.
I changed the default location where my new hard disk was originally mounted. Originally it was mounted in /media/ubuntulinuxstore, I changed it to /usr. In other words I mounted /usr on this new hard disk and I guess also ended up making it a mount point for the hard disk.
Very soon after, the entire behavoir of Ubuntu OS and various simple commands like sudo, vi etc. stopped functioning. Files could no longer be detected from how they were initially. I couldn't undo the changes I made to /etc/fstab as I was no more the su wasn't working any more and hence making me devoid of all write permissions wrt system files..
I thought in this position a reboot would be the only last resort kind of a rescue.
I was in a position of having only around 10 MB free on my Ubuntu system. I tried booting it, the booting didn't succeed , it seemed to be stuck. This could be now because the /dev/sda2 was now 100% full leaving no memory ( may be virtual in particular to boot the OS ).
I performed a memory test wrt Ubuntu OS, that was 100% successful for me, but of no avail. This test I could perform wrt an option I got in the GRUB when starting my PC.
I tried booting via Ubuntu recovery mode, which I always get through GRUB as an option while starting my PC, this initially took me to a kind of interface. I tried vi /etc/fstab... to edit the mount location of the new hard disk( /dev/sdb1 ) to what it was originally ( /dev/sdb1 37G 214M 35G 1% /media/ubuntulinuxstore - as shown in the question above). But the only command that worked for me at that point of time was cat /etc/fstab. Even pico /dev/sdb1 didn't work for me.
I also via GRUB typed 'e'( for edit ) and then tried to edit the kernel( again made use of 'e' ) with the intention to boot for a single user( I typed single next to the already existing lines written for a file that I obtained on typing 'e' wrt the kernel). Finally on pressing enter, I was at a step higher, at the parent directory where the option of kernel was originally present , from there I entered option b( to boot ). But this didn't help at all.
Now finally every time i try booting Ubuntu via the grub, I am put in a loop due to errors wrt hard disk and I end up back at the original GRUB option. All this atleast didn't have an impact on my Windows OS. But it seems that I have almost lost Ubuntu and have to format it now freshly.
I even tried out a whacky idea of disconnecting the new hard disk from the Cpu, but that went in vain and my problem still continues to persist..
Only seems like a miracle will save me now to retain Ubuntu. Any feedback or tips which I can carry to avoid such blunders in the future?
I know this leaves me with almost no hope of getting back Ubuntu, but still I would gather some courage to ask one last time.. is there a way around this..??
Thank you very much for your patient reading and for any feedback obtained wrt my post..