VectorLinux
January 31, 2015, 10:52:31 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 [2] 3 4 ... 10
 11 
 on: January 21, 2015, 05:01:39 pm 
Started by polaris96 - Last post by polaris96
CHANGELOG
22 January 2015:   Added fstab entries and corrected spelling / grammar.  Also added some comments and background material to procedures.

24 January 2015:  Added a bit on changing HOSTNAME and a few more spelling corrections.  Suggested 8G or bigger usb stick.  Added sample syntax for the lvm share entry in grub.cfg





Hello, $ALL;

I'm a new VL user.  I like LVM. A LOT.  Pleased to say it was very straightforward migrating VL to an LVM share.  I'll write a PROPER how to as soon as I have the time to do so.  Here's a quick and dirty for any that want to mess around with it right away.


$CAVEAT

1.  This will not make sense to some very new linux users.  As I mentioned above I will be writing a more comprehensive how to when I get time.
2.  I'm using Grub2, here.  Lilo would probably work, but I have no experience tweaking lilo.


$REQUIRED

1.  You must alread have a basic understanding of GRUB2 ( or Legacy ) and LVM.  You must also know the general qualities of a POSIX system.


$PROCEDURE

1.  Boot VL Live

2.  Grab a 8G or larger USB stick and Install VL from the choice on the Live image GUI. ([menu][system][install VL])
      A.  Install to the USB Stick
      B.  Make sure you select all available services when installing.  I thought I could get away without Inet  and boxed my Dbus connection to the X server (No mouse and keyboard).  VL is small.  Don't cut corners to save more space.  It's counterproductive.
      C.  Install the mkinitrd package from the slackware 13.37 repo (google it.  URL to follow in proper tutorial)
      D.  using a terminal:
Code:
su
mount /dev/sd[$whatever your USB is] /mnt
mount --rbind /dev /mnt/dev
mount -t proc /proc /mnt/proc
mount -t sysfs /mnt/sys
chroot /mnt
you should see the usual text the VL prints on a login.  You are now operating inside the new install environment (cool, huh?).  
This means your root directory(/) within the chroot terminal is actually /mnt/.  Any changes you make to the system will be made within the chroot environment (usb stick) and not the system you booted on startup.

