VectorLinux
October 01, 2014, 08:01:09 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Visit our home page for VL info. To search the old message board go to http://vectorlinux.com/forum1. The first VL forum is temporarily offline until we can find a host for it. Thanks for your patience.
 
Now powered by KnowledgeDex.
   Home   Help Search Login Register  
Please support VectorLinux!
Pages: [1]
  Print  
Author Topic: Partition confusion  (Read 2094 times)
subgeniusd
Member
*
Posts: 27


What's your voltage, Coppertop?


« on: July 20, 2007, 02:06:56 am »

                                                                                                                                                        July 19, 07

Hi all - So I followed the VL 5.8 Standard/Xfce installation procedure and everything has been OK with a few minor hiccups. Apparently I missed the part about mounting partitions. I assumed they would all be auto-mounted during the installation partition selection procedure.

I have a 60 Gb HD on this laptop. I think I installed with a 3 Gb root and approx 2x RAM swap (1024) and the rest was free space (55+Gb). For some reason I assumed User/User Home would automatically go  into free space. Now I see that my HD is "97% full" and I can't do some gslapt updates. So  I've been operating for 6 months with a 3 Gb HD----not a big downloader here.

I checked the Forum (partitioning topics) and Vector Docs. Went to Vasm and it stated /dev/hda2 available for mounting and asked what directory? What directory? I know what a directory is but never heard of a partition going into a directory. I thought disk partitioning is a physical HD dividing/mapping process and directories are top categories of an abstract OS file tree beneath which can exist any number of sub-directories and files.  So a HD with 10 partitions could have 10 separate file trees. Right? Plus Vasm said "data may be lost" so I just quit. How could data be lost in a free space sector with no data?
 
I can't believe I've been operating entirely in the "root partition" all this time Shocked.  So basically I need to mount dev/hda2 without losing data. I only have one User (myself) on this system so I also need to move the entire User directory to the newly mounted partition.  I can follow CLI directions but don't want to hose this install so any advice would be much appreciated. Thanx - D.

=======================================================================

                                                                                                                                                    July 20, 07

The above is rather verbose as too often questions are posted without enough info. So to summarize:
1) During VL 5.8/Xfce installation I ignorantly failed to mount partitions.
2) I've been operating with a single partition which is now 97% full.
3) I reviewed various VL docs and went ahead with Vasm file mounting. Got a bit confused with the device mounting Xfce panel function. Looks like hda1 is mounted 3 times now. Is this a problem?
4) I'm uncertain how to move home/usr to hda2.


Gatewaylaptop://home/dan
root:# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/hda1              2931732   2839428     92304  97% /
tmpfs                   252660         0    252660   0% /dev/shm
/dev/hda2             53711680    113812  53597868   1% /mnt/hda2
/dev/hda1              2931732   2839428     92304  97% /mnt/win/dev/hda2
/dev/hda1              2931732   2839428     92304  97% /mnt/win
tmpfs                   131072        12    131060   1% /tmp



Now the cfdisk output looks exactly the way I originally intended when first installing VL 5.8. The only changes I made was changing hda2 and hda3 to bootable. The VL docs say one can have up to 4 Primary partitions so this is ok - right?

cfdisk 2.12r

                                        Disk Drive: /dev/hda
                                  Size: 60011642880 bytes, 60.0 GB
                        Heads: 255   Sectors per Track: 63   Cylinders: 7296

     Name           Flags         Part Type    FS Type              [Label]            Size (MB)
 --------------------------------------------------------------------------------------------------
     hda1           Boot           Primary     Linux ReiserFS                            3002.23
     hda2           Boot           Primary     Linux ReiserFS                          55002.45
     hda3           Boot           Primary     Linux swap                                   1019.94
                                           Pri/Log      Free Space                                     987.04


So I imagine moving /usr/home would use the "cd" and "mv" commands in root but I'm not sure the precise syntax. Thanks  Smiley- Daniel.

                                   

Logged

Net neutrality - now and forever!
tomh38
Vectorian
****
Posts: 913



« Reply #1 on: July 20, 2007, 03:42:45 am »

hi subgeniusd,

I think that when VASM asks you "to what directory" you want to mount a partition, some examples for /dev/hda2 might be /mnt/hda2 or /home/subgeniusd or something like that.  For example I have /dev/hdf5 mounted to /home.  If it's a partition with no data, then presumably no data could be lost.  I think usually those kinds of warning that are given when mounting, moving, or resizing  a partition assume that there is data to be lost.

My df -h output looks like this:

