Re: Moving to LVM
* Stefan Monnier (2009-03-18): That said, two ext3 filesystems would be absolutely OK with me, as long as I could merge them virtually, so my movieplayer (dbox2) would have to access just one directory, and deleting files from that directory would result in deleting the original file (not just a symbolic link). I could create a more... symlink on disk1 pointing to disk2, but I really want everything in one directory, alphabetically. You can play around with unionfs or mount --bind and things like that, but my recommendation is to not bother: they can be very useful for various situations, but from what I can tell it won't bring enough benefits in your case (e.g. in a unionfs, erasing a directory will only erase it from the top directory, not the underlying one). I gave unionfs a try (etch 2.6.18 plus its unionfs module source, self-compiled), was able to 'unify' my directories, and export the union mount via NFS. However I can't get any client to mount them. Regular NFS exports of /mnt/{mybook,samsung} with the same syntax work, just to mention it. # mount -t nfs 192.168.1.5:/mnt/flicks -o rw,soft,tcp,nolock,rsize=32768,wsize=32768 /mnt/filme/ mount: 192.168.1.5:/mnt/flicks failed, reason given by server: Permission denied mount: nfsmount failed: Bad file descriptor mount: Mounting 192.168.1.5:/mnt/flicks on /mnt/filme/ failed: Bad file descriptor # /etc/fstab /dev/sda1 /mnt/mybook ext3 defaults,noauto,noatime,nodiratime 0 0 /dev/sdb1 /mnt/samsung ext3 defaults, noauto,noatime,nodiratime 0 0 unionfs /mnt/flicks unionfs noauto,dirs=/mnt/samsung/flicks=rw:/mnt/mybook/flicks=rw 0 0 # /etc/exports /mnt/flicks 192.168.1.0/24(rw,async,no_subtree_check,all_squash,anonuid=1000,anongid=1000) # lsmod Module Size Used by nfs 284632 0 nfsd 268428 13 exportfs6784 1 nfsd lockd 76980 3 nfs,nfsd nfs_acl 4480 2 nfs,nfsd sunrpc193128 13 nfs,nfsd,lockd,nfs_acl ipv6 319916 16 unionfs96324 1 fuse 52852 1 dm_mod 68912 0 usbhid 53636 0 Tried the entire exports(5) arsenal of fsid,crossmnt,nohide etc., also exporting to a single host pp., no go. Using symlinks might not always do exactly what you want, but symlinks are well understood by all the usual tools and can be manipulated without needing root proviledge, so it'll always be easy to see what's going on and to fix things. That's not necessarily the case with funny mounts. If only they were fun mounts. Well, symlinks... I fear I'm at a point where I have to get used to the idea. -André -- May as well be hung for a sheep as a lamb! Linkstation/KuroBox/HG/HS/Tera Kernel 2.6/PPC from http://hvkls.dyndns.org iPhone http://hvkls.dyndns.org/downloads/documentation/README-iphone.html -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: Moving to LVM
Boyd Stephen Smith Jr. wrote: In jwvwsap9oo1.fsf-monnier+gmane.linux.debian.u...@gnu.org, Stefan Monnier wrote: What happens if, for whatever reason, just one of the disks is available? You lose it all (pretty much). For that reason, it's not recommended, unless you have backups elsewhere. You don't really lose it all. If the disk is just unavailable, the VG is just unavailable. Bringing both disks on-line simultaneously will restore your access to the VG and all its LVs. If one disk dies or gets corrupted, you can still recover some of the data on the other disk. LVs that reside only on the good disk(s) will be completely safe. LVs that reside only on the bad disk(s) will be entirely lost. OP explicitly asked about creating _one_ LV. He also claimed that there is no third disk available for backup or data recovery. I agree with Stefan that for the particular scenario OP describes, LVM may not be the optimum solution. I'd suggest that he'll probably be more comfortable with just two partitions, splitting his media files, so in the end he will know which files he will retain in case of disk failure. The alternative of creating two volumes, each covering one whole disk, renders the concept of LVM pretty much useless. The comfort of administering just one LV, covering both disks carries the risk that most of the data will be useless on failure of one disk and possible data recovery will be difficult to predict. The 'classical' two partition approach at least gives the possibility to save some crucial data to *both* disks. IMO, LVM is a replacement for partition tables not for RAID or backups. Agreed! Cheers, Johannes -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: Moving to LVM
On Tue, Mar 17, 2009 at 08:18:28AM +0100, Johannes Wiedersich wrote: Boyd Stephen Smith Jr. wrote: In jwvwsap9oo1.fsf-monnier+gmane.linux.debian.u...@gnu.org, Stefan Monnier wrote: What happens if, for whatever reason, just one of the disks is available? You lose it all (pretty much). For that reason, it's not recommended, unless you have backups elsewhere. You don't really lose it all. If the disk is just unavailable, the VG is just unavailable. Bringing both disks on-line simultaneously will restore your access to the VG and all its LVs. If one disk dies or gets corrupted, you can still recover some of the data on the other disk. LVs that reside only on the good disk(s) will be completely safe. LVs that reside only on the bad disk(s) will be entirely lost. OP explicitly asked about creating _one_ LV. He also claimed that there is no third disk available for backup or data recovery. Lose one, you've lost everything. [I lost a 2TB array that way]. USB not really reliable enough. [Lost a 750G disk when it fell 40cm to a carpeted floor too :( ] AndyC -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: Moving to LVM
* André Berger (2009-03-16): (Replying to myself and trying to sum up your AQs) Thank you all for the helpful discussion and detailed instructions, _much appreciated_. I'm aware of the significance of backups, and keep redundant backups of 'important' data. The files in question are 'just movies' I would miss but could live without. Not that I wanted to avoid lose them though. That said, two ext3 filesystems would be absolutely OK with me, as long as I could merge them virtually, so my movieplayer (dbox2) would have to access just one directory, and deleting files from that directory would result in deleting the original file (not just a symbolic link). I could create a more... symlink on disk1 pointing to disk2, but I really want everything in one directory, alphabetically. Could mount --bind come to the rescue? But if I mounted one directory 'over' another, it would 'cover' the original one, which wouldn't be accessible any more, would it? -André -- May as well be hung for a sheep as a lamb! Linkstation/KuroBox/HG/HS/Tera Kernel 2.6/PPC from http://hvkls.dyndns.org iPhone http://hvkls.dyndns.org/downloads/documentation/README-iphone.html -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: Moving to LVM
André Berger wrote: * André Berger (2009-03-16): (Replying to myself and trying to sum up your AQs) Thank you all for the helpful discussion and detailed instructions, _much appreciated_. I'm aware of the significance of backups, and keep redundant backups of 'important' data. The files in question are 'just movies' I would miss but could live without. Not that I wanted to avoid lose them though. That said, two ext3 filesystems would be absolutely OK with me, as long as I could merge them virtually, so my movieplayer (dbox2) would have to access just one directory, and deleting files from that directory would result in deleting the original file (not just a symbolic link). I could create a more... symlink on disk1 pointing to disk2, but I really want everything in one directory, alphabetically. Could mount --bind come to the rescue? But if I mounted one directory 'over' another, it would 'cover' the original one, which wouldn't be accessible any more, would it? -André maybe a bit far fetched, but what about AFS instead of the NFS you mentioned? not 100% sure it would be feasible in this case, but still. -- www.songshu.org Just another collection of nuts -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: Moving to LVM
In 20090317141915.ga61...@fuchs, André Berger wrote: That said, two ext3 filesystems would be absolutely OK with me, as long as I could merge them virtually, so my movieplayer (dbox2) would have to access just one directory. You might want to look into unionfs (or other layered file systems), that is probably closer to what you want. The unioned file system will still become unavailable if you don't have both ext3 file systems, but since the underlying file systems are separate, losing one will not affect the other at all. Could mount --bind come to the rescue? But if I mounted one directory 'over' another, it would 'cover' the original one, which wouldn't be accessible any more, would it? That's exactly right. So, it's not as simple as a single mount --bind. If you are using directories/folders to organize the files at all, you might be able to partition the directories between the file systems and just bind mount the directories to one consistent view and avoid using unionfs. -- Boyd Stephen Smith Jr. ,= ,-_-. =. b...@iguanasuicide.net ((_/)o o(\_)) ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-' http://iguanasuicide.net/\_/ signature.asc Description: This is a digitally signed message part.
Re: Moving to LVM
The comfort of administering just one LV, covering both disks carries the risk that most of the data will be useless on failure of one disk and possible data recovery will be difficult to predict. The 'classical' two partition approach at least gives the possibility to save some crucial data to *both* disks. You could also create 2 LVs: one spread over both disks, and the other mirrored on both disks, so you'd put the important stuff on the mirrored one and then use the rest for disposable files. Stefan -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: Moving to LVM
That said, two ext3 filesystems would be absolutely OK with me, as long as I could merge them virtually, so my movieplayer (dbox2) would have to access just one directory, and deleting files from that directory would result in deleting the original file (not just a symbolic link). I could create a more... symlink on disk1 pointing to disk2, but I really want everything in one directory, alphabetically. You can play around with unionfs or mount --bind and things like that, but my recommendation is to not bother: they can be very useful for various situations, but from what I can tell it won't bring enough benefits in your case (e.g. in a unionfs, erasing a directory will only erase it from the top directory, not the underlying one). Using symlinks might not always do exactly what you want, but symlinks are well understood by all the usual tools and can be manipulated without needing root proviledge, so it'll always be easy to see what's going on and to fix things. That's not necessarily the case with funny mounts. Stefan -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: Moving to LVM
André Berger wrote: Hi there! I'm on Etch and have got two external USB disks, one GB each in size. Disk1 contains one ext3 partition and my media files, and is full. Disk2 is empty and should take future media files. I don't have a third disk I could use for backups. My plan is to create a Logical Volume Group to span two partitions located on different disks, and export that LV group via NFS. If I got it right (please correct me), I need partitions of type 8e on both disks. So I thought I 1 partition disk2 8e 2 create a LV group and add disk2/p1 to it 3 create an ext3 filesystem on the LV 3 copy the data from disk1/p1 to the LV 4 partition disk1/p1 8e 5 add disk1/p1 to the LV group 6 resize the LV ext3 filesystem to 2 TB, so it spans both disks resp. partitions you're basically on the right track, but there are 3 things to understand about LVM 1 Physical Volume 2 Volume Group 3 Logical Volume 1 in this case is disk1 and (eventually) disk2 2 is (eventually) disk1 + disk2 together so they appear as one 3 is a partition you can place on 2 What happens if, for whatever reason, just one of the disks is available? to make a long story short, if you combine the 2 disks as one, you are going to wish you had a third disk for backups. -André -- www.songshu.org Just another collection of nuts -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: Moving to LVM
André Berger wrote: What happens if, for whatever reason, just one of the disks is available? You are out of luck and loose access to any of your data. You didn't expect something else, did you? Cheers, Johannes -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: Moving to LVM
In 20090316183713.ga...@fuchs, André Berger wrote: My plan is to create a Logical Volume Group to span two partitions located on different disks, and export that LV group via NFS. If I got it right (please correct me), I need partitions of type 8e on both disks. LVM is happy to use any block device as a PV. I use whole disks in some cases and partitions in other cases. Even if you are using partitions, they don't have to be of type 8e normally. (I have found some installer programs that don't like it when your PVs are not partitions of type 8e, but I consider those broken; the LVM core is not picky in that regard.) So I thought I 1 partition disk2 8e 2 create a LV group and add disk2/p1 to it 2a Create a PV from disk2/p1 2b Create a VG containing one PV, disk2/p1 2c Create a LV from that VG. 3 create an ext3 filesystem on the LV 3 copy the data from disk1/p1 to the LV 4 partition disk1/p1 8e 5 add disk1/p1 to the LV group 5a Create a PV from disk1/p1 5b Extend the existing VG by adding disk1/p1 6 resize the LV ext3 filesystem to 2 TB, so it spans both disks resp. partitions Does this sound right to you? Maybe you could help me with the necessary command as well... # disk1/p1 = /dev/sda1 # disk2/p1 = /dev/sdb1 pvcreate /dev/sdb1 vgcreate vg_name /dev/sdb1 lvcreate -L size -n lv_name vg_name mkfs.ext3 /dev/mapper/vg_name-lv_name mkdir /mnt/old mkdir /mnt/new mount /dev/sda1 /mnt/old mount /dev/mapper/vg_name-lv_name /mnt/new rsync -aHAX --progress --stats /mnt/old/. /mnt/new/. umount /mnt/old umount /mnt/new # Entirely optional. pvcreate /dev/sda1 vgextend vg_name /dev/sda1 lvextend -L new_size vg_name/lv_name I think that's correct, but I'm not looking at a man page right now and it's been a while since I needed to extend a VG. What happens if, for whatever reason, just one of the disks is available? The entire VG is unavailable. It can be manually brought up in partial mode. In partial mode, only the LVs that reside entirely on available disks will be available -- they must have NO sectors allocated on unavailable disks. In a disaster recovery scenario, it is possible to insert a different device (/dev/zero might work, usually a new disk is better) as the missing PV, but this should be a last-resort behavior. -- Boyd Stephen Smith Jr. ,= ,-_-. =. b...@iguanasuicide.net ((_/)o o(\_)) ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-' http://iguanasuicide.net/\_/ signature.asc Description: This is a digitally signed message part.
Re: Moving to LVM
What happens if, for whatever reason, just one of the disks is available? You lose it all (pretty much). For that reason, it's not recommended, unless you have backups elsewhere. Stefan -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: Moving to LVM
In jwvwsap9oo1.fsf-monnier+gmane.linux.debian.u...@gnu.org, Stefan Monnier wrote: What happens if, for whatever reason, just one of the disks is available? You lose it all (pretty much). For that reason, it's not recommended, unless you have backups elsewhere. You don't really lose it all. If the disk is just unavailable, the VG is just unavailable. Bringing both disks on-line simultaneously will restore your access to the VG and all its LVs. If one disk dies or gets corrupted, you can still recover some of the data on the other disk. LVs that reside only on the good disk(s) will be completely safe. LVs that reside only on the bad disk(s) will be entirely lost. For accessing LVs that have segments allocated from both disks, you can get the old PV's UUID from the VGDA backups (or the good disk) and create a new PV with the same UUID. Then, you can fsck your file systems and continue with data recovery. It's not pretty, and you'll almost certainly lose more data than if the disks were completely separate file systems, but you should be able to recover some data. You can make this easier by making sure a backup file system header is stored on each disk. IMO, LVM is a replacement for partition tables not for RAID or backups. -- Boyd Stephen Smith Jr. ,= ,-_-. =. b...@iguanasuicide.net ((_/)o o(\_)) ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-' http://iguanasuicide.net/\_/ signature.asc Description: This is a digitally signed message part.