3.  edit the file /etc/minitrd.conf (this will initially be saved in /etc/initrd.conf.sample.  use nano to edit it and save as mkinitrd.conf)
Nano is very easy to use (think I'm lying?  Try vi then get back to me.).  If you need more info there's a manpage and plenty of how tos on the web.
Code:
nano /etc/mkinitrd.conf.sample
you will see
Code:
# mkinitrd.conf.sample
# See "man mkinitrd.conf" for details on the syntax of this file
#
SOURCE_TREE="/boot/slack/initrd-tree"
#CLEAR_TREE="0"
#OUTPUT_IMAGE="/boot/slack/initrd.gz"
KERNEL_VERSION="3.10.17"
KEYMAP="us"
#MODULE_LIST="ext4"
#LUKSDEV="/dev/sda2"
#LUKSKEY="LABEL=TRAVELSTICK:/keys/alienbob.luks"
ROOTDEV="/dev/$USB_PATH" # replace $USB_PATH with your actual device node
ROOTFS="ext4"
#RESUMEDEV="/dev/sda2"
#RAID="0"
LVM="1"
UDEV="1"
#MODCONF="0"
WAIT="2"
OK, it won't look EXACTLY like that.  I'm on my slack64 machine now.  Here's what you need to do:
MAKE SURE:
LVM="1" you can live without this if you only want the USB system.  If you want LVM, you need it.
WAIT="10" (usb drives are slow to come up in early boot space.  your initrd will crash if you don't wait for root to appear)
ROOTDEV="$DEV-PATH-TO-ROOT"  this is the address for the usb stick you just installed to.  (ex. /dev/sdf1 )
OUTPUT_IMAGE="/boot/slack/initrd.gz"  this is the location of the ramdisk you will be making.  It's wise to sign your work.  The path should be the location of you vmlinuz, config.sys, and system.map files.  You might try "/boot/initrd-usbvector.gz".  I like to name my ramdisks because I usually have several in my bootdir.
Also, make sure there are no comment marks ("#") in front of the lines you need to change

4.  Make the ramdisk
Code:
mkinitrd -F
Then open your boot directory and look for the $INITRD you specified in OUTPUT_IMAGE.

5.  Leave the chroot and unmount the usb system
Code:
exit
cd /
umount /mnt
cat /etc/mtab
Check the contents of mtab, making sure your usb device isn't mounted on /mnt anymore

6.  Edit /boot/grub.cfg (this is normally a gigantic No-No, but I've always preferred to edit grub.cfg and not run update-grub until I know the system will run as routed.  more on that in the real tutorial)
Code:
nano /boot/grub.d/grub.cfg
then add something like this:
Code:
menuentry "Vector 3.0.8" --class linux --class gnu --class os {
insmod part_msdos
insmod $FILESYSTEM #replace the variable with the proper FS for your USB system
set root='(hd0,msdos1)' #This needs to be the correct root partition.  google grub setup if you need to
linux /slack/vmlinuz root=/dev/$USBPATH ro rootdelay=9 #Rootdelay is a nice feature that can hold the root mount without waiting in initrd.  You don't need it if you set up initrd as above
initrd /slack/initrd.gz  #All of these paths need to be corrected for your actual devices.  I will go deeper when I have time
}

7.  Reboot and select "Vector 3.0.8" from the grub2 menu.  If everything was done correctly, you're now into "Normal" VL 7 system mounted on a USB stick (This makes an awesome rescue disk and it's fun to show off to your geeky pals)
Code:
pvcreate /dev/hda   # this identifies your HDD to the lvm abstraction layer
vgcreate VCTRVG   # this creates a "Volume Group" from which you can create LVs
lvcreate -n $NAME -L $SIZE VCTRVG   # Create a logical volume
mkfs -t $FSTYPE /dev/VCTRVG/$NAME   # Create a filesystem on the LV
mount /dev/VCTRVG/$NAME /mnt  # mount the partition so you can write to it.

8.  Next, we need some rules for rsync.  rsync is a flexible and powerful file synchronizing utility.  We're going to "mirror" our usb setup onto the logical volume.  We need to make sure it doesn't go into a tailspin by trying to copy the directory we're writing to (/mnt), or waste a lot of space copying data that isn't really stored (/proc, /dev, /sys) or that we don't need at all (/tmp).
Code:
cat <<EOF > mirror-root.rules  #we're using the cat command with an stdin redirect to write our rules file
>- /proc
>- /sys
>- /dev
>- /tmp
>- /mnt
> -*.iso
>EOF

9.  Before we mirror, customize the system if you want.  You don't have to, but I liked my Vector USB system so much I pretty much created the laptop LVM system I was looking for, utility and graphics wise.  Now I have two exactly similar systems.

10.  Now use rsync.  Do a dry run first
Code:
rsync -nav --filter="merge ./mirror-root.rules" / /mnt

11.  You should see gibberish- LOTS of gibberish.  if you see ERROR statements or if it terminates quickly, check your syntax.  Otherwise, run it for real.
Code:
rsync -av --filter="merge ./mirror-root.rules" / /mnt

12.  Now, create the missing folders
Code:
cd /mnt
mkdir proc mnt dev tmp sys # if the kernel deosn't see all these folders it will halt the boot before root gets mounted.

13. set up another chroot
Code:
mount --rbind /dev /mnt/dev
mount -t proc /proc /mnt/proc
mount -t sysfs /mnt/sys
chroot /mnt

14.  edit the /etc/initrd file to add the correct path to the lvm share:
Code:
nano /etc/mkinitrd.conf
you need to change the ROOTDEVICE parameter and make sure lvm is enabled also
Code:
ROOTDEV="/dev/mapper/VGVCTR/$NAME"  #usually lvm shares can be assigned as "/dev/mapper/$VG/$LV" or sometimes "/dev/mapper/$VG-$LV"
LVM="1"

15.  Edit fstab.  You need to tell root where the fs mounts are
Code:
nano /etc/fstab
you need something like:
Code:
/dev/mapper/VCTRVG-RootVector / ext4 defaults 1 1
You should be ok with all of the other entries in fstab

16.  Change the hostname, if you want
Code:
echo $NEWHOSTNAME > /etc/HOSTNAME
 

17.  Change grub.cfg again.  You can C/P the entry above and alter the paths to your lvm share, but make sure to add an "insmod lvm" line to the other insmod statements.

Here's a sample Grub.cfg entry
Code:
menuentry 'Vector LVM' --class gnu --class os {
load_video
insmod gzio
insmod part_msdos
insmod lvm
set root=lvm/X60--vg-Vector  #PAY CLOSE ATTENTION TO THIS SYNTAX "lvm/$VG-$LV"
echo 'Loading Vector Linux 7...'
linux /boot/vmlinuz-3.0.8 root=/dev/mapper/X60--vg-Vector ro
echo 'Loading initial ramdisk ...'
initrd /boot/initrd-polarisLVM.gz
}


REBOOT into LVM.

OK, I know this is sketch, but I'll write more when I can.  Fell free to ask questions and I'll do my best to return answers, but, like I said, I'll be doing a better tutorial when I can

Cheers,

$POLARIS96

 12 
 on: January 21, 2015, 09:32:57 am 
Started by polaris96 - Last post by M0E-lnx
Welcome to Vector Polaris96... Nice subject line Wink

I'd be happy to help in any way I can.  Nice to have you on board

 13 
 on: January 21, 2015, 06:54:44 am 
Started by denbid - Last post by bigpaws
What type of installation are you doing?

Dual boot, means two or more Os's
or VL only?

What is the size of your hard drive?

Bigpaws

 14 
 on: January 21, 2015, 05:56:15 am 
Started by denbid - Last post by denbid
What sizes and what labels do I use?
I have read setting up hard drive but the terminology is not the same.

 15 
 on: January 19, 2015, 04:50:16 pm 
Started by polaris96 - Last post by polaris96
If your storage space is very limited, I understand not using LVM.  I'm a head for it, though.

<RANT>
I started using it a while ago on storage servers because the ability togrow the FS is unsurpassed.  My data was periodically hard-backed, but I also used mirroring and snapshots, both of which are hugely facilitated by LVM.

I used to use dm-raid and chucked that because the raid arrays I use (usually RAID10) can be implemented in LVM without additional abstraction.

I'm done evangelizing, but I do think you'ed like it if you tried it.  The technology is robust and tested at this point.
</RANT>


So, I'm going to first tweak out my system on a "Normal" partition (quotes because it's a usb stick.  Posting a bit on that one soon).  Then, I'll mirror to the LVM share.  Finally, I'll chroot into the share and remake the initrd to include LVM.

...The journey continues...  I'll post more as events eventify

 16 
 on: January 18, 2015, 07:33:51 pm 
Started by polaris96 - Last post by bigpaws
This link may provide some ideas:

ftp://ftp.slackware.com/pub/slackware/slackware-current/README_LVM.TXT

I have not used LVM.  The possibility of data loss is unacceptable for my uses.

Try making the LVM then mounting it. Then you could either use dd or rsync to
move your data.

HTH

Bigpaws

 17 
 on: January 18, 2015, 07:28:18 pm 
Started by polaris96 - Last post by bigpaws
Hi Polaris96,

Welcome to Vector Linux Smiley.

You are right most of the documentation is geared towards new  and inexperienced users.

There is not much in the for the type of documentation that you are looking for.

The livecd is not really designed as volatile media. It is customizable in the
fact that you could customize the livecd.

Bigpaws

 18 
 on: January 18, 2015, 05:40:13 pm 
Started by polaris96 - Last post by polaris96
Has anybody tried it, yet?

My plan is to rsync a physical partition onto an LVM share after a "normal" install.  This is kind of annoying, but I can't think of a way to reveal LVs to the stock installer.

I anticipate some headaches with creating a new initrd... there usually are when migrating from a normal partition to lvm.

If anybody's been through it, please weigh in.  If not, I'll post any issues I had when the project is finished.

 19 
 on: January 18, 2015, 03:10:23 pm 
Started by uelsk8s - Last post by seaken
I was finally able to get VL7.0 set to use 1280x768. I used a ModeLine command in the xorg.conf file.

For now, I'll stay with version 7.0. Maybe I'll revisit 7.1 after it is released.

Thank you,
Sean

 20 
 on: January 18, 2015, 12:19:45 pm 
Started by polaris96 - Last post by polaris96
So I'm a refugee of the recent init system carnage (don't worry.  No politics, here.)

