LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Need advise after adding 4TB disk (FC17, KDE) (http://www.linuxquestions.org/questions/linux-software-2/need-advise-after-adding-4tb-disk-fc17-kde-4175432768/)

kaza 10-17-2012 05:28 PM

Need advise after adding 4TB disk (FC17, KDE)
 
Hello,

My FC17+KDE system resides on a pair of 130GB SAS disks
arranged in RAID 0 array /dev/sda and using LVM:

Code:

<root localhost.localdomain>.../root>df
Filesystem                  1K-blocks    Used Available Use% Mounted on
rootfs                      102534472 12835448  84490552  14% /
devtmpfs                      8173528        0  8173528  0% /dev
tmpfs                          8218184      156  8218028  1% /dev/shm
tmpfs                          8218184    1320  8216864  1% /run
/dev/mapper/VolGroup-lv_root 102534472 12835448  84490552  14% /
tmpfs                          8218184        0  8218184  0% /sys/fs/cgroup
tmpfs                          8218184        0  8218184  0% /media
/dev/sda1                      1032088  123232    856428  13% /boot
/dev/mapper/VolGroup-lv_home 135079152 74010164  54207372  58% /home

Recently, after seeing the disk usage growing fast,
I bought a pair of 2TB SAS disks, arranged them too
in another RAID 0 array (well, it had been actually reported
as 3.8TB, the usual disk manufacturers tricks of redefining
measurment units) and started looking for a way to create
an lvm2 volume on the new disk and to mount it on /home/GRAPHICS
(the largest disk space consuming directory).

During the system installation I liked the "disk druid" GUI
program but after some reading I saw it can't be used after the
installation (at least, not in a simple way).

I installed "sys-config-lvm" and "gparted" and looked also
at "lvm" and "cfdisk" and "fdisk".
I would prefate a nice GUI app like "disk druid" but I couldn't
find (or missed) an app to do what I need.
At first I created an "ext4" partition on the /dev/sdb but
then I remembered that I should create physical volume instead
so I deleted the partition.
The "system-config-lvm" didn't see the /dev/sdb disk at all,
in "gparted", looking at the avaliable types of creating a partition
I didn't see any option to create a physical volume (which, AFAIK
is needed to create logical volumes group and then lvm2 volume),
starting "cfdisk" resulted in the following message:

Code:

Warning!!  Unsupported GPT (GUID Partition Table) detected. Use GNU Parted.
and then presented what looks like 2TB+1.8TG partitions:

Code:

                                            cfdisk (util-linux 2.21.2)

                                              Disk Drive: /dev/sdb
                                      Size: 3994319585280 bytes, 3994.3 GB
                              Heads: 255  Sectors per Track: 63  Cylinders: 485615

    Name            Flags          Part Type      FS Type                [Label]              Size (MB)
 ----------------------------------------------------------------------------------------------------------------
    sdb1            NC              Primary        GPT                                        2199023.26      *
                                      Pri/Log        Free Space                                1795296.33      *


I've read about LINUX partition size limits and learned that
I have one more obstacle of which I didn't think earlier.

lookin at /dev/sdb with "gparted" it shows the entire disk "unallocated".

I'm beginning to feel "lost" in what initially looked like a sinple
task of adding a disk to the system.

Can anyone guide me as to what actions should I take to create
ext4 filesystem on LV of 3.8TB on PV resiging on /dev/sdb ?

TIA,

jasohl 10-19-2012 02:50 AM

GParted is a really nice GUI but it doesn't support LVM. I know Red Hat / Fedora has a GUI tool specifically for LVM. But I don't know of a GUI that does both LVM and File System stuff. :(

I don't have much experience with software RAID. But assuming /dev/sdb is a RAID block device I would do the following things.
(But first... Note: Making changes to partition tables and filesystems can result in complete loss of data. You are ultimately responsible for your data. IE, have a backup, understand commands, don't copy/paste commands.)

Use fdisk to delete all partitions

LVM:
Code:

pvcreate /dev/sdb
vgextend VolGroup /dev/sdb
lvcreate -l 100%PVS -n lv_graphics VolGroup /dev/sdb

File system and mount:
Code:

mkfs.ext4 /dev/mapper/VolGroup-lv_graphics
mount /dev/mapper/VolGroup-lv_graphics /home/GRAPHICS

Size restrictions shouldn't be an issue here. EXT4 supports up to 16TB and I honestly don't know if there is any limit to LVM.
I would caution you about the RAID 0. Make sure you have backups.

Another thing you can do is just attach both disks and use LVM to combine them into a single volume. That might be easier to manage then a RAID. You could more easily expand or shrink the volume.

Hope that helps some.

kaza 10-20-2012 06:37 AM

Hi jasohl, thanks for the reply.

In fact, after some more reading and searching among the commands
I found that using the "gdisk /dev/sdb" I can create the GPT-type
partition ("LINUX LVM", type code: "8E00") and after that
I could use the "system-config-lvm" to create the physical
volume, logical group and logical volume. Currently, it's
mounted on a slightly differently named directory than my
final intention:

Code:

<localhost.localdomain>.../user>df
Filesystem                                1K-blocks    Used  Available Use% Mounted on
rootfs                                    102534472 12850732  84475268  14% /
devtmpfs                                    8173528        0    8173528  0% /dev
tmpfs                                        8218184      152    8218032  1% /dev/shm
tmpfs                                        8218184    1256    8216928  1% /run
/dev/mapper/VolGroup-lv_root              102534472 12850732  84475268  14% /
tmpfs                                        8218184        0    8218184  0% /sys/fs/cgroup
tmpfs                                        8218184        0    8218184  0% /media
/dev/sda1                                    1032088  123232    856428  13% /boot
/dev/mapper/VolGroup-lv_home              135079152 73994472  54223064  58% /home
/dev/mapper/VolGroup_graphics-lv_graphics 3839491472 23288632 3621167912  1% /home/user/GRAPHICS_lv

After I'll compare the contents of the old GRAPHICS
and the new GRAPHICS_lv directories, I'll need to
boot LINUX into command line mode (without the desktop coming up),
to rename "GRAPHICS" to "GRAPHICS_old", to rename "GRAPHICS_lv"
to "GRAPHICS", to edit appropriately the /etc/fstab, to reboot
and hopefully the GUI (with various links from GRAPHICS to the desktop)
won't notice any change.

Now I need to find out how to pause the boot process and
force the command line boot...

TIA,

kaza 10-22-2012 01:33 AM

Solved!

It took some time to figure out where to add the "3" on the grub2 menu (most searches showed a single line command,
not a multi-line entry) but finally I could boot without desktop starting, to rename "GRAPHICS" to "GRAPHICS_old",
to attempt renaming "GRAPHICS_lv" to "GRAPHICS, to encounter an error "device busy" (or something like
thhis), to attempt unmount, to get the same error, to rename back, to reboot normally, to comment the line in /etc/fstab
which mounts the new disk, to reboot into command line, this time to successfully rename everything
as I want, to replace /etc/fstab with the one with mount command to "GRAPHICS" instead of "GRAPHICS_lv"
and after reboot - everything is as I want it: new 3.6 TB disk (hardware RAID 0) is mounted on "GRAPHICS"
directory.

Thanks for all the help,
kaza.


All times are GMT -5. The time now is 02:10 PM.