Filesystem            Size  Used Avail Use% Mounted on
/dev/hde5              15G  6.6G  7.5G  48% /
/dev/hda2              9.7G  6.7G  2.5G  73% /mnt/hda2
/dev/hde2              172G  133G   33G  81% /mnt/hde2
/dev/hda5              9.6G  5.5G  3.7G  60% /mnt/hda5
/dev/hdb1              276G  150G  113G  58% /mnt/hdb1
/dev/hda1              54G   21G   31G  41% /mnt/hda1
tmpfs                       128M   36K  128M   1% /tmp
/dev/sda                 294G   91G  189G  33% /mnt/vl-hot/sda/vol
tmpfs                       251M     0  251M   0% /dev/shm
/dev/hdf5               37G  9.6G   26G  28% /home

So if I were you I would go ahead and use VASM to mount /dev/hda2 on /home.  Then after mounting /dev/hda2 copy the contents of /home/usr to /mnt/hda2/home/usr.

Warning:  I not a dev or even all that knowledgeable about Linux, but this worked for me.  There may be some better way to do it, but this is what I would recommend.
« Last Edit: July 20, 2007, 03:44:50 am by tomh38 » Logged

"I'm doing a (free) operating system (just a hobby, won't be big and professional like gnu) for 386(486) AT clones." - Linus Torvalds, April 1991
Joe1962
Administrator
Vectorian
*****
Posts: 2499



WWW
« Reply #2 on: July 20, 2007, 06:45:37 am »

I think you need to "unlearn" some stuff and grasp the basics of Linux/Unix devices(partitions) and virtual filesystem hierarchy. I found what I think is a nicer explanation than what I can write, so...
http://www.control-escape.com/linux/lx-filesys.html

Here's a simplified table with the functions of each of the main directories in the filesystem structure:
http://www.geocities.com/sunnylug/lindir.html

That said, there used to be a HOWTO from Kocil in the old Forum for moving /home, but I can't seem to find it now.
Logged

O'Neill (RE the Asgard): "Usually they ask nicely before they ignore us and do what they damn well please."
http://joe1962.bigbox.info
Running: VL 7 Std 64 + self-cooked XFCE-4.10
GrannyGeek
Packager
Vectorian
****
Posts: 2567


« Reply #3 on: July 20, 2007, 06:22:58 pm »

I hope the replies already posted will take care of the problem. I did want to comment on automounting of partitions, however, because this has come up more than once recently.

Some new users seem to think that the partitions on their hard drive(s) should be identified and made available automatically at the time VectorLinux is installed. I think this would be an exceedingly bad idea and goes contrary to the spirit of Linux, where the user is supposed to be in control. The *user* should decide which partitions are mounted at startup. A distro ought not assume that I want all partitions automounted.

In fact, I don't want all my partitions automounted. I decide carefully which ones I want mounted at startup and which I do not. The reason is safety and efficient operation of my system.

When a partition is mounted, the files on that partition are more vulnerable. I might make a mistake and delete one file or many. If the partition is not mounted that can't happen. If some malware were to make its way onto my system, it might spread to the mounted partitions. These are just a few examples. I think *only* the partitions we actually need to have available should be mounted at startup.

I would never have my partition with my Windows system files automounted. Too risky, in my view. I have a couple of FAT32 partitions intended for sharing files between Windows and Linux and I do have those automounted.

I do have mount points and entries in /etc/fstab for all my partitions, but I determined which ones would be mounted at startup and I think that's the way to go.

This is an example of an /etc/fstab entry that mounts a Windows partition at startup:
/dev/sda5   /mnt/win_d  vfat   fmask=111,dmask=0,quiet,shortname=mixed,users  0  0

This is an example of an /etc/fstab entry that does not mount a Windows partition at startup:
/dev/sda2   /mnt/win_c  ntfs-3g defaults,allow_other,umask=0,users,noauto 0 0

Using "noauto" is the key. If I decide I need to mount the partition, I simply type
mount /mnt/win_c
at a terminal prompt. When I'm finished with whatever I needed to do that caused me to mount the drive, I unmount it.

Just my opinion.
--GrannyGeek
« Last Edit: July 20, 2007, 08:07:25 pm by GrannyGeek » Logged

Registered Linux User #397786

Happily running VL 7 Gold on  a Sempron LE-1300 desktop (2.3 GHz), 4 G RAM,  GeForce 6150 SE onboard graphics and on an HP Pavilion dv7 i7, 6 gigs, Intel 2nd Generation Integrated Graphics Controller
Joe1962
Administrator
Vectorian
*****
Posts: 2499



WWW
« Reply #4 on: July 20, 2007, 06:26:17 pm »

Well said Granny... Wink
Logged