I started on SVR4 in the early '80s on serial machines.  Took a long hiatus in the '90s and wound up "discovering" how far GNU had come when I chucked windows in 2002 (which, in itself is a story...)

Until recently, I was happy in debian.  Then made my way to slackware and realized my UNIX chops had been calcified by lack of use.  AND I remembered how really crisp and elegant a Unix platform can be with proper tuning.  So, all things considered, I'm happy with the way things went and I LOVE my slack64 platform.

But then... I have a side business which uses LIN machines for mom & pop companies... uh-oh big admin.  And I've got laptops... etc,etc,etc.

And Vector looks like exactly what I wanted.  It's like you all anticipated my choices and made them before I even realized they were choices.  Thank you.  Deeply.

This distro is what ubuntu aimed to be: fast, light, friendly to normal users and almost entirely free of bloatware.  I love it.  I'm only surprised your user base isn't humongous.


Now.

Let's talk engineering for a moment.  Is there any deep doo-doo on the nuts and bolts?  why so many loop devices.  How are the Fs'es being compressed and decompresed on the fly in the light edition?  Can I alter the live image with slapt-get (or installpackage, for that matter) if it's on volatile media?

ANYTHING available documentation -wise, would be awesome.  The project docs seem to be targeted for normal users or noobs.  I want to implement this system on a large scale and I'll need to know a bit more before I can commit.  Are there any resources available at the administrator or developer level?

I know this isn't a question forum.  Please take the remarks above as rhetorical.  I'll ask in the proper place.  Thank you all again and I'm really happy to be here Wink

Pages: 1 [2] 3 4 ... 10
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!