[kwlug-disc] Adding (setting up) 2nd disk.
unsolicited at swiz.ca
Tue Jan 26 15:35:36 EST 2010
Which is what I originally said, I think. But posed more as a
tentative question than a statement. Guessing.
Can you lay out a command line example? (Getting my head around this.)
Both solutions seem equally viable and worth knowing and comprehending.
Raul Suarez wrote, On 01/26/2010 3:29 PM:
> Having said that. You could mount the second drive in a directory
> and then create /home and /data symlinks to those sub directories
> --- On Tue, 1/26/10, Raul Suarez <rarsa at yahoo.com> wrote:
>> From: Raul Suarez <rarsa at yahoo.com> Subject: Re: [kwlug-disc]
>> Adding (setting up) 2nd disk. To: "KWLUG discussion"
>> <kwlug-disc at kwlug.org> Received: Tuesday, January 26, 2010, 3:20
>> PM I think there is some confusion here:
>> You mount file systems into directories. You do not mount
>> partitions. You do not mount directories.
>> If you have your second partition with two directories /home
>> you actually mount the / of that file system into a directory of
>> the primary file system.
>> Raul Suarez
>> Technology consultant Software, Hardware and Practices
>> _________________ http://rarsa.blogspot.com/ An eclectic
>> collection of random thoughts
>> --- On Tue, 1/26/10, unsolicited <unsolicited at swiz.ca> wrote:
>>> From: unsolicited <unsolicited at swiz.ca> Subject: Re:
>>> [kwlug-disc] Adding (setting up) 2nd
>>> To: "KWLUG discussion" <kwlug-disc at kwlug.org> Received:
>>> Tuesday, January 26, 2010, 3:00 PM Thanks for the note. I get
>>> all this. Or I'm still missing something. The instructions
>>> to be putting /home and /data on different partitions,
>>> the same one.
>>> (It's a laptop - there ain't gonna be any more disks
>>> partitions, and it isn't going to grow any. Otherwise,
>>> probably would have used LVM.)
>>> What I don't get is how both /home and /data are on
>>> second disk (partition actually, but never mind that),
>>> fstab is mounting /home at /dev/sda6. (When / is
>>> How is /data on the 2nd disk set up?
>>> Unless fstab mounts /disk2 at /dev/sda6, I create /disk2/home
>>> and /disk2/data and create /home and /data
>>> links (hard?) there.
>>> Good search terms for such aren't occurring to me.
>>> Thanks for any thoughts.
>>> john at netdirect.ca wrote, On 01/26/2010 10:46 AM:
>>>> kwlug-disc-bounces at kwlug.org
>>> wrote on 01/26/2010 08:39:14 AM:
>>>>> I'm setting up a kubuntu 9.10 box, 3
>>> OS, swap, data.
>>>>> I would like /home and other good stuff, say
>>> /data, to be on the second disk.
>>>>> How do I do this / what are the magic google
>>>>> mount the 2nd disk as /disk2, and create
>> /home and
>>> /data and link them to /home and /data on the 2nd
>>>>> Normally, one would make an entire partition
>>> /something, like /home. Here I want multiple
>> /somethings on
>>> the second disk.
>>>>> Are there other good things that should be
>>> too? I presume /etc is right out, probably /usr too.
>>>>> Good reference doc appreciated - "linux
>>> partitioning" drowns me as a search term.
>>>> It a fairly subtle task and might not be
>>>> On a new install you would choose an advanced
>> disk set
>>> up and set up partitions and mount points manually.
>>>> If you are retro-fitting a disk then you could do
>>> short set of simple commands (assuming /dev/sdb)
>>>> 1. fdisk /dev/sdb # Create partitions, if they
>>> already exist. Keep in mind any data on the disk will
>>>> 2. mke2fs -j /dev/sdb1; mke2fs -j /dev/sdb2 #
>>> file systems.
>>>> 3. Edit /etc/fstab to add the new file systems,
>>> then on the proper destinations (i.e. /home and
>>>> 4. mount /home; mount /data # Mount the file
>>> This command will ensure that you fstab entries are correct.
>>>> A side task might be to temporarily mount the
>>> systems (mkdir -p /mnt/tmp; mount /dev/sdb1 /mnt/tmp)
>>> move over the data from the existing folder (mv
>>> /mnt/tmp). Then umount and mount on the right mount
>>> (umount /mnt/tmp; mount /home)
>>>> You might also consider using LVM instead of raw
>>> partitions. LVM allows you to expand file systems
>> easily and
>>> add disks as needed. This is a little more
>>>> 1. fdisk /dev/sdb # create one partition 2. pvcreate
>>>> /dev/sdb1 # Initialize the partition
>> as a
>>> LVM Physical Volume
>>>> 3. vgcreate MyData /dev/sdb1 # Create the Volume
>>> named MyData
>>>> 4. lvcreate -L 20G -n home MyData # Create a
>>> volume group named "home"
>>>> 5. lvcreate -L 60G -n data MyData #Create a 60GB
>>> volume named "data"
>>>> 6. mke2fs -j /dev/MyData/home; mke2fs -j
>>> /dev/MyData/data # Create file systems on the LVs
>>>> 7. Edit /etc/fstab and add the file systems. 8. mount /home;
>>>> mount /data # Mount the file
>>>> When creating LVs you might want to consider
>>> unallocated space. In other words don't assign all the
>>> space to LVs. Then as you use the file systems you
>> will see
>>> where you need more space and you can re-allocate
>> then. It's
>>> easy to add disk to an LV, it's harder to take it
>>>> John Van Ostrand Net Direct Inc. CTO, co-CEO 564 Weber St. N.
>>>> Unit 12 map Waterloo, ON N2L 5C6 john at netdirect.ca Ph:
>>>> 866-883-1172 ext.5102 Linux Solutions / IBM Hardware Fx:
>>>> kwlug-disc_kwlug.org mailing list
>>>> kwlug-disc_kwlug.org at kwlug.org
>>> kwlug-disc_kwlug.org mailing list
>>> kwlug-disc_kwlug.org at kwlug.org
>> The new Internet Explorer® 8 - Faster, safer, easier. Optimized
>> for Yahoo! Get it Now for Free! at
>> kwlug-disc_kwlug.org mailing list kwlug-disc_kwlug.org at kwlug.org
> Connect with friends from any web browser - no download required.
> Try the new Yahoo! Canada Messenger for the Web BETA at
> kwlug-disc_kwlug.org mailing list kwlug-disc_kwlug.org at kwlug.org
More information about the kwlug-disc