ubuntu - starting again

extern: index -|- ubuntu [1] [2] [3] [4] *5* [6] [7] -|- end
in page: server desktop terminal size bash move home: try 1 2 3 4 5 6=success and in windows

Ubuntu 8.04.1 Server AMD64

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 -

$ sudo apt-get update
$ sudo apt-get install ubuntu-desktop
$ sudo /etc/init.d/gdm start

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 ...


top

Ubuntu 8.04 LTS: April 2008 (Hardy Heron) Long-Term Support

Ubuntu 8.04.1 - Desktop

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 :-

$ glxinfo

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 ...

Gnome Terminal Size

To get help from the command line :-

$ gnome-terminal --help
will list the help items

In there is a --geometry=GEOMETRY option to add to the launcher. But how to 'add' to the launcher from the menu? I tried -

$ gconf-editor /apps/gnome-terminal
and added a 'New key' in a few places
Name: geometry; Type: String; Value: 110x42
but it seemed to have no effect ...

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 ;=()

Modify the file .bashrc

Uncomment (remove leading '#' character) from the 3 lines -

if [ -f ~/.bash_aliases ]; then
   . ~/.bash_aliases
fi

Then I created a file .bash_aliases

$ pico .bash_aliases
and in the new file created, added for example

alias la='ls -lABFgG'
alias ll='ls -al'

to be able to get a full file list from a simple -

$ la

Still lots more to add here ...


top

Moving Home!

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 ;=))


top

from : http://www.ibm.com/developerworks/aix/library/au-satmigrat.html

<quote>
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.
</quote>

It suggests creating a temporary, say /tmphome, and then using either cp, or tar to copy the old data to the new ... like

$ cd /tmphome
$ cp -pr /home/* .
or
$ cd /home
$ tar cpf /tmp/home.tar ./*
$ cd /tmphome
$ tar xpvf /tmp/home.tar

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 size

$ du -sk /home
compared to
$ du -sk /home.old
but there can be some discrepancy in the size, due to allocations units.

Verify file count

$ find /home |wc -l
$ find /home.old |wc -l

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 -

$ sudo apt-get install pysdm
I could then run -
$ sudo pysdm

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?


top

from : https://help.ubuntu.com/community/MoveMountpointHowto/ I find the commands

For editing /etc/fstab -

$ gksudo gedit /etc/fstab &

For getting the information -

$ sudo fdisk -l

To find the UUID for that partition -

$ sudo blkid
or
$ ls -l /dev/disk/by-uuid

These were some good pointers to remember ...


top

from : http://ubuntu.wordpress.com/2006/01/29/move-home-to-its-own-partition/, perhaps in better detail -

<quote>
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:

$ mkdir /mnt/newhome
$ sudo mount -t ext3 /dev/hda5 /mnt/newhome
(You have to change the “hda5″ in the above to the correct partition label for the new partition. Also, the above assumes that the new partition you created is formatted as an ext3 partition. Change the “ext3″ to whatever filesystem the drive is formatted to.)

Now, Copy files over:
Since the "/home" directory will have hardlinks, softlinks, files and nested directories, a regular copy (cp) may not do the job completely. Therefore, we use something we learn from the Debian archiving guide:

$ cd /home/
$ find . -depth -print0 | cpio –null –sparse -pvd /mnt/newhome/

Make sure everything copied over correctly. You might have to do some tweaking and honing to make sure you get it all right, just in case.

Next, un-mount the new partition:
$ sudo umount /mnt/newhome

Make way for the new “home”
$ sudo mv /home /old_home

Since we moved /home to /old_home, there is no longer a /home directory. So first we should recreate a new /home by:
$ sudo mkdir /home

Mount the new home:
$ sudo mount /dev/hda5 /home
(Again, you have to change “hda5″ to whatever the new partition’s label is.)

Cursorily verify that everything works right.

Now, you have to tell Ubuntu to mount your new home when you boot. Add a line to the “/etc/fstab” file that looks like the following:
/dev/hda5 /home ext3 nodev,nosuid 0 2
(Here, change the partition label “hda5″ to the label of the new partition, and you may have to change “ext3″ to whatever filesystem you chose for your new “home”)

Once all this is done, and everything works fine, you can delete the “/old_home” directory by using:
$ sudo rm -r /old_home

Michael, Russ and Magnus posted this solution on the ubuntu-users mailing list a few months ago.
</quote>

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!


top

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.


top

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


top

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:

$ sudo mkdir /old
$ sudo mount -t ext3 /dev/sdb2 /old
$ sudo mkdir /new
$ sudo mount -t ext3 /dev/sdb4 /new

Now we're going to back up the /home directory on the old partition and move it to the new partition:

$ cd /old/home
$ sudo find . -depth -print0 | sudo cpio --null --sparse -pvd /new/
$ cd ~
$ sudo mv /old/home /old/home_backup
$ sudo mkdir /old/home

Next, we're going to specify to use the new home partition as /home:

$ sudo cp /old/etc/fstab /old/etc/fstab_backup
$ sudo nano /old/etc/fstab

You'll then be taken to the nano text editor. Add in this line:

/dev/sdb4 /home ext3 nodev,nosuid 0 2

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:

$ sudo rm -rf /home_backup

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 ...

More Installations

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 ...


top

Making the new partition visible in Windows

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' ;=))


top

August 18, 2008 - August 16, 2008 - July 21, 2008.

EOF - ubuntu-04.doc, as ubuntu-05.htm


top

checked by tidy  Valid HTML 4.01 Transitional