extern: index -|- ubuntu     *5*   -|- end
in page: server desktop terminal size bash move home: try 1 2 3 4 5 6=success and in windows
After running into a shutdown problem, after installing LAMP, and after the installation of an upgrade from 7.10: October 2007 (Gutsy Gibbon) to 8.04 LTS, 'Hardy Heron', I decided to go for a full new installation ;=() And chose Ubuntu 8.04.1 Server amd64 ...
The ISO download was a breeze - 3 minutes ... burning the ISO to a CD-ROM a breeze - 20 minutes ... and then to check if I needed to SAVE anything BEFORE I re-install, which does a re-format of the ext2 drive chosen for the installation ...
Luckily, I have access to the ext2 linux partition from Windows Visa through the installation of a driver, although I can still boot the previous installation, but now also without internet access ...
BUT, there is no default desktop GUI with the server. This make sense I suppose, since it is supposed to be a 'server' after all - and in a way should/could be 'headless' ...
I later found out, from : http://www.psychocats.net/ubuntu/whichbuntu, that I could have just done -
It looks like there is a wealth of other information on this site ...
But not having this information at the time, I downloaded Ubuntu 8.04.1 desktop (amd64) ISO, and burnt a new DVD ...
The installation went smoothly, and after installing the about 170 updates offered, and ENABLED the 'restricted' ATI accelerated graphics drive. At least in this installation a command :-
contains the good to see line ...
direct rendering: Yes
something I was NEVER able to get working before.
It seems, despite all my precautions, I did NOT backup the files ~/.bashrc, and ~/.bash_aliases, or at least I have NOT found the copies ... so had to start again, which is not particularly a bad thing, just more time consuming to learn some things again ...
To get help from the command line :-
In there is a --geometry=GEOMETRY option to add to the launcher. But how to 'add' to the
launcher from the menu? I tried -
Also tried MENU System -> Preferences -> Preferred Application, choose [System] tab, change from 'GNOME Terminal' to 'Custom', then added '--geometry=110x42' to the gnome-terminal command ... BUT STILL NO GO! ;=((
I got around this by clicking MENU Application -> Accessories -> Terminal, and in the right-mouse button click context menu, chose 'Add this launcher to desktop' ...
Then right-mouse clicking on the desktop icon, I could choose 'Properties' ... selecting the [Launcher] tab, I could add '--geometry=110x42' to the gnome-terminal command ... Now I only need to remember to use the desktop icon, rather than the menu ;=()
Uncomment (remove leading '#' character) from the 3 lines -
if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases fi
Then I created a file .bash_aliases
alias la='ls -lABFgG'
alias ll='ls -al'
to be able to get a full file list from a simple -
Still lots more to add here ...
The idea is to move /home, that means /home/username, to a new, separate partition. This would/should mean I can re-install the OS, keeping all my data, and changes safe in the separate partition.
Be sure you COPY the original fstab to another file, so you can just rename (mv) things if/when things go wrong! Remember probably the only 'editor' available in the 'recovery' prompt may be vi, and vi really takes some time to get to know ;=)) About the only thing I remember is, if you a lucky, the key sequence ':q!' will get you out! Many keys do many weird things!!
This turned out to be a not-so-easy task ... it took SEVERAL different tries before full SUCCESS ;=))
from : http://www.ibm.com/developerworks/aix/library/au-satmigrat.html
Quick guide to moving data
The basic sequence for moving a file system, or for placing an existing directory onto a new file system, is as follows:
Choose the data to be copied.
Create a new partition.
Create a new file system on the partition.
Mount the partition on a temporary directory.
Copy the data to the temporary directory.
Rename the original directory.
Create the new mount point.
Mount the file system.
Ideally, at the end of this, you should reboot, although this isn't always necessary or
possible; you should certainly try to reboot at the earliest opportunity.
It suggests creating a temporary, say /tmphome, and then using either cp, or tar to copy the
old data to the new ... like
Then the actual creation and move ...
1. rename (mv) home home.old
2. create and mount the new partition, with same permissions and ownership
3. mount the filesystem at /home
4. Use chown and chmod to set the ownership and permissions on the new directory
5. change into (cd) \home
6. extract the tar -xvpf /tmp/home.tar
Verify file count
But the first step is preparing the partition. I have a partition under /dev/sbd (298.09 GiB), namely /dev/sbd4 (94.73 GB) ... it was originally formatted the NTFS, so I was able to ADD the GParted ubuntu partition manager to MENU System -> Administration (somehow ;=)), and formatted the partition to ext3, but then how to permanently MOUNT it?
From : http://pysdm.sourceforge.net/, I found a pysdm
tool, and installed it using, as suggested -
This got it mounted in /media/sdb4, and a new entry in /etc/fstab appeared -
/dev/sdb4 /media/sdb4 ext3 errors=remount - ro 0 0
and /media/sdb4 has $ ls -al value
drwxr-xr-x 3 root root 4096 2008-08-17 12:30 sdb4
So, now, how to change the mount point permanently? Can I just edit /etc/fstab?
from : https://help.ubuntu.com/community/MoveMountpointHowto/ I find the commands
For editing /etc/fstab -
For getting the information -
To find the UUID for that partition -
These were some good pointers to remember ...
from : http://ubuntu.wordpress.com/2006/01/29/move-home-to-its-own-partition/, perhaps in better detail -
Move /home to it’s own partition January 29, 2006 - Posted by Carthik in administration, guides, ubuntu.
Having the “/home” directory tree on it’s own partition has several advantages, the biggest perhaps being that you can reinstall the OS (or even a different distro of Linux) without losing all your data. You can do this by keeping the /home partition unchanged and reinstalling the OS which goes in the “/” (root) directory, which can be on a seperate partition.
But you, like me, did not know this when you first installed Ubuntu, and have not created a new partition for “/home” when you first installed Ubuntu. Despair not, it is really simple to move “/home” to its own partition.
First, create a partition of sufficient size for your “/home” directory. You may have to use that new hard drive, or adjust/resize the existing partition on your current hard-drive to do this. Let me skip those details.
Next, mount the new partition:
Ok, did the above, and got warnings on re-boot ... file .dmrc should be 644, and owned by user - also the users $HOME directory must be owned by the user, and not writable by other users ... and would not complete the boot ... FAILED!
from : http://www.go2linux.org/how-to-move-home-directory-to-another-partition
Makes it LOOK so simple :-
$ mv /home /home.bak $ mkdir /home $ mount -t ext3 /dev/sdb4 /home $ cp -a /home.bak/* /home
And then open your /etc/fstab file, and add this line, in my case it is /dev/sdb4
but could be different for you -
/dev/sdb4 /home ext3 defaults,errors=remount-ro 0 1
Note, the cp -a above is the same as -dpR, where -d is same as --no-dereference --preserve=links; -p same as --preserve=mode,ownership,timestamps; -R, like -r, means copy directories recursively.
from : http://www.funnestra.org/ubuntu/hardy/#backup-home
Copy your /home directory to the desired partition ... -p same as --preserve=mode,ownership,timestamps, and -r is to copy recursively
$ sudo cp -pr /home/* /media/$PARTITION/
where $PARTITION is where the new partition is currently mounted.
Open your /etc/fstab file, and add this line, in my case it is /dev/sdb4, but could be different for you, adn add the line -
/dev/sdb4 /home ext3 defaults,errors=remount-ro 0 1
SO FAR NONE OF THIS HAS WORKED FOR ME!!! One thing noted, is that in the 'copy', the directory $HOME/.gvfs fails to get copied, with error - cp: cannot stat '$HOME/.gvfs': Permission denied
from : http://www.psychocats.net/ubuntu/separatehome - eventual success!
I get a clue! Do it all while running the Ubuntu LiveCD!!!
The current standard ubuntu install DVD I burnt from the ISO incorporates a LiveCD as well, so it is possible to boot into this ... the page describes how to create a partition using 'gparted', the ubuntu partitioning and formatting tool, but this can be done while in 'standard' ubuntu ... then, as the page says ... of course the device names may not be the same ... I have adjusted them to what mine is -
Using the new partition
Now, back in the terminal, I'm going to mount /dev/sdb2,ext3, and /dev/sdb4,ext3:
Now we're going to back up the /home directory on the old partition and move it to the new partition:
Next, we're going to specify to use the new home partition as /home:
You'll then be taken to the nano text editor. Add in this line:
Then save (Control-X), confirm (Y), and exit (Enter)
After you reboot, you should be now using your new /home partition.
If you find that you are running out of room on your old partition and you're pretty confident everything is working as it should be, then go ahead and delete the backup of home:
Let's give it a try ;=)) IT WORKED! IT WORKED!! IT WORKED!! ;=))
NOTE: A few things were changed and added to the items on the psychocats page, like 'sudo' in front of 'find' - also I had done this 'copy' of the /home directory several times before, so lots of this were already copied. Most importantly, the previously un-copied .gvfs directory got copied this time ... PHEW - what an effort!!!
NOW I HAVE MY /home DIRECTORY RESIDENT IN A SEPARATE PARTITION. HOPEFULLY, IF I NEED TO RE-INSTALL THE OS, MY /home DATA WILL BE SAFE!!!
If and when I get BRAVE enough, I can probably do the LAST step, and that is to REMOVE /home_backup, but I will leave that for a while ...
Basically, I have my NEW ubuntu 8.04 up and running ;=)) And I have /home in a separate partition, and I have direct rendering, so this seems some advancement ...
The first few things I now install are :-
$ sudo apt-get install cvs $ sudo apt-get install subversion $ sudo apt-get install automake $ sudo apt-get install libc6-dev-i386
Still lots to do ... but enough for this page ...
With my new ubuntu running well, time to make the 'shared' /home partition visible in Windows (Vista). This site has a driver to make ext2 - and an ext3 is really an ext2 with a 'journal' - visible in Windows ...
Downloading and running the Ext2IFS_1_11.exe, choosing a new drive letter for my /dev/sdb4 - I choose 'S', for 'sharing' - and it becomes visible in my dual boot MicroSoft Windows Vista ... it is not complete, in that soft and symbolic links do not show anything, as to be expected, but in general it 'works' ...
Now I am starting to have the 'best of both worlds' ;=))
August 18, 2008 - August 16, 2008 - July 21, 2008.
EOF - ubuntu-04.doc, as ubuntu-05.htm