O'Neill (RE the Asgard): "Usually they ask nicely before they ignore us and do what they damn well please."
http://joe1962.bigbox.info
Running: VL 7 Std 64 + self-cooked XFCE-4.10
subgeniusd
Member
*
Posts: 27


What's your voltage, Coppertop?


« Reply #5 on: July 20, 2007, 06:39:11 pm »

Thanks for that Control-escape link. This page was even more interesting http://www.control-escape.com/linux/lx-partition.html  but I'm going to print out the entire guide at work  Grin later this evening.  Thanks also to Grannygeek and tomh38. I can't imagine the purpose of all those partitions but after I read the control-escape guide it should all make more sense. D.
Logged

Net neutrality - now and forever!
subgeniusd
Member
*
Posts: 27


What's your voltage, Coppertop?


« Reply #6 on: July 25, 2007, 01:19:15 am »

Joel wrote:
Quote
That said, there used to be a HOWTO from Kocil in the old Forum for moving /home, but I can't seem to find it now.

Is this the Koncil How-to you referenced?


http://www.vectorlinux.com/forum1/index.php?topic=2920.0


In particular this section:

Notice that VL install does not ask your home. We regret, but you have to do that by hand as the following.

5. REGISTER HOME PARTITION
=================
Do this after your VL run properly.
a. login as root.
b. If your home is really new, format it. Otherwise, skip.
root:# mkreiserfs /dev/hda3   (or /dev/hda6)
c. Edit /etc/fstab
root:# mcedit /etc/fstab
The content is as follow
Code:


# /etc/fstab

# This is a root linux ext2 partition:
/dev/hda1     /            reiserfs   noatime   0  1
/dev/hda3    /home    reiserfs   noatime   0  2

# The 'noauto' option indicates that the file system should not be mounted
# with 'mount -a' 'user' indicates that normal users are allowed to mount
# the file system.
/dev/cdrom      /mnt/cdrom      iso9660 defaults,noauto,ro,user 0 0
/dev/fd0        /mnt/floppy     auto    defaults,noauto,user    0 0
#/dev/fd1       /mnt/floppy     auto    defaults,noauto,user    0 0

# required file system:
proc    /proc   proc    defaults        0 0
none  /dev/pts  devpts  gid=5,mode=666  0 0
usbdevfs  /proc/bus/usb  usbdevfs  defaults,noauto  0 0

# SWAP partition
# The 'sw' option indicates that the swap partition is to be activated
/dev/hda2   none   swap   sw   0   0



d. Mount your home
root:# mount -a

e. Check mounted partitions
root:# df

Next time you boot the system, root and home will be mounted automatically.

Good luck.
===================================================================================================


Regarding basic Unix file structure/useful commands the Old Forum has an excellent page:

http://www.vectorlinux.com/forum1/index.php?topic=37.0

I like this reference as it guarantees that all info is VL specific. I've found lots of variations from generic Linux sources that don't  apply to VL (or Slackware I assume). D.



Logged

Net neutrality - now and forever!
Joe1962
Administrator
Vectorian
*****
Posts: 2499



WWW
« Reply #7 on: July 25, 2007, 05:24:47 am »

Joel wrote:
Quote
That said, there used to be a HOWTO from Kocil in the old Forum for moving /home, but I can't seem to find it now.

Is this the Koncil How-to you referenced?

http://www.vectorlinux.com/forum1/index.php?topic=2920.0
No, I found that one, but there was another specifically for moving an existing /home dir to a separate partition. The trick is to mount the partition on a temporary mount point and copy everything (including hidden files), then editing fstab and rebooting. Once everything works and you want to delete the stuff in the old /home dir, I'd say the best bet is booting with a liveCD. Heck, the whole procedure can be done from the liveCD... Grin
Logged

O'Neill (RE the Asgard): "Usually they ask nicely before they ignore us and do what they damn well please."
http://joe1962.bigbox.info
Running: VL 7 Std 64 + self-cooked XFCE-4.10
Kocil
Member
*
Posts: 96

Eko M. Budi


« Reply #8 on: July 29, 2007, 11:05:04 pm »

Moving home how-to, hacker's way Smiley

1. format the new partition (if necessary)
Code:
mkfs.xfs -f /dev/hda6

2. Mount the new partition
Code:
mkdir /mnt/hd
mount /dev/hda6  /mnt/hd

3. Copy the content
Code:
cd /home
cp -a . /mnt/hd

4. Delete the old home (on your own risk)
Code:
rm -rf /home/*

5. Umount the partition
Code:
umount /mnt/hd

6. Edit the /etc/fstab, add this line
Code:
/dev/hda6    /home    xfs    defaults,noatime    1   2

7. Mount it
Code:
mount -a

Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!